Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > contrib-release > by-pkgid > f1370d9b17597db213c06ccf33274692 > files > 84

faust-0.9.10-5mdv2010.1.x86_64.rpm

# Makefile to produce supercollider plugins with Faust
# 	'foo.dsp' -> 'foo.so' and 'foo.sc'
#

dspsrc  	:= $(wildcard *.dsp)
scfiles		:= $(addprefix $(DEST), $(dspsrc:.dsp=.sc))
sofiles		:= $(addprefix $(DEST), $(dspsrc:.dsp=.so))
CXXFLAGS 	:= `pkg-config --cflags libscsynth` $(CXXFLAGS)
LIB 		:= -shared


###--------------------------------------------
### Will use faust2sc to create the class file
### only if it is installed

helper:=$(shell whereis faust2sc)

ifeq ($(helper),faust2sc:)
	todo:=$(sofiles)
else
	todo:=$(sofiles) $(scfiles)
endif


###--------------------------------------------


all : $(todo)

$(DEST)%.cpp: %.dsp
	faust -a $(ARCH) $< -o $@

$(DEST)%.so: $(DEST)%.cpp
	$(CXX) $(CXXFLAGS) $(OPTFLAGS) $(LIB) $< -o $@

$(DEST)%.sc : %.dsp.xml
	faust2sc --prefix=Faust $< --output=$@

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