New directory tree, with preprocessor/ inside interpretor/.
[Faustine.git] / interpretor / preprocessor / faust-0.9.47mr3 / tools / faust2pd / examples / basic / 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 F2PDFLAGS = -s
40
41 all: $(mods)
42
43 cpp: $(cppsrc)
44
45 svg: $(svg)
46
47 xml: $(xml)
48
49 %~$(DLL): %.cpp
50 $(CXX) $(shared) $(EXTRA_CFLAGS) $(CFLAGS) -Dmydsp=$(@:%~$(DLL)=%) $< -o $@ $(PDLIB)
51
52 %.cpp: %.dsp
53 faust $(VEC) -a $(ARCH) $< -o $@
54
55 %.svg: %.dsp
56 faust -svg $< -o /dev/null >/dev/null
57
58 %.dsp.xml: %.dsp
59 faust -xml $< -o /dev/null
60
61 %.pd: %.dsp.xml
62 $(FAUST2PD) $(F2PDFLAGS) $<
63
64 clean:
65 rm -f $(mods) *~ *.a *.o
66
67 distclean:
68 rm -f $(mods) $(cppsrc) *~ *.a *.o
69
70 clean-cpp:
71 rm -f $(cppsrc)
72
73 clean-xml:
74 rm -f $(xml)
75
76 clean-pd:
77 rm -f $(pd)
78
79 clean-svg:
80 rm -rf *-svg
81
82 realclean:
83 rm -f $(mods) $(cppsrc) $(xml) $(pd) *~ *.a *.o
84 rm -rf *-svg