X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/c7f552fd8888da2f0d8cfb228fe0f28d3df3a12c..b4b6f2ea75b9f0f3ca918f5b84016610bf7a4d4f:/interpretor/preprocessor/faust-0.9.47mr3/examples/Makefile.pdcompile diff --git a/interpretor/preprocessor/faust-0.9.47mr3/examples/Makefile.pdcompile b/interpretor/preprocessor/faust-0.9.47mr3/examples/Makefile.pdcompile new file mode 100644 index 0000000..affd4b4 --- /dev/null +++ b/interpretor/preprocessor/faust-0.9.47mr3/examples/Makefile.pdcompile @@ -0,0 +1,75 @@ + +###-------------------------------------------- +### Build puredata externals on Darwin or Linux +### + +system := $(shell uname -s) +DEST := pddir/ +dspsrc := $(wildcard *.dsp) +cppsrc := $(addprefix $(DEST), $(dspsrc:.dsp=.cpp)) +patches := $(addprefix $(DEST), $(dspsrc:.dsp=.pd)) +FAUST2PD := faust2pd +F2PDFLAGS := -r 10 -s + +###-------------------------------------------- +### compilation flags for Linux +### +LINUXCFLAGS := -DPD -fPIC -Wall -O3 -mfpmath=sse -msse -msse2 -msse3 -ffast-math +LINUXINCLUDE := -I/usr/include/pdextended + +###-------------------------------------------- +### compilation flags for Darwin +### +DARWINCFLAGS := -DPD -fPIC -Wall -O3 -mfpmath=sse -msse -msse2 -msse3 -ffast-math +DYNLOAD_FLAGS := -bundle -undefined suppress -flat_namespace +DARWININCLUDE := -I/Applications/Pd-extended.app/Contents/Resources/include/ + +###-------------------------------------------- +### check what type of modules to build (MacOSX Darwin or Linux) +### +ifeq ($(system), Darwin) +modules := $(addprefix $(DEST), $(dspsrc:.dsp=~.pd_darwin)) +else +modules := $(addprefix $(DEST), $(dspsrc:.dsp=~.pd_linux)) +endif + + +###-------------------------------------------- +### Will use faust2pd to create the GUI patches +### only if it is installed + +helper:=$(shell which faust2pd) +hasfaust2pd := $(findstring /faust2pd, $(helper)) + +ifeq ($(hasfaust2pd),) + todo:=$(modules) +else + todo:=$(modules) $(patches) +endif + +###-------------------------------------------- + + +allmodules: $(todo) + +$(DEST)%.cpp: %.dsp + faust -a $(ARCH) $< -o $@ + +$(DEST)%.pd: %.dsp + faust -xml $< -o /dev/null + $(FAUST2PD) $(F2PDFLAGS) $<.xml + mv $(<:.dsp=.pd) $(DEST) + rm -f $<.xml + +$(DEST)%~.pd_linux: $(DEST)%.cpp + $(CXX) $(LINUXCFLAGS) $(LINUXINCLUDE) -shared -Dmydsp=$(patsubst %~.pd_linux,%,$(notdir $@)) $< -o $@ + +# On Darwin we create both 32-bits and 64-bits intel code +$(DEST)%~.pd_darwin: $(DEST)%.cpp + $(CXX) -arch i386 $(DARWINCFLAGS) $(DARWININCLUDE) $(DYNLOAD_FLAGS) -Dmydsp=$(patsubst %~.pd_darwin,%,$(notdir $@)) $< -o $@.i386 + $(CXX) -arch x86_64 $(DARWINCFLAGS) $(DARWININCLUDE) $(DYNLOAD_FLAGS) -Dmydsp=$(patsubst %~.pd_darwin,%,$(notdir $@)) $< -o $@.x86_64 + lipo -create $@.i386 $@.x86_64 -output $@ + rm $@.i386 $@.x86_64 + +clean: + rm -rf $(DEST)