From 5ea1f39a9dde753c5787d211c97963037daadfa5 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 13 Sep 2024 14:27:40 -0300 Subject: [PATCH] Rebuild of makefile 5: trainerproc --- Makefile | 24 +++++++++++++++--------- make_tools.mk | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 2b87d61e08..dde15c644a 100644 --- a/Makefile +++ b/Makefile @@ -155,15 +155,16 @@ endif AUTO_GEN_TARGETS := include make_tools.mk # Tool executables -GFX := $(TOOLS_DIR)/gbagfx/gbagfx$(EXE) -AIF := $(TOOLS_DIR)/aif2pcm/aif2pcm$(EXE) -MID := $(TOOLS_DIR)/mid2agb/mid2agb$(EXE) -SCANINC := $(TOOLS_DIR)/scaninc/scaninc$(EXE) -PREPROC := $(TOOLS_DIR)/preproc/preproc$(EXE) -RAMSCRGEN := $(TOOLS_DIR)/ramscrgen/ramscrgen$(EXE) -FIX := $(TOOLS_DIR)/gbafix/gbafix$(EXE) -MAPJSON := $(TOOLS_DIR)/mapjson/mapjson$(EXE) -JSONPROC := $(TOOLS_DIR)/jsonproc/jsonproc$(EXE) +GFX := $(TOOLS_DIR)/gbagfx/gbagfx$(EXE) +AIF := $(TOOLS_DIR)/aif2pcm/aif2pcm$(EXE) +MID := $(TOOLS_DIR)/mid2agb/mid2agb$(EXE) +SCANINC := $(TOOLS_DIR)/scaninc/scaninc$(EXE) +PREPROC := $(TOOLS_DIR)/preproc/preproc$(EXE) +RAMSCRGEN := $(TOOLS_DIR)/ramscrgen/ramscrgen$(EXE) +FIX := $(TOOLS_DIR)/gbafix/gbafix$(EXE) +MAPJSON := $(TOOLS_DIR)/mapjson/mapjson$(EXE) +JSONPROC := $(TOOLS_DIR)/jsonproc/jsonproc$(EXE) +TRAINERPROC := $(TOOLS_DIR)/trainerproc/trainerproc$(EXE) PERL := perl SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c @@ -305,6 +306,11 @@ generated: tools $(AUTO_GEN_TARGETS) clean-generated: -rm -f $(AUTO_GEN_TARGETS) +COMPETITIVE_PARTY_SYNTAX := $(shell PATH="$(PATH)"; echo 'COMPETITIVE_PARTY_SYNTAX' | $(CPP) $(CPPFLAGS) -imacros include/gba/defines.h -imacros include/config/general.h | tail -n1) +ifeq ($(COMPETITIVE_PARTY_SYNTAX),1) +%.h: %.party tools ; $(CPP) $(CPPFLAGS) -traditional-cpp - < $< | $(TRAINERPROC) -o $@ -i $< - +endif + ifeq ($(MODERN),0) $(C_BUILDDIR)/libc.o: CC1 := $(TOOLS_DIR)/agbcc/bin/old_agbcc$(EXE) $(C_BUILDDIR)/libc.o: CFLAGS := -O2 diff --git a/make_tools.mk b/make_tools.mk index 4a6a929a86..df9696f518 100644 --- a/make_tools.mk +++ b/make_tools.mk @@ -5,7 +5,7 @@ MAKEFLAGS += --no-print-directory # Inclusive list. If you don't want a tool to be built, don't add it here. TOOLS_DIR := tools -TOOL_NAMES := aif2pcm bin2c gbafix gbagfx jsonproc mapjson mid2agb preproc ramscrgen rsfont scaninc +TOOL_NAMES := aif2pcm bin2c gbafix gbagfx jsonproc mapjson mid2agb preproc ramscrgen rsfont scaninc trainerproc TOOLDIRS := $(TOOL_NAMES:%=$(TOOLS_DIR)/%)