summary refs log tree commit diff
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile18
1 files changed, 8 insertions, 10 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 39fcc6d..c2238d8 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -5,14 +5,14 @@ export MKDIR ?= mkdir -p
 libs := SDL2 z
 
 CFLAGS ?= -Wall -Wpedantic -g -Og
-cflags := -I lib/ -I . ${CFLAGS}
+cflags := ${CFLAGS}
 ldflags := $(addprefix -l,${libs}) ${LDFLAGS}
 
 srcs := $(wildcard src/*.c)
 objs := $(addprefix out/${NS}/,$(notdir ${srcs:.c=.o}))
 deps := $(addprefix out/${NS}/,$(notdir $(patsubst %.c,%.d,$(wildcard src/*.c))))
 
-.PHONY: all run clean lib
+.PHONY: all run clean
 
 all: out/${NS}/a.out
 
@@ -21,10 +21,6 @@ run: out/${NS}/a.out
 
 clean:
 	${RM} -r out/${NS}/
-#	${MAKE} -C lib clean
-
-#lib:
-#	${MAKE} -C $@
 
 out/${NS}/:
 	${MKDIR} $@
@@ -35,13 +31,15 @@ out/:
 out/${NS}/%.o: src/%.c out/${NS}/%.d | out/${NS}/
 	${CC} -c -o $@ $< ${cflags}
 
+out/${NS}/incbin.o: src/incbin.s | out/${NS}/
+	${CC} -c -o $@ $< -Wa,-I,src/ ${cflags}
+
 out/${NS}/%.d: src/%.c | out/${NS}/
 	${CC} ${cflags} ${CPPFLAGS} -MM -MG -MF $@ -MT "${@:.d=.o} $@" $<
 
-out/${NS}/a.out: ${objs} | out/${NS}/ #lib
-	${CC} -o $@ $^ $(wildcard lib/out/*.o) ${cflags} ${ldflags}
+out/${NS}/a.out: ${objs} out/${NS}/incbin.o | out/${NS}/
+	${CC} -o $@ $^ ${cflags} ${ldflags}
 
-out/%: utl/%.c | out/${NS}/
-	${CC} -g -Og -o $@ $^ # i have no idea how im supposed to handle CFLAGS
+include $(wildcard utl/*.mk)
 
 include ${deps}