Skip to content

Commit e1fd7ba

Browse files
committed
make defaults to quiet output
1 parent 9a917e3 commit e1fd7ba

File tree

2 files changed

+55
-37
lines changed

2 files changed

+55
-37
lines changed

Makefile

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ RGBFIX ?= $(RGBDS)rgbfix
4747
RGBGFX ?= $(RGBDS)rgbgfx
4848
RGBLINK ?= $(RGBDS)rgblink
4949

50+
# Quiet output by default
51+
Q := @
52+
ifeq ($(Q),@)
53+
QMAKE := --no-print-directory
54+
else
55+
QMAKE :=
56+
endif
57+
5058

5159
### Build targets
5260

@@ -65,13 +73,14 @@ crystal11_debug: pokecrystal11_debug.gbc
6573
crystal11_vc: pokecrystal11.patch
6674

6775
clean: tidy
68-
find gfx \
76+
@echo "Deleting intermediate build products..."
77+
$(Q)find gfx \
6978
\( -name "*.[12]bpp" \
7079
-o -name "*.lz" \
7180
-o -name "*.gbcpal" \
7281
-o -name "*.sgb.tilemap" \) \
7382
-delete
74-
find gfx/pokemon -mindepth 1 \
83+
$(Q)find gfx/pokemon -mindepth 1 \
7584
! -path "gfx/pokemon/unown/*" \
7685
\( -name "bitmask.asm" \
7786
-o -name "frames.asm" \
@@ -80,7 +89,8 @@ clean: tidy
8089
-delete
8190

8291
tidy:
83-
$(RM) $(roms) \
92+
@echo "Deleting build products..."
93+
$(Q)$(RM) $(roms) \
8494
$(roms:.gbc=.sym) \
8595
$(roms:.gbc=.map) \
8696
$(patches) \
@@ -95,13 +105,15 @@ tidy:
95105
$(pokecrystal_debug_obj) \
96106
$(pokecrystal11_debug_obj) \
97107
rgbdscheck.o
98-
$(MAKE) clean -C tools/
108+
$(Q)$(MAKE) clean -C tools/ $(QMAKE) Q=$(Q)
99109

100110
compare: $(roms) $(patches)
101-
@$(SHA1) -c roms.sha1
111+
@echo "Comparing output ROMs with originals..."
112+
$(Q)$(SHA1) -c roms.sha1
102113

103114
tools:
104-
$(MAKE) -C tools/
115+
@echo "Building tools..."
116+
$(Q)$(MAKE) -C tools/ $(QMAKE) Q=$(Q)
105117

106118

107119
RGBASMFLAGS = -hL -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1
@@ -118,24 +130,26 @@ $(pokecrystal11_debug_obj): RGBASMFLAGS += -D _CRYSTAL11 -D _DEBUG
118130
$(pokecrystal11_vc_obj): RGBASMFLAGS += -D _CRYSTAL11 -D _CRYSTAL11_VC
119131

120132
%.patch: vc/%.constants.sym %_vc.gbc %.gbc vc/%.patch.template
121-
tools/make_patch $*_vc.sym $^ $@
133+
@echo "Building VC patch $@..."
134+
$(Q)tools/make_patch $*_vc.sym $^ $@
122135

123136
rgbdscheck.o: rgbdscheck.asm
124-
$(RGBASM) -o $@ $<
137+
@echo "Checking RGBDS version..."
138+
$(Q)$(RGBASM) -o $@ $<
125139

126140
# Build tools when building the rom.
127141
# This has to happen before the rules are processed, since that's when scan_includes is run.
128142
ifeq (,$(filter clean tidy tools,$(MAKECMDGOALS)))
129143

130-
$(info $(shell $(MAKE) -C tools))
144+
$(info $(shell $(MAKE) tools))
131145

132146
# The dep rules have to be explicit or else missing files won't be reported.
133147
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
134148
# It doesn't look like $(shell) can be deferred so there might not be a better way.
135149
preinclude_deps := includes.asm $(shell tools/scan_includes includes.asm)
136150
define DEP
137151
$1: $2 $$(shell tools/scan_includes $2) $(preinclude_deps) | rgbdscheck.o
138-
$$(RGBASM) $$(RGBASMFLAGS) -o $$@ $$<
152+
$$(Q)$$(RGBASM) $$(RGBASMFLAGS) -o $$@ $$<
139153
endef
140154

141155
# Dependencies for shared objects objects
@@ -148,7 +162,8 @@ $(foreach obj, $(pokecrystal11_vc_obj), $(eval $(call DEP,$(obj),$(obj:11_vc.o=.
148162

149163
# Dependencies for VC files that need to run scan_includes
150164
%.constants.sym: %.constants.asm $(shell tools/scan_includes %.constants.asm) $(preinclude_deps) | rgbdscheck.o
151-
$(RGBASM) $(RGBASMFLAGS) $< > $@
165+
@echo "Finding VC patch values..."
166+
$(Q)$(RGBASM) $(RGBASMFLAGS) $< > $@
152167

153168
endif
154169

@@ -161,9 +176,10 @@ pokecrystal11_debug_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10
161176
pokecrystal11_vc_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10 -r 3 -p 0
162177

163178
%.gbc: $$(%_obj) layout.link
164-
$(RGBLINK) -n $*.sym -m $*.map -l layout.link -o $@ $(filter %.o,$^)
165-
$(RGBFIX) $($*_opt) $@
166-
tools/stadium $@
179+
@echo "Building ROM $@..."
180+
$(Q)$(RGBLINK) -n $*.sym -m $*.map -l layout.link -o $@ $(filter %.o,$^)
181+
$(Q)$(RGBFIX) $($*_opt) $@
182+
$(Q)tools/stadium $@
167183

168184

169185
### LZ compression rules
@@ -172,39 +188,39 @@ pokecrystal11_vc_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10
172188
include gfx/lz.mk
173189

174190
%.lz: %
175-
tools/lzcomp $(LZFLAGS) -- $< $@
191+
$(Q)tools/lzcomp $(LZFLAGS) -- $< $@
176192

177193

178194
### Pokemon pic animation rules
179195

180196
gfx/pokemon/%/front.animated.2bpp: gfx/pokemon/%/front.2bpp gfx/pokemon/%/front.dimensions
181-
tools/pokemon_animation_graphics -o $@ $^
197+
$(Q)tools/pokemon_animation_graphics -o $@ $^
182198
gfx/pokemon/%/front.animated.tilemap: gfx/pokemon/%/front.2bpp gfx/pokemon/%/front.dimensions
183-
tools/pokemon_animation_graphics -t $@ $^
199+
$(Q)tools/pokemon_animation_graphics -t $@ $^
184200
gfx/pokemon/%/bitmask.asm: gfx/pokemon/%/front.animated.tilemap gfx/pokemon/%/front.dimensions
185-
tools/pokemon_animation -b $^ > $@
201+
$(Q)tools/pokemon_animation -b $^ > $@
186202
gfx/pokemon/%/frames.asm: gfx/pokemon/%/front.animated.tilemap gfx/pokemon/%/front.dimensions
187-
tools/pokemon_animation -f $^ > $@
203+
$(Q)tools/pokemon_animation -f $^ > $@
188204

189205

190206
### Terrible hacks to match animations. Delete these rules if you don't care about matching.
191207

192208
# Dewgong has an unused tile id in its last frame. The tile itself is missing.
193209
gfx/pokemon/dewgong/frames.asm: gfx/pokemon/dewgong/front.animated.tilemap gfx/pokemon/dewgong/front.dimensions
194-
tools/pokemon_animation -f $^ > $@
195-
echo " db \$$4d" >> $@
210+
$(Q)tools/pokemon_animation -f $^ > $@
211+
$(Q)echo " db \$$4d" >> $@
196212

197213
# Lugia has two unused tile ids in its last frame. The tiles themselves are missing.
198214
gfx/pokemon/lugia/frames.asm: gfx/pokemon/lugia/front.animated.tilemap gfx/pokemon/lugia/front.dimensions
199-
tools/pokemon_animation -f $^ > $@
200-
echo " db \$$5e, \$$59" >> $@
215+
$(Q)tools/pokemon_animation -f $^ > $@
216+
$(Q)echo " db \$$5e, \$$59" >> $@
201217

202218
# Girafarig has a redundant tile after the end. It is used in two frames, so it must be injected into the generated graphics.
203219
# This is more involved, so it's hacked into pokemon_animation_graphics.
204220
gfx/pokemon/girafarig/front.animated.2bpp: gfx/pokemon/girafarig/front.2bpp gfx/pokemon/girafarig/front.dimensions
205-
tools/pokemon_animation_graphics --girafarig -o $@ $^
221+
$(Q)tools/pokemon_animation_graphics --girafarig -o $@ $^
206222
gfx/pokemon/girafarig/front.animated.tilemap: gfx/pokemon/girafarig/front.2bpp gfx/pokemon/girafarig/front.dimensions
207-
tools/pokemon_animation_graphics --girafarig -t $@ $^
223+
$(Q)tools/pokemon_animation_graphics --girafarig -t $@ $^
208224

209225

210226
### Misc file-specific graphics rules
@@ -241,7 +257,7 @@ gfx/title/logo.2bpp: rgbgfx += -x 4
241257

242258
gfx/trade/ball.2bpp: tools/gfx += --remove-whitespace
243259
gfx/trade/game_boy.2bpp: tools/gfx += --remove-duplicates --preserve=0x23,0x27
244-
gfx/trade/game_boy_cable.2bpp: gfx/trade/game_boy.2bpp gfx/trade/link_cable.2bpp ; cat $^ > $@
260+
gfx/trade/game_boy_cable.2bpp: gfx/trade/game_boy.2bpp gfx/trade/link_cable.2bpp ; $(Q)cat $^ > $@
245261

246262
gfx/slots/slots_1.2bpp: tools/gfx += --trim-whitespace
247263
gfx/slots/slots_2.2bpp: tools/gfx += --interleave --png=$<
@@ -287,7 +303,7 @@ gfx/battle/dude.2bpp: rgbgfx += -Z
287303
gfx/font/unused_bold_font.1bpp: tools/gfx += --trim-whitespace
288304

289305
gfx/sgb/sgb_border.2bpp: tools/gfx += --trim-whitespace
290-
gfx/sgb/sgb_border.sgb.tilemap: gfx/sgb/sgb_border.bin ; tr < $< -d '\000' > $@
306+
gfx/sgb/sgb_border.sgb.tilemap: gfx/sgb/sgb_border.bin ; $(Q)tr < $< -d '\000' > $@
291307

292308
gfx/mobile/ascii_font.2bpp: tools/gfx += --trim-whitespace
293309
gfx/mobile/dialpad.2bpp: tools/gfx += --trim-whitespace
@@ -305,17 +321,17 @@ gfx/mobile/stadium2_n64.2bpp: tools/gfx += --trim-whitespace
305321
### Catch-all graphics rules
306322

307323
%.2bpp: %.png
308-
$(RGBGFX) $(rgbgfx) -o $@ $<
324+
$(Q)$(RGBGFX) $(rgbgfx) -o $@ $<
309325
$(if $(tools/gfx),\
310-
tools/gfx $(tools/gfx) -o $@ $@)
326+
$(Q)tools/gfx $(tools/gfx) -o $@ $@)
311327

312328
%.1bpp: %.png
313-
$(RGBGFX) $(rgbgfx) -d1 -o $@ $<
329+
$(Q)$(RGBGFX) $(rgbgfx) -d1 -o $@ $<
314330
$(if $(tools/gfx),\
315-
tools/gfx $(tools/gfx) -d1 -o $@ $@)
331+
$(Q)tools/gfx $(tools/gfx) -d1 -o $@ $@)
316332

317333
%.gbcpal: %.png
318-
$(RGBGFX) -c embedded -p $@ $<
334+
$(Q)$(RGBGFX) -c embedded -p $@ $<
319335

320336
%.dimensions: %.png
321-
tools/png_dimensions $< $@
337+
$(Q)tools/png_dimensions $< $@

tools/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
CC := gcc
44
CFLAGS := -O3 -flto -std=c11 -Wall -Wextra -pedantic
55

6+
Q := @
7+
68
tools := \
79
bpp2png \
810
lzcomp \
@@ -18,7 +20,7 @@ all: $(tools)
1820
@:
1921

2022
clean:
21-
$(RM) $(tools)
23+
$(Q)$(RM) $(tools)
2224

2325
gfx: common.h
2426
png_dimensions: common.h
@@ -28,11 +30,11 @@ scan_includes: common.h
2830
stadium: common.h
2931

3032
bpp2png: bpp2png.c lodepng/lodepng.c common.h lodepng/lodepng.h
31-
$(CC) $(CFLAGS) -o $@ bpp2png.c lodepng/lodepng.c
33+
$(Q)$(CC) $(CFLAGS) -o $@ bpp2png.c lodepng/lodepng.c
3234

3335
lzcomp: CFLAGS += -Wno-strict-overflow -Wno-sign-compare
3436
lzcomp: $(wildcard lz/*.c) $(wildcard lz/*.h)
35-
$(CC) $(CFLAGS) -o $@ lz/*.c
37+
$(Q)$(CC) $(CFLAGS) -o $@ lz/*.c
3638

3739
%: %.c
38-
$(CC) $(CFLAGS) -o $@ $<
40+
$(Q)$(CC) $(CFLAGS) -o $@ $<

0 commit comments

Comments
 (0)