Skip to content

Commit

Permalink
Merge pull request #11 from jpcima/master
Browse files Browse the repository at this point in the history
Update and bugfix for LV2 support
  • Loading branch information
sampov2 authored Jan 17, 2018
2 parents 4170077 + d49fa4a commit 9ac7b7a
Show file tree
Hide file tree
Showing 46 changed files with 17,894 additions and 13,416 deletions.
35 changes: 18 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ PREFIX=/usr/local
VERSION=
FAUST=faust

CXX11 = $(CXX) -std=c++11

OBJS_NODEPS=src/lv2.o src/foo-yc20.o src/configuration.o src/graphics.o src/yc20-precalc.o
OBJS_JACK=src/yc20-jack.o src/main-cli.o
OBJS_GTKJACK=src/main-gui.o src/foo-yc20-ui.o
Expand Down Expand Up @@ -34,10 +36,10 @@ $(OBJS_CAIRO): CFLAGS_use = $(CFLAGS_X) `pkg-config --cflags cairo`
$(OBJS_DSP_STANDALONE) $(OBJS_DSP_PLUGIN): CFLAGS_use = $(CFLAGS_X)

.cpp.o:
$(CXX) $< $(CFLAGS_use) -c -o $@
$(CXX11) $< $(CFLAGS_use) -c -o $@

.c.o:
$(CXX) $< $(CFLAGS_use) -c -o $@
$(CXX11) $< $(CFLAGS_use) -c -o $@

all: foo-yc20 foo-yc20-cli lv2

Expand All @@ -47,25 +49,25 @@ lv2: $(LV2_PLUGIN) $(LV2_UI)
OBJS_FOO_YC20=src/foo-yc20.o src/configuration.o src/yc20-jack.o src/main-gui.o src/foo-yc20-ui.o src/yc20-base-ui.o src/graphics.o src/yc20-precalc.o $(WIN32_RC)

foo-yc20: $(OBJS_FOO_YC20) $(OBJS_DSP_STANDALONE)
$(CXX) $(OBJS_FOO_YC20) $(OBJS_DSP_STANDALONE) `pkg-config --libs gtk+-2.0` `pkg-config --libs jack` $(LDFLAGS_YC20) -o foo-yc20
$(CXX11) $(OBJS_FOO_YC20) $(OBJS_DSP_STANDALONE) `pkg-config --libs gtk+-2.0` `pkg-config --libs jack` $(LDFLAGS_YC20) -o foo-yc20

## CLI version
OBJS_FOO_YC20_CLI=src/foo-yc20.o src/configuration.o src/main-cli.o src/yc20-jack.o src/yc20-precalc.o

foo-yc20-cli: $(OBJS_FOO_YC20_CLI) $(OBJS_DSP_STANDALONE)
$(CXX) $(OBJS_FOO_YC20_CLI) $(OBJS_DSP_STANDALONE) $(LDFLAGS_YC20_CLI) `pkg-config --libs jack` -o foo-yc20-cli
$(CXX11) $(OBJS_FOO_YC20_CLI) $(OBJS_DSP_STANDALONE) $(LDFLAGS_YC20_CLI) `pkg-config --libs jack` -o foo-yc20-cli

## LV2 version
OBJS_LV2=src/lv2.o src/foo-yc20.o src/yc20-precalc.o

$(LV2_PLUGIN): $(OBJS_LV2) $(OBJS_DSP_PLUGIN)
$(CXX) $(OBJS_LV2) $(OBJS_DSP_PLUGIN) -fPIC -shared -o $(LV2_PLUGIN) $(LDFLAGS_YC20_LV2)
$(CXX11) $(OBJS_LV2) $(OBJS_DSP_PLUGIN) -fPIC -shared -o $(LV2_PLUGIN) $(LDFLAGS_YC20_LV2)

## LV2 UI
OBJS_LV2_UI=src/lv2-ui.o src/foo-yc20-ui2.o src/yc20-base-ui.o src/graphics.o

$(LV2_UI): $(OBJS_LV2_UI)
$(CXX) $(OBJS_LV2_UI) -fPIC -shared `pkg-config --libs gtk+-2.0` -o $(LV2_UI) $(LDFLAGS_YC20_LV2)
$(CXX11) $(OBJS_LV2_UI) -fPIC -shared `pkg-config --libs gtk+-2.0` -o $(LV2_UI) $(LDFLAGS_YC20_LV2)

## VSTi - only compiles for windows with MinGW32.
## Note: Jack is used in compile flags to provide access to the ringbuffer.h. there
Expand All @@ -79,13 +81,13 @@ $(WIN32_RC): src/win32.rc
src/vsti.o src/vstplugmain.o: CFLAGS_use = $(CFLAGS_X) -I$(VSTSDK) -I$(VSTSDK)/public.sdk/source/vst2.x `pkg-config --cflags cairo jack`

