diff options
author | red031000 <rubenru09@aol.com> | 2020-07-21 17:23:09 +0100 |
---|---|---|
committer | huderlem <huderlem@gmail.com> | 2020-07-21 19:37:41 -0500 |
commit | 3a4437a42d67ea0ea606e5f0a751b61a32881d8e (patch) | |
tree | a4c91b965391b88a15ad5e4388ec46de1bb4c18f | |
parent | 9b8813a72e9d9a6ed23eb1c389ed9a3e39a49a6e (diff) |
replace build_tools.sh with make tools
-rwxr-xr-x | .gitattributes | 1 | ||||
-rwxr-xr-x | INSTALL.md | 2 | ||||
-rwxr-xr-x | Makefile | 31 | ||||
-rwxr-xr-x | build_tools.sh | 6 |
4 files changed, 31 insertions, 9 deletions
diff --git a/.gitattributes b/.gitattributes index f1ad9c5..5607075 100755 --- a/.gitattributes +++ b/.gitattributes @@ -8,6 +8,7 @@ Makefile text eol=lf *.pl text eol=lf *.inc text eol=lf *.sha1 text eol=lf +*.sed text eol=lf *.png binary *.bin binary @@ -32,7 +32,7 @@ To set up the repository: ./install.sh ../pokepinballrs cd ../pokepinballrs - ./build_tools.sh + make tools Place a copy of the original ROM in the `pokepinballrs` directory, and name it `baserom.gba`. This is necessary because this is an incomplete disassembly. @@ -13,6 +13,12 @@ GAME_CODE := BPPE MAKER_CODE := 01 REVISION := 0 +HOSTCC = $(CC) +HOSTCXX = $(CXX) +HOSTCFLAGS = $(CFLAGS) +HOSTCXXFLAGS = $(CXXFLAGS) +HOST_VARS := CC=$(HOSTCC) CXX=$(HOSTCXX) CFLAGS='$(HOSTCFLAGS)' CXXFLAGS='$(HOSTCXXFLAGS)' + SHELL := /bin/bash -o pipefail ROM := pokepinballrs.gba @@ -47,6 +53,19 @@ PREPROC := tools/preproc/preproc$(EXE) RAMSCRGEN := tools/ramscrgen/ramscrgen$(EXE) FIX := tools/gbafix/gbafix$(EXE) +TOOLS_DIR = tools +TOOLDIRS = $(filter-out $(TOOLS_DIR)/agbcc,$(wildcard $(TOOLS_DIR)/*)) + +infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) + +# Build tools when building the rom +# Disable dependency scanning for clean/tidy/tools +ifeq (,$(filter-out all compare,$(MAKECMDGOALS))) +$(call infoshell, $(HOST_VARS) $(MAKE) tools) +else +NODEP := 1 +endif + # Clear the default suffixes .SUFFIXES: # Don't delete intermediate files @@ -57,7 +76,7 @@ FIX := tools/gbafix/gbafix$(EXE) # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PHONY: rom clean compare tidy +.PHONY: rom clean compare tidy tools clean-tools $(TOOLDIRS) $(shell mkdir -p $(C_BUILDDIR) $(ASM_BUILDDIR) $(DATA_ASM_BUILDDIR)) @@ -79,13 +98,21 @@ rom: $(ROM) compare: $(ROM) @$(SHA1) pokepinballrs.sha1 -clean: tidy +clean: tidy clean-tools find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + tidy: rm -f $(ROM) $(ELF) $(MAP) rm -r build/* +tools: $(TOOLDIRS) + +$(TOOLDIRS): + @$(HOST_VARS) $(MAKE) -C $@ + +clean-tools: + $(foreach tool,$(TOOLDIRS),$(MAKE) clean -C $(tool);) + include graphics_rules.mk %.s: ; diff --git a/build_tools.sh b/build_tools.sh deleted file mode 100755 index c33d864..0000000 --- a/build_tools.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -make -C tools/gbafix CXX=${1:-g++} -make -C tools/scaninc CXX=${1:-g++} -make -C tools/gbagfx CXX=${1:-g++} -make -C tools/preproc CXX=${1:-g++} -make -C tools/ramscrgen CXX=${1:-g++} |