2023-03-13 01:46:13 +01:00
|
|
|
PROJECT_NAME = N64FlashcartMenu
|
|
|
|
|
|
|
|
.DEFAULT_GOAL := $(PROJECT_NAME)
|
2023-02-14 22:26:40 +01:00
|
|
|
|
|
|
|
SOURCE_DIR = src
|
2023-07-09 00:01:41 +02:00
|
|
|
ASSETS_DIR = assets
|
2023-02-14 22:26:40 +01:00
|
|
|
BUILD_DIR = build
|
2023-03-12 20:43:16 +01:00
|
|
|
OUTPUT_DIR = output
|
2023-02-14 22:26:40 +01:00
|
|
|
|
|
|
|
include $(N64_INST)/include/n64.mk
|
|
|
|
|
2023-07-25 19:20:29 +02:00
|
|
|
N64_CFLAGS += -iquote $(SOURCE_DIR) -I $(SOURCE_DIR)/libs $(FLAGS)
|
2023-02-14 22:26:40 +01:00
|
|
|
|
|
|
|
SRCS = \
|
2023-07-02 21:52:58 +02:00
|
|
|
main.c \
|
2023-02-14 22:26:40 +01:00
|
|
|
boot/boot.c \
|
|
|
|
boot/crc32.c \
|
2023-08-03 17:18:55 +02:00
|
|
|
boot/reboot.S \
|
2023-07-26 12:36:39 +02:00
|
|
|
flashcart/flashcart_utils.c \
|
2023-02-14 22:26:40 +01:00
|
|
|
flashcart/flashcart.c \
|
|
|
|
flashcart/sc64/sc64_internal.c \
|
|
|
|
flashcart/sc64/sc64.c \
|
2023-07-25 19:20:29 +02:00
|
|
|
libs/libspng/spng/spng.c \
|
2023-07-11 18:00:18 +02:00
|
|
|
libs/mini.c/src/mini.c \
|
2023-07-25 19:20:29 +02:00
|
|
|
libs/miniz/miniz_tdef.c \
|
|
|
|
libs/miniz/miniz_tinfl.c \
|
|
|
|
libs/miniz/miniz_zip.c \
|
|
|
|
libs/miniz/miniz.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
menu/actions.c \
|
2023-07-28 21:36:51 +02:00
|
|
|
menu/components/background.c \
|
2023-08-03 17:18:55 +02:00
|
|
|
menu/components/boxart.c \
|
|
|
|
menu/components/common.c \
|
|
|
|
menu/components/file_list.c \
|
|
|
|
menu/fonts.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
menu/menu.c \
|
2023-07-25 19:20:29 +02:00
|
|
|
menu/mp3_player.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
menu/path.c \
|
2023-07-25 19:20:29 +02:00
|
|
|
menu/png_decoder.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
menu/rom_database.c \
|
|
|
|
menu/settings.c \
|
|
|
|
menu/views/browser.c \
|
|
|
|
menu/views/credits.c \
|
|
|
|
menu/views/error.c \
|
2023-07-11 02:22:58 +02:00
|
|
|
menu/views/fault.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
menu/views/file_info.c \
|
2023-07-25 22:56:00 +02:00
|
|
|
menu/views/image_viewer.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
menu/views/load.c \
|
2023-07-22 12:30:39 +02:00
|
|
|
menu/views/music_player.c \
|
2023-07-09 00:01:41 +02:00
|
|
|
menu/views/startup.c \
|
2023-07-09 00:52:39 +02:00
|
|
|
menu/views/system_info.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
utils/fs.c
|
2023-02-14 22:26:40 +01:00
|
|
|
|
2023-07-09 00:01:41 +02:00
|
|
|
ASSETS = \
|
|
|
|
FiraMono-Bold.ttf
|
|
|
|
|
2023-07-25 19:20:29 +02:00
|
|
|
OBJS = $(addprefix $(BUILD_DIR)/, $(addsuffix .o,$(basename $(SRCS) $(ASSETS))))
|
|
|
|
MINIZ_OBJS = $(filter $(BUILD_DIR)/libs/miniz/%.o,$(OBJS))
|
|
|
|
SPNG_OBJS = $(filter $(BUILD_DIR)/libs/libspng/%.o,$(OBJS))
|
|
|
|
|
|
|
|
$(MINIZ_OBJS): N64_CFLAGS+=-DMINIZ_NO_TIME -fcompare-debug-second
|
|
|
|
$(SPNG_OBJS): N64_CFLAGS+=-isystem $(SOURCE_DIR)/libs/miniz -DSPNG_USE_MINIZ -fcompare-debug-second
|
2023-08-03 17:18:55 +02:00
|
|
|
$(BUILD_DIR)/FiraMono-Bold.o: MKFONT_FLAGS+=-c 0 --size 16 -r 20-7F -r 2026-2026 --ellipsis 2026,1
|
2023-07-09 00:01:41 +02:00
|
|
|
|
|
|
|
$(BUILD_DIR)/%.o: $(ASSETS_DIR)/%.ttf
|
|
|
|
@echo " [FONT] $@"
|
|
|
|
@$(N64_MKFONT) $(MKFONT_FLAGS) -o $(ASSETS_DIR) "$<"
|
|
|
|
@$(N64_OBJCOPY) -I binary -O elf32-bigmips -B mips4300 $(basename $<).font64 $@
|
|
|
|
@rm $(basename $<).font64
|
|
|
|
|
2023-03-13 01:46:13 +01:00
|
|
|
$(BUILD_DIR)/$(PROJECT_NAME).elf: $(OBJS)
|
2023-02-14 22:26:40 +01:00
|
|
|
|
2023-03-13 01:46:13 +01:00
|
|
|
$(PROJECT_NAME).z64: N64_ROM_TITLE=$(PROJECT_NAME)
|
2023-02-14 22:26:40 +01:00
|
|
|
|
2023-03-13 01:46:13 +01:00
|
|
|
$(PROJECT_NAME): $(PROJECT_NAME).z64
|
2023-03-13 00:19:28 +01:00
|
|
|
$(shell mkdir -p $(OUTPUT_DIR))
|
2023-07-09 00:01:41 +02:00
|
|
|
$(shell mv $(PROJECT_NAME).z64 $(OUTPUT_DIR))
|
2023-03-13 00:19:28 +01:00
|
|
|
|
2023-03-13 01:46:13 +01:00
|
|
|
sc64_minify: $(PROJECT_NAME)
|
|
|
|
$(shell python3 ./tools/sc64/minify.py $(BUILD_DIR)/$(PROJECT_NAME).elf $(OUTPUT_DIR)/$(PROJECT_NAME).z64 $(OUTPUT_DIR)/sc64menu.n64)
|
2023-03-13 00:19:28 +01:00
|
|
|
|
2023-03-13 01:46:13 +01:00
|
|
|
all: sc64_minify
|
2023-02-14 22:26:40 +01:00
|
|
|
.PHONY: all
|
|
|
|
|
|
|
|
clean:
|
2023-06-04 17:57:31 +02:00
|
|
|
$(shell rm -rf ./$(BUILD_DIR) ./$(OUTPUT_DIR))
|
2023-02-14 22:26:40 +01:00
|
|
|
.PHONY: clean
|
|
|
|
|
2023-07-09 00:52:39 +02:00
|
|
|
run: $(PROJECT_NAME)
|
|
|
|
./remotedeploy.sh
|
2023-06-04 17:57:31 +02:00
|
|
|
# FIXME: improve ability to deploy.
|
|
|
|
# if devcontainer, use remotedeploy.sh, else
|
|
|
|
# $(shell sc64deployer --boot direct-rom %~dp0$(OUTPUT_DIR))\$(PROJECT_NAME).z64)
|
2023-07-09 00:52:39 +02:00
|
|
|
.PHONY: run
|
|
|
|
|
|
|
|
run-debug: $(PROJECT_NAME)
|
|
|
|
./remotedeploy.sh -d
|
|
|
|
.PHONY: run-debug
|
2023-02-27 02:21:21 +01:00
|
|
|
|
|
|
|
# test:
|
2023-06-04 17:57:31 +02:00
|
|
|
# TODO: run tests
|
2023-02-27 02:21:21 +01:00
|
|
|
|
2023-02-14 22:26:40 +01:00
|
|
|
-include $(wildcard $(BUILD_DIR)/*.d)
|