@@ -47,6 +47,14 @@ RGBFIX ?= $(RGBDS)rgbfix
47
47
RGBGFX ?= $(RGBDS ) rgbgfx
48
48
RGBLINK ?= $(RGBDS ) rgblink
49
49
50
+ # Quiet output by default
51
+ Q := @
52
+ ifeq ($(Q ) ,@)
53
+ QMAKE := --no-print-directory
54
+ else
55
+ QMAKE :=
56
+ endif
57
+
50
58
51
59
# ## Build targets
52
60
@@ -65,13 +73,14 @@ crystal11_debug: pokecrystal11_debug.gbc
65
73
crystal11_vc : pokecrystal11.patch
66
74
67
75
clean : tidy
68
- find gfx \
76
+ @echo " Deleting intermediate build products..."
77
+ $(Q ) find gfx \
69
78
\( -name " *.[12]bpp" \
70
79
-o -name " *.lz" \
71
80
-o -name " *.gbcpal" \
72
81
-o -name " *.sgb.tilemap" \) \
73
82
-delete
74
- find gfx/pokemon -mindepth 1 \
83
+ $( Q ) find gfx/pokemon -mindepth 1 \
75
84
! -path " gfx/pokemon/unown/*" \
76
85
\( -name " bitmask.asm" \
77
86
-o -name " frames.asm" \
@@ -80,7 +89,8 @@ clean: tidy
80
89
-delete
81
90
82
91
tidy :
83
- $(RM ) $(roms ) \
92
+ @echo " Deleting build products..."
93
+ $(Q )$(RM ) $(roms ) \
84
94
$(roms:.gbc=.sym ) \
85
95
$(roms:.gbc=.map ) \
86
96
$(patches ) \
@@ -95,13 +105,15 @@ tidy:
95
105
$(pokecrystal_debug_obj ) \
96
106
$(pokecrystal11_debug_obj ) \
97
107
rgbdscheck.o
98
- $(MAKE ) clean -C tools/
108
+ $(Q )$( MAKE ) clean -C tools/ $( QMAKE ) Q= $( Q )
99
109
100
110
compare : $(roms ) $(patches )
101
- @$(SHA1 ) -c roms.sha1
111
+ @echo " Comparing output ROMs with originals..."
112
+ $(Q )$(SHA1 ) -c roms.sha1
102
113
103
114
tools :
104
- $(MAKE ) -C tools/
115
+ @echo " Building tools..."
116
+ $(Q )$(MAKE ) -C tools/ $(QMAKE ) Q=$(Q )
105
117
106
118
107
119
RGBASMFLAGS = -hL -Q8 -P includes.asm -Weverything -Wnumeric-string=2 -Wtruncation=1
@@ -118,24 +130,26 @@ $(pokecrystal11_debug_obj): RGBASMFLAGS += -D _CRYSTAL11 -D _DEBUG
118
130
$(pokecrystal11_vc_obj ) : RGBASMFLAGS += -D _CRYSTAL11 -D _CRYSTAL11_VC
119
131
120
132
% .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 $^ $@
122
135
123
136
rgbdscheck.o : rgbdscheck.asm
124
- $(RGBASM ) -o $@ $<
137
+ @echo " Checking RGBDS version..."
138
+ $(Q )$(RGBASM ) -o $@ $<
125
139
126
140
# Build tools when building the rom.
127
141
# This has to happen before the rules are processed, since that's when scan_includes is run.
128
142
ifeq (,$(filter clean tidy tools,$(MAKECMDGOALS ) ) )
129
143
130
- $(info $(shell $(MAKE) -C tools))
144
+ $(info $(shell $(MAKE) tools))
131
145
132
146
# The dep rules have to be explicit or else missing files won't be reported.
133
147
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
134
148
# It doesn't look like $(shell) can be deferred so there might not be a better way.
135
149
preinclude_deps := includes.asm $(shell tools/scan_includes includes.asm)
136
150
define DEP
137
151
$1: $2 $$(shell tools/scan_includes $2) $(preinclude_deps ) | rgbdscheck.o
138
- $$(RGBASM ) $$(RGBASMFLAGS ) -o $$@ $$<
152
+ $$(Q )$$( RGBASM ) $$(RGBASMFLAGS ) -o $$@ $$<
139
153
endef
140
154
141
155
# Dependencies for shared objects objects
@@ -148,7 +162,8 @@ $(foreach obj, $(pokecrystal11_vc_obj), $(eval $(call DEP,$(obj),$(obj:11_vc.o=.
148
162
149
163
# Dependencies for VC files that need to run scan_includes
150
164
% .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 ) $< > $@
152
167
153
168
endif
154
169
@@ -161,9 +176,10 @@ pokecrystal11_debug_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10
161
176
pokecrystal11_vc_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10 -r 3 -p 0
162
177
163
178
% .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 $@
167
183
168
184
169
185
# ## LZ compression rules
@@ -172,39 +188,39 @@ pokecrystal11_vc_opt = -Cjv -t PM_CRYSTAL -i BYTE -n 1 -k 01 -l 0x33 -m 0x10
172
188
include gfx/lz.mk
173
189
174
190
% .lz : %
175
- tools/lzcomp $(LZFLAGS ) -- $< $@
191
+ $( Q ) tools/lzcomp $(LZFLAGS ) -- $< $@
176
192
177
193
178
194
# ## Pokemon pic animation rules
179
195
180
196
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 $@ $^
182
198
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 $@ $^
184
200
gfx/pokemon/% /bitmask.asm : gfx/pokemon/% /front.animated.tilemap gfx/pokemon/% /front.dimensions
185
- tools/pokemon_animation -b $^ > $@
201
+ $( Q ) tools/pokemon_animation -b $^ > $@
186
202
gfx/pokemon/% /frames.asm : gfx/pokemon/% /front.animated.tilemap gfx/pokemon/% /front.dimensions
187
- tools/pokemon_animation -f $^ > $@
203
+ $( Q ) tools/pokemon_animation -f $^ > $@
188
204
189
205
190
206
# ## Terrible hacks to match animations. Delete these rules if you don't care about matching.
191
207
192
208
# Dewgong has an unused tile id in its last frame. The tile itself is missing.
193
209
gfx/pokemon/dewgong/frames.asm : gfx/pokemon/dewgong/front.animated.tilemap gfx/pokemon/dewgong/front.dimensions
194
- tools/pokemon_animation -f $^ > $@
195
- echo " db \$ $4 d" >> $@
210
+ $( Q ) tools/pokemon_animation -f $^ > $@
211
+ $( Q ) echo " db \$ $4 d" >> $@
196
212
197
213
# Lugia has two unused tile ids in its last frame. The tiles themselves are missing.
198
214
gfx/pokemon/lugia/frames.asm : gfx/pokemon/lugia/front.animated.tilemap gfx/pokemon/lugia/front.dimensions
199
- tools/pokemon_animation -f $^ > $@
200
- echo " db \$ $5 e, \$ $5 9" >> $@
215
+ $( Q ) tools/pokemon_animation -f $^ > $@
216
+ $( Q ) echo " db \$ $5 e, \$ $5 9" >> $@
201
217
202
218
# Girafarig has a redundant tile after the end. It is used in two frames, so it must be injected into the generated graphics.
203
219
# This is more involved, so it's hacked into pokemon_animation_graphics.
204
220
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 $@ $^
206
222
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 $@ $^
208
224
209
225
210
226
# ## Misc file-specific graphics rules
@@ -241,7 +257,7 @@ gfx/title/logo.2bpp: rgbgfx += -x 4
241
257
242
258
gfx/trade/ball.2bpp : tools/gfx += --remove-whitespace
243
259
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 $^ > $@
245
261
246
262
gfx/slots/slots_1.2bpp : tools/gfx += --trim-whitespace
247
263
gfx/slots/slots_2.2bpp : tools/gfx += --interleave --png=$<
@@ -287,7 +303,7 @@ gfx/battle/dude.2bpp: rgbgfx += -Z
287
303
gfx/font/unused_bold_font.1bpp : tools/gfx += --trim-whitespace
288
304
289
305
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' > $@
291
307
292
308
gfx/mobile/ascii_font.2bpp : tools/gfx += --trim-whitespace
293
309
gfx/mobile/dialpad.2bpp : tools/gfx += --trim-whitespace
@@ -305,17 +321,17 @@ gfx/mobile/stadium2_n64.2bpp: tools/gfx += --trim-whitespace
305
321
# ## Catch-all graphics rules
306
322
307
323
% .2bpp : % .png
308
- $(RGBGFX ) $(rgbgfx ) -o $@ $<
324
+ $(Q )$( RGBGFX ) $(rgbgfx ) -o $@ $<
309
325
$(if $(tools/gfx ) ,\
310
- tools/gfx $(tools/gfx ) -o $@ $@ )
326
+ $( Q ) tools/gfx $(tools/gfx ) -o $@ $@ )
311
327
312
328
% .1bpp : % .png
313
- $(RGBGFX ) $(rgbgfx ) -d1 -o $@ $<
329
+ $(Q )$( RGBGFX ) $(rgbgfx ) -d1 -o $@ $<
314
330
$(if $(tools/gfx ) ,\
315
- tools/gfx $(tools/gfx ) -d1 -o $@ $@ )
331
+ $( Q ) tools/gfx $(tools/gfx ) -d1 -o $@ $@ )
316
332
317
333
% .gbcpal : % .png
318
- $(RGBGFX ) -c embedded -p $@ $<
334
+ $(Q )$( RGBGFX ) -c embedded -p $@ $<
319
335
320
336
% .dimensions : % .png
321
- tools/png_dimensions $< $@
337
+ $( Q ) tools/png_dimensions $< $@
0 commit comments