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
|
|
|
|
|
|
|
|
N64_CFLAGS += -iquote $(SOURCE_DIR)
|
2023-07-09 00:01:41 +02:00
|
|
|
N64_LDFLAGS += --wrap asset_load
|
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 \
|
|
|
|
boot/ipl2.S \
|
|
|
|
flashcart/flashcart.c \
|
|
|
|
flashcart/sc64/sc64_internal.c \
|
|
|
|
flashcart/sc64/sc64.c \
|
2023-02-22 19:28:09 +01:00
|
|
|
libs/toml/toml.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
menu/actions.c \
|
2023-07-09 00:01:41 +02:00
|
|
|
menu/assets.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
menu/menu.c \
|
2023-07-09 00:01:41 +02:00
|
|
|
menu/mp3player.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
menu/path.c \
|
|
|
|
menu/rom_database.c \
|
|
|
|
menu/settings.c \
|
|
|
|
menu/views/browser.c \
|
|
|
|
menu/views/credits.c \
|
|
|
|
menu/views/error.c \
|
|
|
|
menu/views/file_info.c \
|
2023-07-09 00:01:41 +02:00
|
|
|
menu/views/fragments/fragments.c \
|
|
|
|
menu/views/fragments/widgets.c \
|
2023-07-02 21:52:58 +02:00
|
|
|
menu/views/load.c \
|
2023-07-09 00:01:41 +02:00
|
|
|
menu/views/player.c \
|
|
|
|
menu/views/startup.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
|
|
|
|
|
|
|
|
$(BUILD_DIR)/FiraMono-Bold.o: MKFONT_FLAGS+=--size 16 -r 20-7F -r 2000-206F -r 2190-21FF
|
|
|
|
|
|
|
|
$(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
|
|
|
|
|
|
|
|
OBJS = $(addprefix $(BUILD_DIR)/, $(addsuffix .o,$(basename $(SRCS) $(ASSETS))))
|
2023-02-14 22:26:40 +01:00
|
|
|
|
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-02-27 02:21:21 +01:00
|
|
|
# run:
|
2023-06-04 17:57:31 +02:00
|
|
|
# $(shell ./remotedeploy.sh -d)
|
|
|
|
# FIXME: improve ability to deploy.
|
|
|
|
# if devcontainer, use remotedeploy.sh, else
|
|
|
|
# $(shell sc64deployer --boot direct-rom %~dp0$(OUTPUT_DIR))\$(PROJECT_NAME).z64)
|
|
|
|
# .PHONY: run
|
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)
|