Quieter "make tools"

This commit is contained in:
PikalaxALT 2019-07-23 16:17:00 -04:00
parent fd53bbc464
commit 6ff1426abe
11 changed files with 59 additions and 20 deletions

View File

@ -51,7 +51,7 @@ ROM := pokeemerald.gba
OBJ_DIR := build/emerald
LIBPATH := -L ../../tools/agbcc/lib
else
CC1 := $(shell $(PREFIX)gcc --print-prog-name=cc1) -quiet
CC1 := $(shell $(CC) --print-prog-name=cc1) -quiet
override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast
ROM := pokeemerald_modern.gba
OBJ_DIR := build/modern
@ -78,6 +78,12 @@ FIX := tools/gbafix/gbafix$(EXE)
MAPJSON := tools/mapjson/mapjson$(EXE)
JSONPROC := tools/jsonproc/jsonproc$(EXE)
TOOLDIRS := $(filter-out tools/agbcc tools/binutils,$(wildcard tools/*))
TOOLBASE = $(TOOLDIRS:tools/%=%)
TOOLS = $(foreach tool,$(TOOLBASE),tools/$(tool)/$(tool)$(EXE))
MAKEFLAGS += --no-print-directory
# Clear the default suffixes
.SUFFIXES:
# Don't delete intermediate files
@ -88,7 +94,17 @@ JSONPROC := tools/jsonproc/jsonproc$(EXE)
# Secondary expansion is required for dependency variables in object rules.
.SECONDEXPANSION:
.PHONY: rom clean compare tidy tools mostlyclean clean-tools
.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS)
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, $(MAKE) tools)
else
NODEP := 1
endif
C_SRCS := $(wildcard $(C_SUBDIR)/*.c $(C_SUBDIR)/*/*.c $(C_SUBDIR)/*/*/*.c)
C_OBJS := $(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(C_SRCS))
@ -112,18 +128,14 @@ SUBDIRS := $(sort $(dir $(OBJS)))
AUTO_GEN_TARGETS :=
TOOLDIRS := $(filter-out tools/agbcc tools/binutils,$(wildcard tools/*))
TOOLBASE = $(TOOLDIRS:tools/%=%)
TOOLS = $(foreach tool,$(TOOLBASE),tools/%(tool)/$(tool)$(EXE))
$(shell mkdir -p $(SUBDIRS))
all: tools rom
all: rom
tools: $(TOOLS)
tools: $(TOOLDIRS)
$(TOOLS):
@$(foreach tooldir,$(TOOLDIRS),$(MAKE) -C $(tooldir);)
$(TOOLDIRS):
@$(MAKE) -C $@
rom: $(ROM)

View File

@ -220,7 +220,7 @@ static void ShowBgInternal(u8 bg)
(sGpuBgConfigs.configs[bg].wraparound << 13) |
(sGpuBgConfigs.configs[bg].screenSize << 14);
SetGpuReg((bg << 1) + 0x8, value);
SetGpuReg((bg << 1) + REG_OFFSET_BG0CNT, value);
sGpuBgConfigs.bgVisibilityAndMode |= 1 << (bg + 8);
sGpuBgConfigs.bgVisibilityAndMode &= DISPCNT_ALL_BG_AND_MODE_BITS;

View File

@ -6,7 +6,10 @@ LIBS = -lm
SRCS = main.c extended.c
.PHONY: clean
.PHONY: all clean
all: aif2pcm
@:
aif2pcm: $(SRCS)
$(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS)

View File

@ -2,10 +2,13 @@ CC = gcc
CFLAGS = -Wall -Wextra -Werror -std=c11 -O2
.PHONY: clean
.PHONY: all clean
SRCS = bin2c.c
all: bin2c
@:
bin2c: $(SRCS)
$(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS)

View File

@ -1,8 +1,11 @@
CC = gcc
.PHONY: clean
.PHONY: all clean
SRCS = gbafix.c
all: gbafix
@:
gbafix: $(SRCS)
$(CC) $(SRCS) -o $@ $(LDFLAGS)

View File

@ -8,7 +8,10 @@ SRCS := jsonproc.cpp
HEADERS := jsonproc.h inja.hpp nlohmann/json.hpp
.PHONY: clean
.PHONY: all clean
all: jsonproc
@:
jsonproc: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) -o $@ $(LDFLAGS)

View File

@ -6,7 +6,10 @@ SRCS := json11.cpp mapjson.cpp
HEADERS := mapjson.h
.PHONY: clean
.PHONY: all clean
all: mapjson
@:
mapjson: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)

View File

@ -8,7 +8,10 @@ SRCS := asm_file.cpp c_file.cpp charmap.cpp preproc.cpp string_parser.cpp \
HEADERS := asm_file.h c_file.h char_util.h charmap.h preproc.h string_parser.h \
utf8.h
.PHONY: clean
.PHONY: all clean
all: preproc
@:
preproc: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)

View File

@ -6,7 +6,10 @@ SRCS := main.cpp sym_file.cpp elf.cpp
HEADERS := ramscrgen.h sym_file.h elf.h char_util.h
.PHONY: clean
.PHONY: all clean
all: ramscrgen
@:
ramscrgen: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)

View File

@ -6,7 +6,10 @@ LIBS = -lpng -lz
SRCS = main.c convert_png.c util.c font.c
.PHONY: clean
.PHONY: all clean
all: rsfont
@:
rsfont: $(SRCS) convert_png.h gfx.h global.h util.h font.h
$(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS)

View File

@ -6,7 +6,10 @@ SRCS = scaninc.cpp c_file.cpp asm_file.cpp source_file.cpp
HEADERS := scaninc.h asm_file.h c_file.h source_file.h
.PHONY: clean
.PHONY: all clean
all: scaninc
@:
scaninc: $(SRCS) $(HEADERS)
$(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)