forked from eberdahl/SaM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.qtcompile
80 lines (63 loc) · 2.13 KB
/
Makefile.qtcompile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
###--------------------------------------------
### DEST : directory where to put binaries
### ARCH : faust architecture file
system := $(shell uname -s)
ifdef SAMTARGET
dspsrc := $(SAMTARGET).mdl
else
dspsrc := $(wildcard *.mdl)
endif
cppsrc := $(addprefix $(DEST), $(dspsrc:.mdl=.cpp))
dspfile := $(dspsrc:.mdl=.dsp)
mdxfile := $(dspsrc:.mdl=.mdx)
### check what type of applications to build (MacOSX Darwin or Linux)
ifeq ($(system), Darwin)
appls := $(addprefix $(DEST), $(dspsrc:.mdl=.app))
SPEC := -spec macx-g++ QMAKE_CXXFLAGS=-fpermissive
else
appls := $(addprefix $(DEST), $(dspsrc:.mdl=))
SPEC :=
endif
### --------------------------------------------
### allocate a unique directory
TDR := $(shell mktemp -d -t FAUST.XXXXXX)
TMP = $(TDR)/$(<:.dsp=)
### --------------------------------------------
all : $(mdxfile) $(dspfile) $(appls)
### Darwin
%.mdx : %.mdl
@perl SAM-preprocessor $< $@
%.dsp : %.mdx
perl Synth-A-Modeler $< $@
$(DEST)%.app : %.dsp
install -d $(TMP)
faust -double -a $(ARCH) $(VEC) $< -o $(TMP)/$<.cpp
cd $(TMP); qmake -project "$(DEFS)" "INCLUDEPATH+=/usr/local/lib/faust/" "INCLUDEPATH+=/usr/local/include/faust/" "INCLUDEPATH+=/usr/local/lib/faust/osclib" "LIBS+=$(LIB)" "HEADERS+=/usr/local/lib/faust/gui/faustqt.h"
cd $(TMP); qmake $(SPEC)
make -C $(TMP)
rm -rf $@
mv $(TMP)/$(<:.dsp=.app) $(DEST)
rm -rf $(TDR)
### Linux
hdir1 := $(wildcard /usr/local/lib/faust/gui/faustqt.h)
hdir2 := $(wildcard /usr/share/faust/faustqt.h)
hdir3 := $(wildcard /usr/local/lib/faust/faustqt.h)
hdir23 := $(if $(hdir2),$(dir $(hdir2)),$(dir $(hdir3)))
hdir := $(if $(hdir1),$(dir $(hdir1)),$(hdir23))
qm4 := $(shell which qmake-qt4)
qm := $(if $(qm4),$(qm4),qmake)
%.mdx : %.mdl
perl SAM-preprocessor $< $@
%.dsp : %.mdx
perl Synth-A-Modeler $< $@
$(DEST)% : %.dsp
rm -rf $(TMP)
install -d $(TMP)
faust -double -a $(ARCH) $(VEC) $< -o $(TMP)/$<.cpp
cd $(TMP); $(qm) -project "$(DEFS)" "INCLUDEPATH+=/usr/local/lib/faust/" "INCLUDEPATH+=/usr/local/lib/faust/osclib" "LIBS+=$(LIB)" "HEADERS+=$(hdir)faustqt.h"
cd $(TMP); $(qm) $(SPEC)
make -C $(TMP)
mv $(TMP)/$(<:.dsp=) $@
rm -rf $(TMP)
clean:
rm -rf $(DEST)