@ -5,45 +5,22 @@
#VERSION
#This is a makefile and needs tabs, not spaces.
.PHONY : install uninstall clean gitclean resources calfbox
.PHONY : install uninstall clean gitclean resources
all : | calfbox
all :
#Our Program
mkdir -p build
cd build && printf " prefix = \" $( PREFIX) \" " > compiledprefix.py
#Only copy the needed files
cp -r " $( PROGRAM) " __main__.py engine qtgui sitepackages template build
#We only need the installed calfbox in local sitepackages. The repo in template is full with build data anyway, don't zip that in.
rm -rf build/template/calfbox
cp -r " $( PROGRAM) " __main__.py engine qtgui template build
#Clean all pycache in build
cd build && find . -type d -name "__pycache__" -exec rm -r { } +
python3 -m zipapp "build" --output= " $( PROGRAM) .bin " --python= "/usr/bin/env python3"
rm build/compiledprefix.py
#A mode that just compiles calfbox locally so you can run the whole program standalone
calfbox :
mkdir -p sitepackages
#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)/../../sitepackages
cd template/calfbox && make
cp template/calfbox/.libs/libcalfbox.so.0.0.0 sitepackages/" 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 ../../sitepackages
#The line above is too much for our specialized use-case. We just copy the few files we need manually.
mkdir -p sitepackages/calfbox
cp template/calfbox/py/cbox.py sitepackages/calfbox
cp template/calfbox/py/_cbox2.py sitepackages/calfbox
cp template/calfbox/py/__init__.py sitepackages/calfbox
cp template/calfbox/py/metadata.py sitepackages/calfbox
cp template/calfbox/py/sfzparser.py sitepackages/calfbox
cp template/calfbox/py/nullbox.py sitepackages/calfbox
clean :
cd template/calfbox && make distclean && rm -rf build
cd template/calfbox && rm -rf .deps/ Makefile.in aclocal.m4 autom4te.cache/ compile config.guess config.h.in config.h.in~ config.sub configure depcomp install-sh ltmain.sh missing
rm -rf build/
rm -rf sitepackages
rm -f " $( PROGRAM) .bin "
rm Makefile
find . -type d -name "__pycache__" -exec rm -r { } +
@ -78,8 +55,6 @@ install:
done
install -D -m 644 desktop/images/256x256.png $( DESTDIR) $( PREFIX) /share/pixmaps/$( PROGRAM) .png
install -D -m 755 sitepackages/lib$( PROGRAM) .so.$( VERSION) -t $( DESTDIR) $( PREFIX) /lib/$( PROGRAM)
install -d $( 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
@ -89,7 +64,6 @@ uninstall:
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)