aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index ed56369..6ed6297 100644
--- a/Makefile
+++ b/Makefile
@@ -6,11 +6,12 @@ HOSTCC ?= cc
PICO8 ?= pico8
WASM2C ?= wasm2c
-ARCH ?= $(shell uname -m)
-CFLAGS ?= -std=c99 -Wall -Wextra -O2 -MMD -Isrc -Ilib -I$(SYSTEM) \
+ARCH ?= $(shell uname -m)
+CFLAGS ?= -std=c99 -Wall -Wextra -O2 -MMD -Isrc -Ilib -I$(SYSTEM) \
$(shell pkg-config sdl3 --cflags)
-LDFLAGS ?= $(shell pkg-config sdl3 --libs) -lm
-W2CFLAGS ?= --disable-tail-call
+HOSTCFLAGS ?= -std=c99 -Wall -Wextra -O2 -MMD
+LDFLAGS ?= $(shell pkg-config sdl3 --libs) -lm
+W2CFLAGS ?= --disable-tail-call
TARGET := build/$(ARCH)
OUT := $(TARGET)/out
@@ -70,7 +71,7 @@ $(SYSTEM)/%.png: carts/%.p8
$(TOOLS)/%: tools/%.c
@ echo "CC\t$@"
@ mkdir -p $(dir $@)
- @ $(HOSTCC) $(CFLAGS) $< -o $@
+ @ $(HOSTCC) $(HOSTCFLAGS) $< -o $@
.PHONY: build/compile_commands.json
build/compile_commands.json: $(TOOLS)/ccj