aboutsummaryrefslogtreecommitdiff
path: root/Makefile.sccompile
diff options
context:
space:
mode:
authorVee9ahd1 <>2021-05-11 15:29:40 -0400
committerVee9ahd1 <>2021-05-11 15:29:40 -0400
commit194676e190b827c6b12318213261d4e47ec7e6aa (patch)
tree37802291ed88fcc79f5e0946d7a283ca345afb12 /Makefile.sccompile
initial commit
Diffstat (limited to 'Makefile.sccompile')
-rw-r--r--Makefile.sccompile30
1 files changed, 30 insertions, 0 deletions
diff --git a/Makefile.sccompile b/Makefile.sccompile
new file mode 100644
index 0000000..9357afb
--- /dev/null
+++ b/Makefile.sccompile
@@ -0,0 +1,30 @@
+BUILD_DIR ?= ./build
+
+CXXFLAGS := $(CXXFLAGS)
+LFLAGS := -fPIC -shared $(LFLAGS)
+
+scbuilddir := $(BUILD_DIR)/Supercollider
+extdir := $(scbuilddir)/Extensions
+
+dspsrc := $(wildcard *.dsp)
+scfiles := $(addprefix $(extdir)/, $(dspsrc:.dsp=.sc))
+sofiles := $(addprefix $(extdir)/, $(dspsrc:.dsp=.so))
+
+archfile := /usr/share/faust/supercollider.cpp
+scincludes := -I/usr/include/SuperCollider/plugin_interface -I/usr/include/SuperCollider/common
+
+all: $(sofiles) $(scfiles)
+
+%.cpp: %.dsp
+ faust -a $(archfile) $< -o $@
+
+$(extdir)/%.so: %.cpp
+ mkdir -p $(extdir)
+ $(CXX) $(CXXFLAGS) $(scincludes) $(OPTFLAGS) $(LFLAGS) $< -o $@
+
+$(extdir)/%.sc: %.dsp.xml
+ mkdir -p $(extdir)
+ faust2sc --prefix="" $< --output=$@
+
+%.dsp.xml: %.dsp
+ faust --xml -o /dev/null $<