summary refs log tree commit diff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorzlago2024-10-09 20:21:58 +0200
committerzlago2024-10-09 20:21:58 +0200
commit2c4b835fe1c6ad10ff16aa96140ff17a69282a43 (patch)
treeda458969502a74dad3d102fbd0fac087a18faab6 /GNUmakefile
parenteb5b0d4d8d40dc4f564ad2fd6f69eaf2e108322a (diff)
emscripten support
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 8b08ac0..f1720b7 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,9 +1,10 @@
 #!/usr/bin/env -S gmake -f
 
-export MKDIR ?= mkdir -p
+MKDIR ?= mkdir -p
 
 libs := SDL2 m z
 
+EXTENSION ?= out
 CFLAGS ?= -Wall -Wpedantic -g -Og
 cflags := ${CFLAGS}
 ldflags := $(addprefix -l,${libs}) ${LDFLAGS}
@@ -14,9 +15,9 @@ deps := $(addprefix out/${NS}/,$(notdir $(patsubst %.c,%.d,$(wildcard src/*.c)))
 
 .PHONY: all run clean
 
-all: out/${NS}/a.out out/assets.res
+all: out/${NS}/a.${EXTENSION} out/assets.res
 
-run: out/${NS}/a.out out/assets.res
+run: out/${NS}/a.${EXTENSION} out/assets.res
 	./$^
 
 clean:
@@ -33,13 +34,13 @@ out/${NS}/libplum.o: cflags += -w
 out/${NS}/%.o: src/%.c out/${NS}/%.d | out/${NS}/
 	${CC} -c -o $@ $< ${cflags}
 
-out/${NS}/incbin.o: src/incbin.s | out/${NS}/
+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}/incbin.o | out/${NS}/
+out/${NS}/a.${EXTENSION}: ${objs} out/${NS}/incbin.o | out/${NS}/
 	${CC} -o $@ $^ ${cflags} ${ldflags}
 
 include assets.mk