File: Makefile

package info (click to toggle)
faust 0.9.46-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 15,256 kB
  • ctags: 9,961
  • sloc: cpp: 47,746; sh: 2,254; ansic: 1,503; makefile: 1,211; ruby: 950; yacc: 468; objc: 459; lex: 200; xml: 177
file content (92 lines) | stat: -rw-r--r-- 2,247 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92

# Generic Makefile for Faust Pd plugins.
# Translates ordinary effects (.dsp) and synths (.syn => -n 8).

# make, make all: make plugins and wrappers
# make cpp: make C++ sources
# make svg: make SVG diagrams
# make clean: remove all generated stuff

DLL = .pd_linux
shared = -shared

# Try to guess the host system type and figure out platform specifics.
host = $(shell ../../config.guess)
ifneq "$(findstring -mingw,$(host))" ""
# Windows
DLL = .dll
PDLIB = -Wl,--enable-auto-import -lpd
endif
ifneq "$(findstring x86_64-,$(host))" ""
# 64 bit, needs -fPIC flag
EXTRA_CFLAGS += -fPIC
endif
ifneq "$(findstring x86,$(host))" ""
# architecture-specific options for x86 and x86_64
EXTRA_CFLAGS += -msse -ffast-math
endif

# Try to figure out the Pd include directory.
pdincdir = $(strip $(shell pkg-config pd --cflags-only-I 2>/dev/null))
ifeq "$(pdincdir)" ""
# Try some common locations.
pdincdir = $(addprefix -I,$(shell ls -d /usr/local/include/pdextended /usr/local/include/pd /usr/include/pdextended /usr/include/pd 2>/dev/null))
endif
EXTRA_CFLAGS += $(pdincdir)

# Define the desired number of voices for synth (.syn) plugins here:
NVOICES = 8

dspsrc  := $(wildcard *.dsp)
synsrc  := $(wildcard *.syn)
cppsrc  := $(dspsrc:.dsp=.cpp) $(synsrc:.syn=.cpp)
plugins	:= $(dspsrc:%.dsp=%~$(DLL)) $(synsrc:%.syn=%~$(DLL))
svg 	:= $(dspsrc:.dsp=.dsp-svg) $(synsrc:.syn=.syn-svg)
xml 	:= $(dspsrc:.dsp=.dsp.xml) $(synsrc:.syn=.syn.xml)
pd 	:= $(dspsrc:.dsp=.pd) $(synsrc:.syn=.pd)

#faust2pd = faust2pd
faust2pd = ../../faust2pd

#all: $(plugins) $(svg) $(pd)
all: $(plugins) $(pd)
cpp: $(cppsrc)
svg: $(svg)
xml: $(xml)
pd:  $(pd)

clean:
	rm -Rf *~ $(plugins)

distclean: clean
	rm -f $(cppsrc)

realclean: distclean
	rm -Rf $(svg) $(xml) $(pd)

%.dsp-svg: %.dsp
	faust -svg $< -o /dev/null >/dev/null

%.syn-svg: %.syn
	faust -svg $< -o /dev/null >/dev/null

%.cpp: %.dsp
	faust $(VEC) -a puredata.cpp $< -o $@

%.cpp: %.syn
	faust $(VEC) -a puredata.cpp $< -o $@

%.dsp.xml: %.dsp
	faust -xml $< -o /dev/null

%.syn.xml: %.syn
	faust -xml $< -o /dev/null

%~$(DLL): %.cpp
	$(CXX) $(shared) $(EXTRA_CFLAGS) $(CFLAGS) -Dmydsp=$(@:%~$(DLL)=%) $< -o $@ $(PDLIB)

%.pd: %.dsp.xml
	$(faust2pd) -s $<

%.pd: %.syn.xml
	$(faust2pd) -n $(NVOICES) -s $<