Mac OS X gamepad emulator for serial RC transmitters
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Makefile 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. @rm -rf bin/SerialGamepad.app
  14. @cp -R build/Release/SerialGamepad.app bin/SerialGamepad.app
  15. # Install locally
  16. install: bin/protocol bin/foohid build/Release/SerialGamepad.app
  17. cp bin/protocol /usr/local/bin/serial-protocol
  18. cp bin/foohid /usr/local/bin/foohid
  19. @rm -rf /Applications/SerialGamepad.app
  20. cp -r build/Release/SerialGamepad.app /Applications/SerialGamepad.app
  21. # Build GUI project
  22. build/Release/SerialGamepad.app: SerialGamepad SerialGamepad.xcodeproj
  23. xcodebuild
  24. # Build protocol binary
  25. bin/protocol: src/serial.o src/protocol.o
  26. @mkdir -p bin
  27. $(CC) -o bin/protocol src/serial.o src/protocol.o
  28. # Build foohid binary
  29. bin/foohid: src/serial.o src/foohid.o
  30. @mkdir -p bin
  31. $(CC) -o bin/foohid -framework IOKit src/serial.o src/foohid.o
  32. # Build distributable installer package
  33. distribute: build/Installer.pkg
  34. @mkdir -p bin
  35. @rm -rf bin/SerialGamepad.pkg
  36. @cp -R build/Installer.pkg bin/SerialGamepad.pkg
  37. # Download foohid binary dependency
  38. build/foohid.pkg:
  39. @mkdir -p build
  40. curl -o build/foohid.pkg \
  41. -L https://github.com/unbit/foohid/releases/download/0.1/foohid.pkg
  42. # Create installer pkg for our App
  43. build/SerialGamepad.pkg: build/Release/SerialGamepad.app
  44. pkgbuild \
  45. --root build/Release/SerialGamepad.app \
  46. --identifier de.xythobuz.SerialGamepad \
  47. --install-location "/Applications/SerialGamepad.app" \
  48. build/SerialGamepad.pkg
  49. # Create installer bundling our App and fooHID
  50. build/Installer.pkg: build/SerialGamepad.pkg build/foohid.pkg Resources
  51. productbuild \
  52. --distribution Resources/Distribution.xml \
  53. --package-path build \
  54. --resources Resources \
  55. build/Installer.pkg
  56. # Delete intermediate files
  57. clean:
  58. rm -rf bin
  59. rm -rf build
  60. rm -rf src/*.o