src/vstplugmain.o: $(VSTSDK)/public.sdk/source/vst2.x/vstplugmain.cpp
$(CXX) $(CFLAGS_use) $(VSTSDK)/public.sdk/source/vst2.x/vstplugmain.cpp -c -o src/vstplugmain.o
$(CXX11) $(CFLAGS_use) $(VSTSDK)/public.sdk/source/vst2.x/vstplugmain.cpp -c -o src/vstplugmain.o

vsti-linux: $(OBJS_VSTI_LINUX) $(OBJS_DSP_PLUGIN) src/vsti.def
$(CXX) -Wall -s -shared $(CFLAGS) $(VSTFLAGS) $(OBJS_VSTI_LINUX) $(OBJS_DSP_PLUGIN) -o FooYC20.so `pkg-config --libs cairo`
$(CXX11) -Wall -s -shared $(CFLAGS) $(VSTFLAGS) $(OBJS_VSTI_LINUX) $(OBJS_DSP_PLUGIN) -o FooYC20.so `pkg-config --libs cairo`

vsti-windows: $(OBJS_VSTI) $(OBJS_DSP_PLUGIN) src/vsti.def
$(CXX) -Wall -s -shared -mwindows -static $(CFLAGS) src/vsti.def $(VSTFLAGS) $(OBJS_VSTI) $(OBJS_DSP_PLUGIN) -o FooYC20.dll `pkg-config --libs cairo`
$(CXX11) -Wall -s -shared -mwindows -static $(CFLAGS) src/vsti.def $(VSTFLAGS) $(OBJS_VSTI) $(OBJS_DSP_PLUGIN) -o FooYC20.dll `pkg-config --libs cairo`

$(BIN): $(OBJ)

Expand Down Expand Up @@ -122,7 +124,7 @@ src/osxresources.o: ../tools/osx/src/osxresources.mm
$(CC) $(CFLAGS) -o src/osxresources.o -c ../tools/osx/src/osxresources.mm

vstosx: $(OBJS_VSTI) $(OBJS_DSP_PLUGIN) src/osxringbuffer.o src/osxresources.o
$(CXX) $(CFLAGS) \
$(CXX11) $(CFLAGS) \
-I$(VSTSDK)/public.sdk -I$(VSTSDK)/vstgui.sf -I$(VSTSDK)/ \
`pkg-config --cflags cairo` \
-bundle -framework Carbon -framework CoreFoundation -framework AppKit \
Expand All @@ -140,7 +142,6 @@ cb:
rm -f foo-yc20 foo-yc20-cli $(LV2_PLUGIN) $(LV2_UI) FooYC20.dll
rm -f $(OBJS_FOO_YC20) $(OBJS_FOO_YC20_CLI) $(OBJS_LV2) $(OBJS_LV2_UI) $(OBJS_VSTI)
rm -f src/osxringbuffer.o src/osxresources.o vstosx



install: foo-yc20
Expand All @@ -167,17 +168,17 @@ uninstall:
## Targets only for those with Faust installed

generate-source:
$(FAUST) -a minimal.cpp faust/standalone.dsp > gen/yc20-dsp-standalone.cpp
$(FAUST) -a minimal.cpp faust/plugin.dsp > gen/yc20-dsp-plugin.cpp
$(FAUST) faust/standalone.dsp > gen/yc20-dsp-standalone.cpp
$(FAUST) faust/plugin.dsp > gen/yc20-dsp-plugin.cpp

generate-source-vec:
$(FAUST) -vec -a minimal.cpp faust/standalone.dsp > gen/yc20-dsp-standalone.cpp
$(FAUST) -vec -a minimal.cpp faust/plugin.dsp > gen/yc20-dsp-plugin.cpp
$(FAUST) -vec faust/standalone.dsp > gen/yc20-dsp-standalone.cpp
$(FAUST) -vec faust/plugin.dsp > gen/yc20-dsp-plugin.cpp


basic-test:
$(FAUST) -a jack-console.cpp faust/yc20.dsp > gen/basic.cpp
$(CXX) $(CFLAGS) -Isrc/ gen/basic.cpp -o basic `pkg-config --cflags --libs jack`
$(CXX11) $(CFLAGS) -Isrc/ gen/basic.cpp -o basic `pkg-config --cflags --libs jack`

## test compilation
# For semi-automated testing, this line is handy:
Expand All @@ -186,7 +187,7 @@ basic-test:
testit: faust/test.dsp faust/oscillator.dsp src/polyblep.cpp Makefile
rm -rf faust/test-svg/
$(FAUST) -svg -a sndfile.cpp faust/test.dsp > gen/test.cpp
$(CXX) $(CFLAGS) -Isrc/ gen/test.cpp `pkg-config --cflags --libs sndfile` -o testit
$(CXX11) $(CFLAGS) -Isrc/ gen/test.cpp `pkg-config --cflags --libs sndfile` -o testit

$(OBJS_NODEPS) $(OBJS_JACK) $(OBJS_GTKJACK) $(OBJS_LV2) $(OBJS_CAIRO): include/*.h
src/graphics.o: include/graphics-png.h
Expand Down
Loading

0 comments on commit 9ac7b7a

Please sign in to comment.