Makefile 850 B

123456789101112131415161718192021222324252627282930
  1. WIT_BASE = $(abspath ./libwwt/wiimms-iso-tools/project)
  2. # TODO split into multiple lines
  3. INCLUDE_DIRS = "$(WIT_BASE)/:$(WIT_BASE)/src/:$(WIT_BASE)/src/libwbfs/:$(WIT_BASE)/src/crypto/:$(WIT_BASE)/dclib/:./libwwt/:/usr/include/:/usr/local/include/"
  4. ifeq ($(PREFIX),)
  5. PREFIX := usr/
  6. endif
  7. # Build shared lib from wwt
  8. .PHONY : bundle
  9. bundle:
  10. # Clone libwwt as needed
  11. if [ ! -d "./libwwt" ]; then \
  12. git clone --recurse-submodules "https://notabug.org/CYBERDEViL/libwwt"; \
  13. fi
  14. # Build libwwt
  15. @cd libwwt && $(MAKE) shared
  16. # Build pywwt
  17. @python3 setup.py build_ext --include-dirs="$(INCLUDE_DIRS)" --library-dirs="./libwwt/bin/shared/"
  18. .PHONY : install
  19. install:
  20. # Install libwwt
  21. @PREFIX="$(PREFIX)" DESTDIR="${DESTDIR}" $(MAKE) -C ./libwwt/ install
  22. # Install pywwt
  23. @python3 setup.py install --root="$(DESTDIR)" --optimize=1 --skip-build