Skip to content

Instantly share code, notes, and snippets.

@evilactually
Last active June 1, 2020 03:37
Show Gist options
  • Save evilactually/d602b56202a07f910b5ec8c3290dcfc8 to your computer and use it in GitHub Desktop.
Save evilactually/d602b56202a07f910b5ec8c3290dcfc8 to your computer and use it in GitHub Desktop.
cat <<'EOF' > ./Makefile
CXX ?= g++
CLSNAME = am_modulator
URI_PREFIX = https://evilactually.github.com
build:manifest.ttl $(CLSNAME).ttl $(CLSNAME).so
$(CLSNAME).cpp:$(CLSNAME).dsp
faust -i -a /usr/share/faust/lv2.cpp -cn $(CLSNAME) $< -o $@
$(CLSNAME).so:$(CLSNAME).cpp
$(CXX) -shared -O3 -std=c++11 -ffast-math -ftree-vectorize '-DDLLEXT=".so"' -fPIC '-DPLUGIN_URI="$(URI_PREFIX)/$(CLSNAME)"' -DFAUST_META=1 -DFAUST_MIDICC=1 -DFAUST_MTS=1 -DFAUST_UI=0 -DVOICE_CTRLS=1 $< -o $@
manifest.ttl:manifest.ttl.in
sed -e"s?@name@?$(CLSNAME)?g" -e"s?@uri@?$(URI_PREFIX)/$(CLSNAME)?g" -e"s?@dllext@?.so?g" > "manifest.ttl" < manifest.ttl.in
$(CLSNAME).ttl:$(CLSNAME).cpp
g++ -O3 -std=c++11 -ffast-math -ftree-vectorize '-DDLLEXT=".so"' '-DPLUGIN_URI="$(URI_PREFIX)/$(CLSNAME)"' -DFAUST_META=1 -DFAUST_MIDICC=1 -DFAUST_MTS=1 -DFAUST_UI=0 -DVOICE_CTRLS=1 $< -o $(CLSNAME)
./$(CLSNAME) > $(CLSNAME).ttl
clean:
rm *.cpp -f
rm *.so -f
rm *.ttl -f
install: build
install -d $(DESTDIR)$(PREFIX)/usr/local/lib/lv2/$(CLSNAME).lv2
install -m 644 *.so *.ttl $(DESTDIR)$(PREFIX)/usr/local/lib/lv2/$(CLSNAME).lv2/
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment