Music production session manager https://www.laborejo.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
3.2KB

  1. #This is a makefile and needs tabs, not spaces.
  2. .PHONY: install uninstall clean gitclean resources
  3. all:
  4. #Our Program
  5. mkdir -p build
  6. cd build && printf "prefix = \"$(PREFIX)\"" > compiledprefix.py
  7. #Only copy the needed files
  8. cp -r "$(PROGRAM)" __main__.py engine qtgui build
  9. #Clean all pycache in build
  10. cd build && find . -type d -name "__pycache__" -exec rm -r {} +
  11. python3 -m zipapp "build" --output="$(PROGRAM).bin" --python="/usr/bin/env python3"
  12. rm build/compiledprefix.py
  13. #nsm-data
  14. mkdir -p buildnsmdata
  15. cp tools/nsm-data buildnsmdata/__main__.py
  16. cp tools/nsmclient.py buildnsmdata/nsmclient.py
  17. cd buildnsmdata && find . -type d -name "__pycache__" -exec rm -r {} +
  18. python3 -m zipapp "buildnsmdata" --output="nsm-data.bin" --python="/usr/bin/env python3"
  19. clean:
  20. rm -rf build/
  21. rm -rf buildnsmdata/
  22. rm -f "$(PROGRAM).bin"
  23. rm -f "nsm-data.bin"
  24. rm Makefile
  25. find . -type d -name "__pycache__" -exec rm -r {} +
  26. #Convenience function for developing, not used for the build or install process
  27. gitclean:
  28. git clean -f -X -d
  29. #Convenience function for developing, not used for the build or install process
  30. resources:
  31. cd documentation && python3 build.py
  32. cd documentation && sh build-documentation.sh
  33. cd qtgui/resources && sh buildresources.sh
  34. install:
  35. #nsm-data
  36. install -D -m 755 "nsm-data.bin" $(DESTDIR)$(PREFIX)/bin/nsm-data
  37. #Agordejo
  38. install -D -m 755 $(PROGRAM).bin $(DESTDIR)$(PREFIX)/bin/$(PROGRAM)
  39. install -D -m 644 documentation/out/* -t $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)
  40. install -D -m 644 README.md $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)/README.md
  41. install -D -m 644 LICENSE $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)/LICENSE
  42. install -D -m 644 desktop/desktop.desktop $(DESTDIR)$(PREFIX)/share/applications/org.laborejo.agordejo.desktop
  43. install -D -m 644 desktop/agordejo-continue.desktop $(DESTDIR)$(PREFIX)/share/applications/org.laborejo.agordejo-continue.desktop
  44. install -d $(DESTDIR)$(PREFIX)/share/man/man1
  45. gzip -c documentation/$(PROGRAM).1 > $(DESTDIR)$(PREFIX)/share/man/man1/$(PROGRAM).1.gz
  46. gzip -c documentation/nsm-data.1 > $(DESTDIR)$(PREFIX)/share/man/man1/nsm-data.1.gz
  47. #Icons
  48. for size in 16 32 64 128 256 512 ; do \
  49. install -D -m 644 desktop/images/"$$size"x"$$size".png $(DESTDIR)$(PREFIX)/share/icons/hicolor/"$$size"x"$$size"/apps/$(PROGRAM).png ; \
  50. done
  51. install -D -m 644 desktop/images/256x256.png $(DESTDIR)$(PREFIX)/share/pixmaps/$(PROGRAM).png
  52. #Engine resources
  53. install -d $(DESTDIR)$(PREFIX)/share/$(PROGRAM)
  54. cp -r engine/resources/* $(DESTDIR)$(PREFIX)/share/$(PROGRAM)/
  55. uninstall:
  56. #Directories
  57. rm -rf $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)
  58. rm -rf $(DESTDIR)$(PREFIX)/share/$(PROGRAM)
  59. #Files
  60. rm -f $(DESTDIR)$(PREFIX)/bin/$(PROGRAM)
  61. rm -f $(DESTDIR)$(PREFIX)/bin/nsm-data
  62. rm -f $(DESTDIR)$(PREFIX)/share/applications/org.laborejo.agordejo.desktop
  63. rm -f $(DESTDIR)$(PREFIX)/share/applications/org.laborejo.agordejo-continue.desktop
  64. rm -f $(DESTDIR)$(PREFIX)/share/man/man1/$(PROGRAM).1.gz
  65. rm -f $(DESTDIR)$(PREFIX)/share/man/man1/nsm-data.1.gz
  66. #Icons
  67. for size in 16 32 64 128 256 512 ; do \
  68. rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/"$$size"x"$$size"/apps/$(PROGRAM).png ; \
  69. done
  70. rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/$(PROGRAM).png