summary refs log tree commit diff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorzlago2024-09-01 12:57:57 +0200
committerzlago2024-09-01 12:57:57 +0200
commit519e350739f55cfd3ef8b9a97e241b61ca9ed1f9 (patch)
treed3a1b251544ae5a3b85fe9f16c4a39fde1f46e78 /GNUmakefile
parenteb0194ee748ab3707ade5318e8d336bbbed81594 (diff)
libopenmpt
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 09bd738..6f110de 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -3,11 +3,11 @@
 GLAD ?= glad
 MKDIR ?= mkdir -p
 
-libs ::= SDL2
+libs ::= SDL2 openmpt
 cflags ::= -I . -g -Og ${CFLAGS}
 ldflags ::= -Wl,--rpath,'$$ORIGIN' $(addprefix -l,${libs}) ${LDFLAGS}
 
-srcs ::= $(wildcard src/*.c)
+srcs ::= $(wildcard src/modules/*.c)
 objs ::= $(addprefix out/,$(notdir ${srcs:.c=.o}))
 deps ::= $(addprefix out/,$(notdir ${srcs:.c=.d}))
 
@@ -24,13 +24,19 @@ clean:
 out/:
 	${MKDIR} $@
 
+out/%.o: src/modules/%.c out/%.d | out/
+	${CC} -c -o $@ $< ${cflags}
+
+out/%.d: src/modules/%.c | out/
+	${CC} ${cflags} ${CPPFLAGS} -MM -MG -MF $@ -MT "${@:.d=.o} $@" $<
+
 out/%.o: src/%.c out/%.d | out/
 	${CC} -c -o $@ $< ${cflags}
 
 out/%.d: src/%.c | out/
 	${CC} ${cflags} ${CPPFLAGS} -MM -MG -MF $@ -MT "${@:.d=.o} $@" $<
 
-out/mu-sdl: ${objs} | out/
+out/mu-%: out/%.o ${objs} | out/
 	${CC} -o $@ $^ ${cflags} ${ldflags}
 
 include ${deps}