TITLE := picow TITLEID := PICO00008 # Some magic flags: # - `-mcpu=cortext-a9`: specifically target the PS Vita CPU which may # help with some optimizations (instead of generic `armv7`). # - `-Wl,-q`: make the ELF file relocatable which is required for the # executable to run (otherwise it crashes on startup). # - `-Wl,--defsym=__sce_headroom=0x10000`: add some extra space for # the code segment, otherwise linking fails sporadically. # - `-lScePower_stub`: link in the power management library to allow us # to overclock the PS Vita for performance CFLAGS += -mcpu=cortex-a9 LDFLAGS += -Wl,-q -Wl,--defsym=__sce_headroom=0x10000 -lScePower_stub PATCH ?= patch OBJ := $(filter-out $(OUT)/system/pico8.o,$(OBJ)) \ $(OUT)/port/vita/system/pico8.o port: $(TARGET)/picow.vpk $(TARGET)/picow.vpk: $(TARGET)/eboot.bin $(TARGET)/param.sfo vita-pack-vpk -s $(TARGET)/param.sfo -b $(TARGET)/eboot.bin $@ $(TARGET)/eboot.bin: $(TARGET)/picow.velf vita-make-fself -s $(TARGET)/picow.velf $@ $(TARGET)/param.sfo: vita-mksfoex -s TITLE_ID=$(TITLEID) "PICO-w" $@ $(TARGET)/picow.velf: $(TARGET)/picow.elf vita-elf-create $(TARGET)/picow.elf $@ $(TARGET)/picow.elf: $(OBJ) $(OUT)/port/vita/src/vita.o @ echo "CC\t$@" @ $(CC) $^ -o $@ $(LDFLAGS) $(OUT)/port/vita/src/vita.o: port/vita/src/vita.c @ echo "CC\t$@" @ mkdir -p $(dir $@) @ $(CC) $(CFLAGS) -c $< -o $@ $(OUT)/port/vita/system/pico8.c: $(SYSTEM)/pico8.c port/vita/src/pico8.patch @ echo "PATCH\t$@" @ mkdir -p $(dir $@) @ $(PATCH) -s -o $@.tmp $(SYSTEM)/pico8.c < port/vita/src/pico8.patch @ mv $@.tmp $@ $(OUT)/port/vita/system/pico8.o: $(OUT)/port/vita/system/pico8.c \ $(SYSTEM)/pico8.h $(SYSTEM)/wasm-rt.h @ echo "CC\t$@" @ $(CC) $(CFLAGS) -O3 -Wno-unused -Wno-unused-parameter -c $< -o $@