aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2026-10-29 19:24:31 +0100
committerNicholas Rodrigues Lordello <[email protected]>2026-10-29 19:24:31 +0100
commit4bfe4900b80c17702d9e2c02b1740c790537d5bd (patch)
tree97c8acc9dd04fce8a8241c3488baff8a96fa88cf /Makefile
parent93a202d1fa6cd05b494bbf7175d79c6da075f333 (diff)
Add PS Vita Port
Compile PICO-w for the PS Vita :tada:. Fixes some minor compiler warnings that only showed up because of the different compilation target, and makes the Makefile port system a little more opinionated.
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$@"