aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLudvig Gunne Lindström <ludviggunnelindstrom@gmail.com>2026-07-17 11:43:24 +0200
committerLudvig Gunne Lindström <ludviggunnelindstrom@gmail.com>2026-11-08 14:15:04 +0100
commit039847a29868d335c08fe0a587260dffc71ca5c4 (patch)
treee9d775090fef45ca51db576779fb373040d50e6a /Makefile
downloadmelisma-modules-main.tar.gz
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