GNUmakefile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name := icarus
  2. build := performance
  3. flags += -I. -I.. -I../higan
  4. nall.path := ../nall
  5. include $(nall.path)/GNUmakefile
  6. hiro.path := ../hiro
  7. hiro.resource := resource/$(name).rc
  8. include $(hiro.path)/GNUmakefile
  9. icarus.path := ../icarus
  10. objects := icarus resource
  11. objects := $(objects:%=$(object.path)/%.o)
  12. $(object.path)/icarus.o: $(icarus.path)/icarus.cpp
  13. $(object.path)/resource.o: $(icarus.path)/resource/resource.cpp
  14. all: $(hiro.objects) $(objects)
  15. $(info Linking $(output.path)/$(name) ...)
  16. +@$(compiler) -o $(output.path)/$(name) $(hiro.objects) $(objects) $(hiro.options) $(options)
  17. ifeq ($(platform),macos)
  18. rm -rf $(output.path)/$(name).app
  19. mkdir -p $(output.path)/$(name).app/Contents/MacOS/
  20. mkdir -p $(output.path)/$(name).app/Contents/Resources/
  21. mv $(output.path)/$(name) $(output.path)/$(name).app/Contents/MacOS/$(name)
  22. cp resource/$(name).plist $(output.path)/$(name).app/Contents/Info.plist
  23. sips -s format icns resource/$(name).png --out $(output.path)/$(name).app/Contents/Resources/$(name).icns
  24. endif
  25. verbose: hiro.verbose nall.verbose all;
  26. clean:
  27. ifeq ($(platform),macos)
  28. rm -rf $(output.path)/$(name).app
  29. endif
  30. $(call delete,$(object.path)/*)
  31. $(call delete,$(output.path)/*)
  32. install: all
  33. ifeq ($(platform),windows)
  34. mkdir -p $(prefix)/$(name)/
  35. mkdir -p $(prefix)/$(name)/Database/
  36. mkdir -p $(prefix)/$(name)/Firmware/
  37. cp -R Database/* $(prefix)/$(name)/Database/
  38. cp -R Firmware/* $(prefix)/$(name)/Firmware/
  39. else ifeq ($(shell id -un),root)
  40. $(error "make install should not be run as root")
  41. else ifeq ($(platform),macos)
  42. cp -R $(output.path)/$(name).app /Applications/$(name).app
  43. else ifneq ($(filter $(platform),linux bsd),)
  44. mkdir -p $(prefix)/bin/
  45. mkdir -p $(prefix)/share/applications/
  46. mkdir -p $(prefix)/share/icons/
  47. mkdir -p $(prefix)/share/$(name)/
  48. mkdir -p $(prefix)/share/$(name)/Database/
  49. mkdir -p $(prefix)/share/$(name)/Firmware/
  50. cp $(output.path)/$(name) $(prefix)/bin/$(name)
  51. sed "/^Exec/s:$(name):$(prefix)/bin/$(name):" resource/$(name).desktop >$(prefix)/share/applications/$(name).desktop
  52. cp resource/$(name).png $(prefix)/share/icons/$(name).png
  53. cp -R Database/* $(prefix)/share/$(name)/Database/
  54. cp -R Firmware/* $(prefix)/share/$(name)/Firmware/
  55. endif
  56. uninstall:
  57. ifeq ($(platform),windows)
  58. else ifeq ($(shell id -un),root)
  59. $(error "make uninstall should not be run as root")
  60. else ifeq ($(platform),macos)
  61. rm -rf /Applications/$(name).app
  62. else ifneq ($(filter $(platform),linux bsd),)
  63. rm -f $(prefix)/bin/$(name)
  64. rm -f $(prefix)/share/applications/$(name).desktop
  65. rm -f $(prefix)/share/icons/$(name).png
  66. endif
  67. -include $(object.path)/*.d