4 # Try to guess the host system type and figure out platform specifics.
5 host
= $(shell ..
/..
/config.guess
)
6 ifneq "$(findstring -mingw,$(host))" ""
9 PDLIB
= -Wl
,--enable-auto-import
-lpd
11 ifneq "$(findstring x86_64-,$(host))" ""
12 # 64 bit, needs -fPIC flag
15 ifneq "$(findstring x86,$(host))" ""
16 # architecture-specific options for x86 and x86_64
17 EXTRA_CFLAGS
+= -msse
-ffast-math
20 # Try to figure out the Pd include directory.
21 pdincdir
= $(strip $(shell pkg-config pd
--cflags-only-I
2>/dev
/null
))
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
))
26 EXTRA_CFLAGS
+= $(pdincdir
)
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
)
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
52 $(CXX
) $(shared
) $(EXTRA_CFLAGS
) $(CFLAGS
) -Dmydsp
=$(@
:%~
$(DLL
)=%) $< -o
$@
$(PDLIB
)
55 faust
$(VEC
) -a
$(ARCH
) $< -o
$@
58 faust
-svg
$< -o
/dev
/null
>/dev
/null
61 faust
-xml
$< -o
/dev
/null
67 organ.pd
: organ.dsp.xml
68 $(FAUST2PD
) $(F2PDFLAGS
) -n
$(NVOICES
) $<
70 subtractive.pd
: subtractive.dsp.xml
71 $(FAUST2PD
) $(F2PDFLAGS
) -n
$(NVOICES
) $<
73 karplusplus.pd
: karplusplus.dsp.xml
74 $(FAUST2PD
) $(F2PDFLAGS
) -n
$(NVOICES
) $<
76 # other dsps (effect units)
79 $(FAUST2PD
) $(F2PDFLAGS
) $<
82 rm -f
$(mods
) *~
*.a
*.o
85 rm -f
$(mods
) $(cppsrc
) *~
*.a
*.o
100 rm -f
$(mods
) $(cppsrc
) $(xml
) $(pd
) *~
*.a
*.o