aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index fa4909a..c4d8afa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,17 @@
--include config.mk
+-include port/$(PORT)/config.mk
CC ?= cc
-AR ?= ar
HOSTCC ?= cc
PICO8 ?= pico8
WASM2C ?= wasm2c
TAR ?= tar
ARCH ?= $(shell uname -m)
+PKGCONFIG ?= pkg-config
CFLAGS ?= -std=c99 -Wall -Wextra -O2 -MMD -Isrc -Ilib -I$(SYSTEM) \
- $(shell pkg-config sdl3 --cflags)
+ $(shell $(PKGCONFIG) sdl3 --cflags)
HOSTCFLAGS ?= -std=c99 -Wall -Wextra -O2
-LDFLAGS ?= $(shell pkg-config sdl3 --libs) -lm
+LDFLAGS ?= $(shell $(PKGCONFIG) sdl3 --libs) -lm
W2CFLAGS ?= --disable-tail-call
TARGET := build/$(ARCH)
@@ -23,12 +23,14 @@ SRC := $(wildcard src/*.c) $(SYSTEM)/pico8.c $(SYSTEM)/sysroot.c
OBJ := $(patsubst %.c,$(OUT)/%.o,$(SRC:build/%=%))
SYS := $(addprefix $(SYSTEM)/,pico8.c pico8.h sysroot.c sysroot.h wasm-rt.h)
+-include port/$(PORT)/rules.mk
+
.PHONY: all
all: $(TARGET)/picow ;
$(TARGET)/picow: $(OBJ)
@ echo "CC\t$@"
- @ $(CC) $(OBJ) -o $@ $(LDFLAGS)
+ @ $(CC) $^ -o $@ $(LDFLAGS)
$(OUT)/src/%.o: src/%.c $(SYSTEM)/pico8.h $(SYSTEM)/sysroot.h
@ echo "CC\t$@"