papermario/sources.mk
2020-10-23 01:28:24 +01:00

36 lines
1.4 KiB
Makefile

### ASSETS_FS and ASSETS_FS_SOURCES ###
# The asset filesystem path.
ASSETS_FS = assets/fs
# Source files to build the asset filesystem with. Each of these must be configured in `assets/fs.json'.
ASSETS_FS_SOURCES = $(wildcard $(ASSETS_FS)/*.bin)
### OBJECTS ###
C_FILES = $(shell find src -type f -name "*.c" -not -name "*.inc.c")
S_FILES = $(wildcard asm/*.s asm/os/*.s)
BIN_FILES = $(foreach dir, $(shell mkdir -p bin && find bin -type d -not -name Yay0), $(wildcard $(dir)/*.bin))
COMPRESSED_BIN_FILES = $(wildcard bin/Yay0/*.bin)
# The OBJECTS variable holds the filenames of all object files to be linked.
# Each of these objects should appear in `papermario.ld' (generated by n64splat).
#
# The extension of each object file specifies its source type (and, therefore, how it should be built):
#
# Object ext | Source ext | Description
# ------------+------------+-------------
# .o | | Special; must have build steps declared here
# .c.o | .c | C sourcecode
# .s.o | .s | Assembly (built with modern assembler)
# .bin.o | .bin | Uncompressed data
# .Yay0.o | .bin | Compressed data
#
# Note that ASSETS_FS is linked implicitly and does not need to be listed here.
OBJECTS = \
$(foreach file, $(C_FILES) $(S_FILES) $(BIN_FILES), $(BUILD_DIR)/$(file).o) \
$(foreach file, $(COMPRESSED_BIN_FILES), $(BUILD_DIR)/$(file:.bin=.Yay0.o))