aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d002594
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+include config.mk
+
+CMODULE_PREFIX ?= cmodules
+LUAMODULE_PREFIX ?= luamodules
+CFLAGS := $(shell pkg-config --cflags melisma.h) -std=c11 -D_XOPEN_SOURCE=700 -D_GNU_SOURCE
+LDFLAGS := -shared -fPIC -lm
+CMODULES := $(CSOURCES:%.c=%.so)
+
+all: $(CMODULES)
+
+mod/sample.so: CFLAGS += $(shell pkg-config --cflags samplerate sndfile)
+mod/sample.so: LDFLAGS += $(shell pkg-config --libs samplerate sndfile)
+
+mod/%.so: mod/%.c
+ @ printf "CCLD\t%s\n" $(@)
+ @ $(CC) -o $(@) $(<) $(CFLAGS) $(LDFLAGS)
+
+install: all
+ install -Dm644 -t $(CMODULE_PREFIX)/melisma $(CMODULES)
+ install -Dm644 -t $(LUAMODULE_PREFIX)/melisma $(LUASOURCES)
+
+debug: CFLAGS += -Wno-cpp -O0 -g
+debug: all
+
+doc:
+ ldoc .
+
+clean:
+ rm -rf mod/*.so
+
+.PHONY: install clean doc