From acebbfef39508640795b0a151646f653eb915ae1 Mon Sep 17 00:00:00 2001 From: Ryan Myers Date: Thu, 21 Oct 2021 11:11:25 -0400 Subject: [PATCH] Add coloring to the Make process to make it easier to distiinguish warnings for each file. Stolen from sm64. Also fixed some easy warnings by using this. --- Makefile | 31 +++++++++++++++++++++++++++++-- lib/src/al/alCSPGetChlVol.c | 2 +- lib/src/al/alCSPSetVol.c | 1 - lib/src/al/alHeapDBAlloc.c | 2 -- lib/src/al/alSeqpGetChlFXMix.c | 2 +- src/unknown_0348C0.c | 2 +- src/unknown_0348C0.h | 4 ++-- src/unknown_05F0C0.h | 2 +- src/unknown_05FF10.h | 2 +- 9 files changed, 36 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index cd4d228c..f0a2382a 100755 --- a/Makefile +++ b/Makefile @@ -19,6 +19,15 @@ ifeq ($(NON_MATCHING),1) DEFINES += NON_MATCHING=1 endif +# Whether to hide commands or not +VERBOSE ?= 0 +ifeq ($(VERBOSE),0) + V := @ +endif + +# Whether to colorize build messages +COLOR ?= 1 + ############################ Setup ########################### # Don't do setup checks if cleaning. @@ -41,6 +50,22 @@ ifeq ($(DUMMY),FAIL) $(error Failed to build tools) endif +PRINT = printf + +ifeq ($(COLOR),1) +NO_COL := \033[0m +RED := \033[0;31m +GREEN := \033[0;32m +BLUE := \033[0;34m +YELLOW := \033[0;33m +BLINK := \033[33;5m +endif + +# Common build print status function +define print + @$(PRINT) "$(GREEN)$(1) $(YELLOW)$(2)$(GREEN) -> $(BLUE)$(3)$(NO_COL)\n" +endef + ########## Recomp ########## RECOMP_PROJECT := ./tools/ido-static-recomp/ @@ -410,10 +435,12 @@ $(UCODE_OUT_DIR)/%.bin: $(UCODE_IN_DIR)/%.bin ############################### $(BUILD_DIR)/%.o: %.s | $(ALL_ASSETS_BUILT) - $(AS) $(ASFLAGS) -o $@ $< + $(call print,Compiling:,$<,$@) + $(V)$(AS) $(ASFLAGS) -o $@ $< $(BUILD_DIR)/%.o: %.c | $(ALL_ASSETS_BUILT) - $(CC) $(CFLAGS) -o $@ $< + $(call print,Compiling:,$<,$@) + $(V)$(CC) $(CFLAGS) -o $@ $< $(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) | $(ALL_ASSETS_BUILT) $(CPP) $(VERSION_CFLAGS) -DBUILD_DIR=$(BUILD_DIR) -MMD -MP -MT $@ -MF $@.d -o $@ $< diff --git a/lib/src/al/alCSPGetChlVol.c b/lib/src/al/alCSPGetChlVol.c index d385d0b4..4d7dbc18 100644 --- a/lib/src/al/alCSPGetChlVol.c +++ b/lib/src/al/alCSPGetChlVol.c @@ -5,4 +5,4 @@ u8 alCSPGetChlVol(ALCSPlayer *seqp, u8 chan) { return seqp->chanState[chan].vol; -} \ No newline at end of file +} diff --git a/lib/src/al/alCSPSetVol.c b/lib/src/al/alCSPSetVol.c index 9910a3aa..d704d962 100644 --- a/lib/src/al/alCSPSetVol.c +++ b/lib/src/al/alCSPSetVol.c @@ -11,4 +11,3 @@ void alCSPSetVol(ALCSPlayer *seqp, s16 vol) { alEvtqPostEvent(&seqp->evtq, &evt, 0); } - diff --git a/lib/src/al/alHeapDBAlloc.c b/lib/src/al/alHeapDBAlloc.c index 10bee9bb..b842ff64 100644 --- a/lib/src/al/alHeapDBAlloc.c +++ b/lib/src/al/alHeapDBAlloc.c @@ -17,5 +17,3 @@ void *alHeapDBAlloc(u8 *file, s32 line, ALHeap *hp, s32 num, s32 size) { return ptr; } - - diff --git a/lib/src/al/alSeqpGetChlFXMix.c b/lib/src/al/alSeqpGetChlFXMix.c index 6243101b..e26daa7d 100644 --- a/lib/src/al/alSeqpGetChlFXMix.c +++ b/lib/src/al/alSeqpGetChlFXMix.c @@ -5,4 +5,4 @@ u8 alSeqpGetChlFXMix(ALSeqPlayer *seqp, u8 chan) { return seqp->chanState[chan].fxmix; -} \ No newline at end of file +} diff --git a/src/unknown_0348C0.c b/src/unknown_0348C0.c index 926c4f8a..be94816f 100644 --- a/src/unknown_0348C0.c +++ b/src/unknown_0348C0.c @@ -1292,7 +1292,7 @@ void func_8003FEF4(Object *arg0, LevelObjectEntry8003FEF4 *arg1) { obj64->unk2 = arg1->unkA; obj64->unkC = arg1->unkC; obj64->unkD = arg1->unkD; - obj64->unk8_word = 0; + obj64->unk_union.unk8_word = 0; obj64->unk4 = arg1->unkE; obj64->unk11 = arg1->unk12; obj64->unk10 = arg1->unk11; diff --git a/src/unknown_0348C0.h b/src/unknown_0348C0.h index 1eb0676a..51552de9 100644 --- a/src/unknown_0348C0.h +++ b/src/unknown_0348C0.h @@ -287,9 +287,9 @@ typedef struct Object_64_8003FEF4 { u8 unk9; u8 unkA; u8 padB; - }; + } unk_struct; s32 unk8_word; - }; + } unk_union; u8 unkC; u8 unkD; u8 unkE; diff --git a/src/unknown_05F0C0.h b/src/unknown_05F0C0.h index c1913d7c..d5e327ee 100644 --- a/src/unknown_05F0C0.h +++ b/src/unknown_05F0C0.h @@ -5,4 +5,4 @@ extern s16 D_800DCE40[16]; -#endif \ No newline at end of file +#endif diff --git a/src/unknown_05FF10.h b/src/unknown_05FF10.h index 3b36db7c..68cefc97 100644 --- a/src/unknown_05FF10.h +++ b/src/unknown_05FF10.h @@ -5,4 +5,4 @@ extern s16 D_800DCE80[14]; -#endif \ No newline at end of file +#endif