Mac OS X gamepad emulator for serial RC transmitters
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Makefile 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. # C Compiler flags for command line apps
  8. CFLAGS ?= -Wall -pedantic -std=c11
  9. # Targets that don't name any created files
  10. .PHONY: all install distribute clean
  11. # Build all binaries
  12. all: bin/protocol bin/foohid build/Release/SerialGamepad.app
  13. cp -R build/Release/SerialGamepad.app bin/SerialGamepad.app
  14. # Install locally
  15. install: bin/protocol bin/foohid build/Release/SerialGamepad.app
  16. cp bin/protocol /usr/local/bin/serial-protocol
  17. cp bin/foohid /usr/local/bin/foohid
  18. cp -r build/Release/SerialGamepad.app /Applications/SerialGamepad.app
  19. # Build GUI project
  20. build/Release/SerialGamepad.app: SerialGamepad SerialGamepad.xcodeproj
  21. xcodebuild
  22. # Build protocol binary
  23. bin/protocol: src/serial.o src/protocol.o
  24. @mkdir -p bin
  25. $(CC) -o bin/protocol src/serial.o src/protocol.o
  26. # Build foohid binary
  27. bin/foohid: src/serial.o src/foohid.o
  28. @mkdir -p bin
  29. $(CC) -o bin/foohid -framework IOKit src/serial.o src/foohid.o
  30. # Build distributable installer package
  31. distribute: build/Installer.pkg
  32. @mkdir -p bin
  33. cp -R build/Installer.pkg bin/SerialGamepad.pkg
  34. # Download foohid binary dependency
  35. build/foohid.pkg:
  36. @mkdir -p build
  37. curl -o build/foohid.pkg \
  38. -L https://github.com/unbit/foohid/releases/download/0.1/foohid.pkg
  39. # Create installer pkg for our App
  40. build/SerialGamepad.pkg: build/Release/SerialGamepad.app
  41. pkgbuild \
  42. --root build/Release/SerialGamepad.app \
  43. --identifier de.xythobuz.SerialGamepad \
  44. --install-location "/Applications/SerialGamepad.app" \
  45. build/SerialGamepad.pkg
  46. # Create installer bundling our App and fooHID
  47. build/Installer.pkg: build/SerialGamepad.pkg build/foohid.pkg Resources
  48. productbuild \
  49. --distribution Resources/Distribution.xml \
  50. --package-path build \
  51. --resources Resources \
  52. build/Installer.pkg
  53. # Delete intermediate files
  54. clean:
  55. rm -rf bin
  56. rm -rf build
  57. rm -rf src/*.o