···5858# End of https://www.toptal.com/developers/gitignore/api/c
59596060obj/
6161-bin/6161+bin/
6262+src/generated/
-89
gb/Makefile
···11-22-.SUFFIXES: # Suppress a lot of useless default rules, which also provides a nice speedup.
33-44-# Recursive `wildcard` function.
55-rwildcard = $(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
66-77-# Program constants.
88-# POSIX OSes (the sane default).
99-RM_RF := rm -rf
1010-MKDIR_P := mkdir -p
1111-ifeq ($(strip $(shell which rm)),)
1212- # Windows *really* tries its hardest to be Special™!
1313- RM_RF := -rmdir /s /q
1414- MKDIR_P := -mkdir
1515-endif
1616-1717-RGBDS ?= # Shortcut if you want to use a local copy of RGBDS.
1818-RGBASM := ${RGBDS}rgbasm
1919-RGBLINK := ${RGBDS}rgblink
2020-RGBFIX := ${RGBDS}rgbfix
2121-RGBGFX := ${RGBDS}rgbgfx
2222-2323-ROM = bin/${ROMNAME}.${ROMEXT}
2424-2525-# Argument constants
2626-INCDIRS = src/ include/
2727-WARNINGS = all extra
2828-ASFLAGS = -p ${PADVALUE} $(addprefix -I,${INCDIRS}) $(addprefix -W,${WARNINGS})
2929-LDFLAGS = -p ${PADVALUE}
3030-FIXFLAGS = -p ${PADVALUE} -i "${GAMEID}" -k "${LICENSEE}" -l ${OLDLIC} -m ${MBC} -n ${VERSION} -r ${SRAMSIZE} -t ${TITLE}
3131-3232-# The list of ASM files that RGBASM will be invoked on.
3333-SRCS = $(call rwildcard,src,*.asm)
3434-3535-## Project-specific configuration
3636-# Use this to override the above
3737-include project.mk
3838-3939-# `all` (Default target): build the ROM
4040-all: ${ROM}
4141-.PHONY: all
4242-4343-# `clean`: Clean temp and bin files
4444-clean:
4545- ${RM_RF} bin obj assets
4646-.PHONY: clean
4747-4848-# `rebuild`: Build everything from scratch
4949-# It's important to do these two in order if we're using more than one job
5050-rebuild:
5151- ${MAKE} clean
5252- ${MAKE} all
5353-.PHONY: rebuild
5454-5555-# By default, asset recipes convert files in `assets/` into other files in `assets/`.
5656-# This line causes assets not found in `assets/` to be also looked for in `src/assets/`.
5757-# "Source" assets can thus be safely stored there without `make clean` removing them!
5858-VPATH := src
5959-6060-# Define how to compress files using the PackBits16 codec.
6161-# (The compressor script requires Python 3.)
6262-assets/%.pb16: src/tools/pb16.py assets/%
6363- @${MKDIR_P} "${@D}"
6464- $^ $@
6565-6666-# How to build a ROM.
6767-# Notice that the build date is always refreshed.
6868-bin/%.${ROMEXT}: $(patsubst src/%.asm,obj/%.o,${SRCS})
6969- @${MKDIR_P} "${@D}"
7070- ${RGBASM} ${ASFLAGS} -o obj/build_date.o src/assets/build_date.asm
7171- ${RGBLINK} ${LDFLAGS} -m bin/$*.map -n bin/$*.sym -o $@ $^ \
7272- && ${RGBFIX} -v ${FIXFLAGS} $@
7373-7474-# `.mk` files are auto-generated dependency lists of the source ASM files, to save a lot of hassle.
7575-# Also add all obj dependencies to the dep file too, so Make knows to remake it.
7676-# Caution: some of these flags were added in RGBDS 0.4.0, using an earlier version WILL NOT WORK
7777-# (and produce weird errors).
7878-obj/%.mk: src/%.asm
7979- @${MKDIR_P} "${@D}"
8080- ${RGBASM} ${ASFLAGS} -M $@ -MG -MP -MQ ${@:.mk=.o} -MQ $@ -o ${@:.mk=.o} $<
8181-# DO NOT merge this with the rule above, otherwise Make will assume that the `.o` file is generated,
8282-# even when it isn't!
8383-# This causes weird issues that depend, among other things, on the version of Make.
8484-obj/%.o: obj/%.mk
8585- @touch $@
8686-8787-ifeq ($(filter clean,${MAKECMDGOALS}),)
8888-include $(patsubst src/%.asm,obj/%.mk,${SRCS})
8989-endif
-6
gb/src/assets/build_date.asm
···11-SECTION "Build date", ROM0
22-33- db "Built "
44-BuildDate::
55- db __ISO_8601_UTC__
66- db 0