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.

90 lines
3.7 KiB

#Will be added by configure before this line:
##PREFIX
#PROGRAM
#VERSION
#This is a makefile and needs tabs, not spaces.
.PHONY: install uninstall clean gitclean resources calfbox
all: | calfbox
#Our Program
printf "prefix = \"$(PREFIX)\"" > compiledprefix.py
PYTHONPATH="site-packages" python3 -m nuitka --recurse-all --python-flag -O --warn-unusual-code --warn-implicit-exceptions --recurse-not-to=PyQt5 --show-progress --show-modules --file-reference-choice=runtime $(PROGRAM)
rm compiledprefix.py
#A mode that just compiles calfbox locally so you can run the whole program standalone without nuitka
calfbox:
mkdir -p site-packages
#First build the shared lib. Instead of running make install we create the lib ourselves directly
cd template/calfbox && echo $(shell pwd)
#cd template/calfbox && make && make install DESTDIR=$(shell pwd)/../../site-packages
cd template/calfbox && make
cp template/calfbox/.libs/libcalfbox.so.0.0.0 site-packages/"lib$(PROGRAM).so.$(VERSION)"
#We need to be in the directory, make uses subshells which will forget the work-dir in the next line. So here is a trick:
#cd template/calfbox && python3 setup.py build && python3 setup.py install --user --install-lib ../../site-packages
#The line above is too much for our specialized use-case. We just copy the few files we need manually.
mkdir -p site-packages/calfbox
cp template/calfbox/py/cbox.py site-packages/calfbox
cp template/calfbox/py/_cbox2.py site-packages/calfbox
cp template/calfbox/py/__init__.py site-packages/calfbox
cp template/calfbox/py/metadata.py site-packages/calfbox
cp template/calfbox/py/sfzparser.py site-packages/calfbox
cp template/calfbox/py/nullbox.py site-packages/calfbox
clean:
cd template/calfbox && make distclean && rm -rf build
rm -rf site-packages
rm -f "$(PROGRAM).bin"
rm -rf "$(PROGRAM).build"
rm Makefile
#Convenience function for developing, not used for the build or install process
gitclean:
git clean -f -X -d
#Convenience function for developing, not used for the build or install process
resources:
cd template/documentation && python3 build.py
cd documentation && sh build-documentation.sh
cd qtgui/resources && sh buildresources.sh
install:
install -D -m 755 $(PROGRAM).bin $(DESTDIR)$(PREFIX)/bin/$(PROGRAM)
install -D -m 644 documentation/out/* -t $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)
install -D -m 644 README.md $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)/README.md
install -D -m 644 LICENSE $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)/LICENSE
install -D -m 644 desktop/desktop.desktop $(DESTDIR)$(PREFIX)/share/applications/$(PROGRAM).desktop
#Icons
for size in 16 32 64 128 256 512 ; do \
install -D -m 644 desktop/images/"$$size"x"$$size".png $(DESTDIR)$(PREFIX)/share/icons/hicolor/"$$size"x"$$size"/apps/$(PROGRAM).png ; \
done
install -D -m 644 desktop/images/256x256.png $(DESTDIR)$(PREFIX)/share/pixmaps/$(PROGRAM).png
install -D -m 755 site-packages/lib$(PROGRAM).so.$(VERSION) -t $(DESTDIR)$(PREFIX)/lib/$(PROGRAM)
mkdir -p $(DESTDIR)$(PREFIX)/share/$(PROGRAM)/
cp -r engine/resources/* $(DESTDIR)$(PREFIX)/share/$(PROGRAM)/
install -D -m 644 template/engine/resources/metronome/* -t $(DESTDIR)$(PREFIX)/share/$(PROGRAM)/template/metronome
uninstall:
#Directories
rm -rf $(DESTDIR)$(PREFIX)/share/template/$(PROGRAM)
rm -rf $(DESTDIR)$(PREFIX)/share/doc/$(PROGRAM)
rm -rf $(DESTDIR)$(PREFIX)/share/$(PROGRAM)
rm -rf $(DESTDIR)$(PREFIX)/lib/$(PROGRAM)
#Files
rm -f $(DESTDIR)$(PREFIX)/bin/$(PROGRAM)
rm -f $(DESTDIR)$(PREFIX)/share/applications/$(PROGRAM).desktop
#Icons
for size in 16 32 64 128 256 512 ; do \
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/"$$size"x"$$size"/apps/$(PROGRAM).png ; \
done
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/$(PROGRAM).png