Merge branch 'master' of https://scm.cri.ensmp.fr/git/Faustine
[Faustine.git] / interpretor / faust-0.9.47mr3 / examples / faust-stk / Makefile.qtcompile
1 ###--------------------------------------------
2 ### DEST : directory where to put binaries
3 ### ARCH : faust architecture file
4
5 system := $(shell uname -s)
6 dspsrc := $(wildcard *.dsp)
7 cppsrc := $(addprefix $(DEST), $(dspsrc:.dsp=.cpp))
8
9
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++
14 else
15 appls := $(addprefix $(DEST), $(dspsrc:.dsp=))
16 SPEC :=
17 endif
18 ### --------------------------------------------
19
20
21 ### allocate a unique directory
22 TDR := $(shell mktemp -d -t FAUST.XXXXXX)
23 TMP = $(TDR)/$(<:.dsp=)
24 ### --------------------------------------------
25
26
27 all : $(appls)
28
29
30 ### Darwin
31 $(DEST)%.app : %.dsp
32 install -d $(TMP)
33 faust -a $(ARCH) $(VEC) $< -o $(TMP)/$<.cpp
34 cd $(TMP); qmake -project "$(DEFS)" "INCLUDEPATH+=/usr/local/lib/faust/" "INCLUDEPATH+=$(PWD)" "INCLUDEPATH+=/usr/local/lib/faust/osclib" "LIBS+=$(LIB)" "HEADERS+=/usr/local/lib/faust/gui/faustqt.h"
35 cd $(TMP); qmake $(SPEC)
36 make -C $(TMP)
37 rm -rf $@
38 mv $(TMP)/$(<:.dsp=.app) $(DEST)
39 rm -rf $(TDR)
40
41
42 ### Linux
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)
50
51 $(DEST)% : %.dsp
52 rm -rf $(TMP)
53 install -d $(TMP)
54 faust -a $(ARCH) $(VEC) $< -o $(TMP)/$<.cpp
55 cd $(TMP); $(qm) -project "$(DEFS)" "INCLUDEPATH+=/usr/local/lib/faust/" "INCLUDEPATH+=$(PWD)" "INCLUDEPATH+=/usr/local/lib/faust/osclib" "LIBS+=$(LIB)" "HEADERS+=$(hdir)faustqt.h"
56 cd $(TMP); $(qm) $(SPEC)
57 make -C $(TMP)
58 mv $(TMP)/$(<:.dsp=) $@
59 rm -rf $(TMP)
60
61 clean:
62 rm -rf $(DEST)