1 ###--------------------------------------------
2 ### DEST : directory where to put binaries
3 ### ARCH : faust architecture file
5 system := $(shell uname -s)
6 dspsrc := $(wildcard *.dsp)
7 cppsrc := $(addprefix $(DEST), $(dspsrc:.dsp=.cpp))
10 ### check what type of applications to build (MacOSX Darwin or Linux)
11 ifeq ($(system), Darwin)
12 appls := $(addprefix $(DEST), $(dspsrc:.dsp=.app))
13 SPEC := -spec macx-g++
15 appls := $(addprefix $(DEST), $(dspsrc:.dsp=))
18 ### --------------------------------------------
21 ### allocate a unique directory
22 TDR := $(shell mktemp -d -t FAUST.XXXXXX)
23 TMP = $(TDR)/$(<:.dsp=)
24 ### --------------------------------------------
33 faust -a $(ARCH) $(VEC) $< -o $(TMP)/$<.cpp
34 cd $(TMP); qmake -project "$(DEFS)" "INCLUDEPATH+=/usr/local/lib/faust/" "INCLUDEPATH+=/usr/local/lib/faust/osclib" "LIBS+=$(LIB)" "HEADERS+=/usr/local/lib/faust/gui/faustqt.h"
35 cd $(TMP); qmake $(SPEC)
38 mv $(TMP)/$(<:.dsp=.app) $(DEST)
43 hdir1 := $(wildcard /usr/local/lib/faust/gui/faustqt.h)
44 hdir2 := $(wildcard /usr/share/faust/faustqt.h)
45 hdir3 := $(wildcard /usr/local/lib/faust/faustqt.h)
46 hdir23 := $(if $(hdir2),$(dir $(hdir2)),$(dir $(hdir3)))
47 hdir := $(if $(hdir1),$(dir $(hdir1)),$(hdir23))
48 qm4 := $(shell which qmake-qt4)
49 qm := $(if $(qm4),$(qm4),qmake)
54 faust -a $(ARCH) $(VEC) $< -o $(TMP)/$<.cpp
55 cd $(TMP); $(qm) -project "$(DEFS)" "INCLUDEPATH+=/usr/local/lib/faust/" "INCLUDEPATH+=/usr/local/lib/faust/osclib" "LIBS+=$(LIB)" "HEADERS+=$(hdir)faustqt.h"
56 cd $(TMP); $(qm) $(SPEC)
58 mv $(TMP)/$(<:.dsp=) $@