2 # Generic Makefile for Faust Pd plugins.
3 # Translates ordinary effects (.dsp) and synths (.syn => -n 8).
5 # make, make all: make plugins and wrappers
6 # make cpp: make C++ sources
7 # make svg: make SVG diagrams
8 # make clean: remove all generated stuff
13 # Try to guess the host system type and figure out platform specifics.
14 host
= $(shell ..
/..
/config.guess
)
15 ifneq "$(findstring -mingw,$(host))" ""
18 PDLIB
= -Wl
,--enable-auto-import
-lpd
20 ifneq "$(findstring x86_64-,$(host))" ""
21 # 64 bit, needs -fPIC flag
24 ifneq "$(findstring x86,$(host))" ""
25 # architecture-specific options for x86 and x86_64
26 EXTRA_CFLAGS
+= -msse
-ffast-math
29 # Try to figure out the Pd include directory.
30 pdincdir
= $(strip $(shell pkg-config pd
--cflags-only-I
2>/dev
/null
))
32 # Try some common locations.
33 pdincdir
= $(addprefix -I
,$(shell ls
-d
/usr
/local
/include/pdextended
/usr
/local
/include/pd
/usr
/include/pdextended
/usr
/include/pd
2>/dev
/null
))
35 EXTRA_CFLAGS
+= $(pdincdir
)
37 # Define the desired number of voices for synth (.syn) plugins here:
40 dspsrc
:= $(wildcard *.dsp
)
41 synsrc
:= $(wildcard *.syn
)
42 cppsrc
:= $(dspsrc
:.dsp
=.
cpp) $(synsrc
:.syn
=.
cpp)
43 plugins
:= $(dspsrc
:%.dsp
=%~
$(DLL
)) $(synsrc
:%.syn
=%~
$(DLL
))
44 svg
:= $(dspsrc
:.dsp
=.dsp-svg
) $(synsrc
:.syn
=.syn-svg
)
45 xml
:= $(dspsrc
:.dsp
=.dsp.xml
) $(synsrc
:.syn
=.syn.xml
)
46 pd
:= $(dspsrc
:.dsp
=.pd
) $(synsrc
:.syn
=.pd
)
49 faust2pd
= ..
/..
/faust2pd
51 #all: $(plugins) $(svg) $(pd)
65 rm -Rf
$(svg
) $(xml
) $(pd
)
68 faust
-svg
$< -o
/dev
/null
>/dev
/null
71 faust
-svg
$< -o
/dev
/null
>/dev
/null
74 faust
$(VEC
) -a puredata.
cpp $< -o
$@
77 faust
$(VEC
) -a puredata.
cpp $< -o
$@
80 faust
-xml
$< -o
/dev
/null
83 faust
-xml
$< -o
/dev
/null
86 $(CXX
) $(shared
) $(EXTRA_CFLAGS
) $(CFLAGS
) -Dmydsp
=$(@
:%~
$(DLL
)=%) $< -o
$@
$(PDLIB
)
92 $(faust2pd
) -n
$(NVOICES
) -s
$<