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.

This commit is contained in:
Ryan Myers
2021-10-21 11:11:25 -04:00
parent d9c00c1827
commit acebbfef39
9 changed files with 36 additions and 12 deletions
+29 -2
View File
@@ -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 $@ $<
+1 -1
View File
@@ -5,4 +5,4 @@
u8 alCSPGetChlVol(ALCSPlayer *seqp, u8 chan) {
return seqp->chanState[chan].vol;
}
}
-1
View File
@@ -11,4 +11,3 @@ void alCSPSetVol(ALCSPlayer *seqp, s16 vol) {
alEvtqPostEvent(&seqp->evtq, &evt, 0);
}
-2
View File
@@ -17,5 +17,3 @@ void *alHeapDBAlloc(u8 *file, s32 line, ALHeap *hp, s32 num, s32 size) {
return ptr;
}
+1 -1
View File
@@ -5,4 +5,4 @@
u8 alSeqpGetChlFXMix(ALSeqPlayer *seqp, u8 chan) {
return seqp->chanState[chan].fxmix;
}
}
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -5,4 +5,4 @@
extern s16 D_800DCE40[16];
#endif
#endif
+1 -1
View File
@@ -5,4 +5,4 @@
extern s16 D_800DCE80[14];
#endif
#endif