libsndfile compiling.
[Faustine.git] / interpretor / preprocessor / faust-0.9.47mr3 / examples / faust-stk / Makefile.w32vstcompile
1 ################################################################################
2 #
3 # CROSSCOMPILATION FROM LINUX OF VST PLUGINS FOR WINDOWS
4 # Faust Project, Y. Orlarey - Grame
5 #
6 ################################################################################
7
8 #------------------------------------------------------------------------------
9 # 1/ VST SDK Should be installed somewhere
10 VST=../vstsdk2.4
11
12 #------------------------------------------------------------------------------
13 # 2/ mingw crosscompiler should be installed ('mingw32' package on Ubuntu)
14 #CROSS=i386-mingw32-
15 CROSS=i586-mingw32msvc-
16 CXX=$(CROSS)g++
17 CXXFLAGS=-I$(VST) -I$(VST)/public.sdk/source/vst2.x -DBUILDING_DLL -mno-cygwin
18 LDFLAGS=
19 DLLWRAP=$(CROSS)dllwrap --target=i386-mingw32 -mno-cygwin
20 STRIP=$(CROSS)strip
21
22
23 #------------------------------------------------------------------------------
24 # 3/ we transform all .dsp Faust codes into the corresponding dll
25 DSP= $(wildcard *.dsp)
26 DLL= $(addprefix $(DEST), $(DSP:.dsp=.dll))
27
28 ##PLUGIN= $(SRC:.dsp=)
29 ##DLL=$(PLUGIN).dll
30 #
31
32 all : $(DLL)
33
34 # how to generate the cpp file from the faust source
35 $(DEST)%.cpp : %.dsp
36 faust -a vst2p4.cpp $< -o $@
37
38 # we need to create the .def file needed to generate the .dll
39 $(DEST)%.def :
40 @echo LIBRARY $(@:.def=) > $@
41 @echo DESCRIPTION \'Faust generated VST plugin\' >> $@
42 @echo EXPORTS main=VSTPluginMain >> $@
43
44
45 $(DEST)%.dll: $(DEST)%.o $(DEST)%.def $(DEST)audioeffect.o $(DEST)audioeffectx.o $(DEST)vstplugmain.o
46 $(DLLWRAP) --driver-name $(CXX) --def $(@:.dll=.def) $^ -o $@
47 $(STRIP) $@
48
49 $(DEST)audioeffect.o: $(VST)/public.sdk/source/vst2.x/audioeffect.cpp
50 $(CXX) $(CXXFLAGS) -c $< -o $@
51
52 $(DEST)audioeffectx.o: $(VST)/public.sdk/source/vst2.x/audioeffectx.cpp
53 $(CXX) $(CXXFLAGS) -c $< -o $@
54
55 $(DEST)vstplugmain.o: $(VST)/public.sdk/source/vst2.x/vstplugmain.cpp
56 $(CXX) $(CXXFLAGS) -c $< -o $@
57
58