aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2026-09-12 21:32:08 +0200
committerNicholas Rodrigues Lordello <[email protected]>2026-09-12 21:32:08 +0200
commitcfa3a680b679b3fbcd5967e0175207aef71f80c9 (patch)
tree0e619d6c3119e4b74a895c415a87bb92e377dc6e /Makefile
parentb6aa39f80b399bae395a4e638d2e96b4931dce5a (diff)
Stricter Building
We build with C99 and enable more warnings. I want to refactor the build system a bit, as it is not conventional at the moment, and I think a top-level single Makefile will actually be nicer. I also want to build intermediate `.a` archives for the `libs/` to clearly seperate them as a "vendored dependency".
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 774ac89..0895b60 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,7 @@
+CC = gcc
+CFLAGS = -std=c99 -Wextra -O2 -Ilib/ $(shell pkg-config SDL3 --cflags)
+LDFLAGS = $(shell pkg-config SDL3 --libs)
+
SRC = src/picow.c src/sysroot.c
OBJ = $(patsubst %.c,%.o,$(SRC))
@@ -11,7 +15,7 @@ include makefiles/tools.mk
include makefiles/wamr.mk
picow: $(OBJ) $(STBI_OBJ) $(WAMR_OBJ)
- $(CC) -o $@ $^ $$(pkg-config SDL3 --libs)
+ $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
.PHONY: lint
lint:
@@ -23,4 +27,4 @@ clean: clean-carts clean-stbi clean-system clean-tools clean-wamr
rm -f picow $(OBJ)
src/%.o: src/%.c
- $(CC) -c -o $@ $< -Ilib/ $$(pkg-config SDL3 --cflags)
+ $(CC) $(CFLAGS) -c $< -o $@