12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
-
-
-
-
-
-
-
-
- CFLAGS ?= -Wall -pedantic -std=c11
-
-
- .PHONY: all install distribute clean
-
-
- all: bin/protocol bin/foohid build/Release/SerialGamepad.app
- @rm -rf bin/SerialGamepad.app
- @cp -R build/Release/SerialGamepad.app bin/SerialGamepad.app
-
-
- install: bin/protocol bin/foohid build/Release/SerialGamepad.app
- cp bin/protocol /usr/local/bin/serial-protocol
- cp bin/foohid /usr/local/bin/foohid
- @rm -rf /Applications/SerialGamepad.app
- cp -r build/Release/SerialGamepad.app /Applications/SerialGamepad.app
-
-
- build/Release/SerialGamepad.app: SerialGamepad SerialGamepad.xcodeproj
- xcodebuild
-
-
- bin/protocol: src/serial.o src/protocol.o
- @mkdir -p bin
- $(CC) -o bin/protocol src/serial.o src/protocol.o
-
-
- bin/foohid: src/serial.o src/foohid.o
- @mkdir -p bin
- $(CC) -o bin/foohid -framework IOKit src/serial.o src/foohid.o
-
-
- distribute: build/Installer.pkg
- @mkdir -p bin
- @rm -rf bin/SerialGamepad.pkg
- @cp -R build/Installer.pkg bin/SerialGamepad.pkg
-
-
- build/foohid.pkg:
- @mkdir -p build
- curl -o build/foohid.pkg \
- -L https://github.com/unbit/foohid/releases/download/0.1/foohid.pkg
-
-
- build/SerialGamepad.pkg: build/Release/SerialGamepad.app
- pkgbuild \
- --root build/Release/SerialGamepad.app \
- --identifier de.xythobuz.SerialGamepad \
- --install-location "/Applications/SerialGamepad.app" \
- build/SerialGamepad.pkg
-
-
- build/Installer.pkg: build/SerialGamepad.pkg build/foohid.pkg Resources
- productbuild \
- --distribution Resources/Distribution.xml \
- --package-path build \
- --resources Resources \
- build/Installer.pkg
-
-
- clean:
- rm -rf bin
- rm -rf build
- rm -rf src/*.o
|