Mac OS X gamepad emulator for serial RC transmitters
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Makefile 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # ----------------------------------------------------------------------------
  2. # "THE BEER-WARE LICENSE" (Revision 42):
  3. # <xythobuz@xythobuz.de> wrote this file. As long as you retain this notice
  4. # you can do whatever you want with this stuff. If we meet some day, and you
  5. # think this stuff is worth it, you can buy me a beer in return. Thomas Buck
  6. # ----------------------------------------------------------------------------
  7. CFLAGS ?= -Wall -pedantic -std=c11
  8. # Build everything
  9. all: bin/protocol bin/foohid build/Release/SerialGamepad.app build/Installer.pkg
  10. cp -R build/Release/SerialGamepad.app bin/SerialGamepad.app
  11. cp -R build/Installer.pkg bin/SerialGamepad.pkg
  12. # Install locally
  13. install: bin/protocol bin/foohid build/Release/SerialGamepad.app
  14. cp bin/protocol /usr/local/bin/serial-protocol
  15. cp bin/foohid /usr/local/bin/foohid
  16. cp -r build/Release/SerialGamepad.app /Applications/SerialGamepad.app
  17. # Build GUI project
  18. build/Release/SerialGamepad.app: SerialGamepad SerialGamepad.xcodeproj
  19. xcodebuild
  20. # Build protocol binary
  21. bin/protocol: src/serial.o src/protocol.o
  22. @mkdir -p bin
  23. $(CC) -o bin/protocol src/serial.o src/protocol.o
  24. # Build foohid binary
  25. bin/foohid: src/serial.o src/foohid.o
  26. @mkdir -p bin
  27. $(CC) -o bin/foohid -framework IOKit src/serial.o src/foohid.o
  28. # Download foohid binary dependency
  29. build/foohid.pkg:
  30. @mkdir -p build
  31. curl -o build/foohid.pkg \
  32. -L https://github.com/unbit/foohid/releases/download/0.1/foohid.pkg
  33. # Create installer pkg for our App
  34. build/SerialGamepad.pkg: build/Release/SerialGamepad.app
  35. pkgbuild \
  36. --root build/Release/SerialGamepad.app \
  37. --identifier de.xythobuz.SerialGamepad \
  38. --install-location "/Applications/SerialGamepad.app" \
  39. build/SerialGamepad.pkg
  40. # Create installer bundling our App and fooHID
  41. build/Installer.pkg: build/SerialGamepad.pkg build/foohid.pkg Resources
  42. productbuild \
  43. --distribution Resources/Distribution.xml \
  44. --package-path build \
  45. --resources Resources \
  46. build/Installer.pkg
  47. # Delete intermediate files
  48. clean:
  49. rm -rf bin
  50. rm -rf build
  51. rm -rf src/*.o