Sophie

Sophie

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

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


###--------------------------------------------
### adjust flags to the system
###

system			:= $(shell uname -s)

ifeq ($(system), Darwin)
LIB := -I/Library/Frameworks/CsoundLib.framework/Headers -I/usr/local/include -framework CsoundLib -L/usr/local/lib -lsndfile -dynamiclib
else
#LIB := -I/usr/local/include -lsndfile -lcsound -shared
LIB := -I/usr/include/csound -shared -fPIC
endif

###For Windows with gcc/mingw:(if headers in /usr/local/include and libs in /usr/local/lib)
###g++ -O2  -shared -o myopcode.dylib myopcode.cpp -DOPCODE_NAME=myopcode -I/usr/local/include -lsndfile -lcsound32


###--------------------------------------------
### Build csound opcodes on Darwin or Linux (fx.dsp -> fx.cpp -> fx.dylib)
###

dspsrc  := $(wildcard *.dsp)
##cppsrc  := $(addprefix $(DEST), $(dspsrc:.dsp=.cpp))
opcodes := $(addprefix $(DEST), $(dspsrc:.dsp=.dylib))



all :  $(opcodes)


$(DEST)%.dylib : %.dsp
	faust $(VEC) -uim -a csound.cpp $< -o $@.cpp
	$(CXX) -O3 $(CXXFLAGS) $(LIB) -DOPCODE_NAME=$(notdir $(@:.dylib=)) $@.cpp -o $@
	

clean :
	rm -f $(DEST)