summary refs log tree commit diff
path: root/GNUmakefile
diff options
context:
space:
mode:
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}