Cleaning the examples' Makefiles and octaves scripts.
[Faustine.git] / interpretor / preprocessor / faust-0.9.47mr3 / tools / faust2pd / examples / seqdemo / Makefile
1 DLL = .pd_linux
2 shared = -shared
3
4 # Try to guess the host system type and figure out platform specifics.
5 host = $(shell ../../config.guess)
6 ifneq "$(findstring -mingw,$(host))" ""
7 # Windows
8 DLL = .dll
9 PDLIB = -Wl,--enable-auto-import -lpd
10 endif
11 ifneq "$(findstring x86_64-,$(host))" ""
12 # 64 bit, needs -fPIC flag
13 EXTRA_CFLAGS += -fPIC
14 endif
15 ifneq "$(findstring x86,$(host))" ""
16 # architecture-specific options for x86 and x86_64
17 EXTRA_CFLAGS += -msse -ffast-math
18 endif
19
20 # Try to figure out the Pd include directory.
21 pdincdir = $(strip $(shell pkg-config pd --cflags-only-I 2>/dev/null))
22 ifeq "$(pdincdir)" ""
23 # Try some common locations.
24 pdincdir = $(addprefix -I,$(shell ls -d /usr/local/include/pdextended /usr/local/include/pd /usr/include/pdextended /usr/include/pd 2>/dev/null))
25 endif
26 EXTRA_CFLAGS += $(pdincdir)
27
28 dspsrc := $(wildcard *.dsp)
29 cppsrc := $(dspsrc:.dsp=.cpp)
30 mods := $(dspsrc:%.dsp=%~$(DLL))
31 svg := $(dspsrc:.dsp=.svg)
32 xml := $(dspsrc:.dsp=.dsp.xml)
33 pd := $(dspsrc:.dsp=.pd)
34 libs := $(wildcard *.lib)
35
36 ARCH = puredata.cpp
37 #FAUST2PD = faust2pd
38 FAUST2PD = ../../faust2pd
39 # faust2pd options (the -s forces additional number controls for each slider)
40 # a number of other options are supported, run faust2pd -h for help
41 F2PDFLAGS = -s
42
43 all: $(mods) $(pd)
44
45 cpp: $(cppsrc)
46
47 svg: $(svg)
48
49 xml: $(xml)
50
51 %~$(DLL): %.cpp
52 $(CXX) $(shared) $(EXTRA_CFLAGS) $(CFLAGS) -Dmydsp=$(@:%~$(DLL)=%) $< -o $@ $(PDLIB)
53
54 %.cpp: %.dsp
55 faust $(VEC) -a $(ARCH) $< -o $@
56
57 %.svg: %.dsp
58 faust -svg $< -o /dev/null >/dev/null
59
60 %.dsp.xml: %.dsp
61 faust -xml $< -o /dev/null
62
63 # synths
64
65 NVOICES = 2
66
67 organ.pd: organ.dsp.xml
68 $(FAUST2PD) $(F2PDFLAGS) -n $(NVOICES) $<
69
70 subtractive.pd: subtractive.dsp.xml
71 $(FAUST2PD) $(F2PDFLAGS) -n $(NVOICES) $<
72
73 karplusplus.pd: karplusplus.dsp.xml
74 $(FAUST2PD) $(F2PDFLAGS) -n $(NVOICES) $<
75
76 # other dsps (effect units)
77
78 %.pd: %.dsp.xml
79 $(FAUST2PD) $(F2PDFLAGS) $<
80
81 clean:
82 rm -f $(mods) *~ *.a *.o
83
84 distclean:
85 rm -f $(mods) $(cppsrc) *~ *.a *.o
86
87 clean-cpp:
88 rm -f $(cppsrc)
89
90 clean-xml:
91 rm -f $(xml)
92
93 clean-pd:
94 rm -f $(pd)
95
96 clean-svg:
97 rm -rf *-svg
98
99 realclean:
100 rm -f $(mods) $(cppsrc) $(xml) $(pd) *~ *.a *.o
101 rm -rf *-svg