From ddf9d36863c8696f105ad79956bd96a56b8560f3 Mon Sep 17 00:00:00 2001 From: Ryan Myers Date: Thu, 21 Oct 2021 11:47:22 -0400 Subject: [PATCH] Added coloring to the Makefile throughout most of it's build. --- Makefile | 137 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 83 insertions(+), 54 deletions(-) diff --git a/Makefile b/Makefile index f0a2382a..66be6dc6 100755 --- a/Makefile +++ b/Makefile @@ -348,7 +348,8 @@ else endif $(BUILD_DIR): - mkdir -p $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(LIB_DIRS) $(ASM_DIRS) $(SRC_DIRS) $(ASSETS_DIRS)) + @$(PRINT) "$(GREEN)Making Build Directory: $(BLUE)$@ $(NO_COL)\n" + $(V)mkdir -p $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(LIB_DIRS) $(ASM_DIRS) $(SRC_DIRS) $(ASSETS_DIRS)) # Helps fix an issue with parallel jobs. $(ALL_ASSETS_BUILT): | $(BUILD_DIR) @@ -360,82 +361,106 @@ dont_remove_asset_files: $(ALL_ASSETS_BUILT) # All assets should output a .bin file -$(AUDIO_OUT_DIR)/%.bin: $(AUDIO_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(AUDIO_OUT_DIR)/%.bin: $(AUDIO_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(BIN_OUT_DIR)/%.bin: $(BIN_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(BIN_OUT_DIR)/%.bin: $(BIN_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(FONTS_OUT_DIR)/%.bin: $(FONTS_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(FONTS_OUT_DIR)/%.bin: $(FONTS_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(IDS_OUT_DIR)/%.bin: $(IDS_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(IDS_OUT_DIR)/%.bin: $(IDS_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(LEVEL_HEADERS_OUT_DIR)/%.bin: $(LEVEL_HEADERS_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(LEVEL_HEADERS_OUT_DIR)/%.bin: $(LEVEL_HEADERS_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(LEVEL_MODELS_OUT_DIR)/%.bin: $(LEVEL_MODELS_IN_DIR)/%.cbin - $(COMPRESS) $^ $@ +$(LEVEL_MODELS_OUT_DIR)/%.bin: $(LEVEL_MODELS_IN_DIR)/%.cbin + $(call print,Compressing:,$<,$@) + $(V)$(COMPRESS) $^ $@ -$(LEVEL_NAMES_OUT_DIR)/%.bin: $(LEVEL_NAMES_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(LEVEL_NAMES_OUT_DIR)/%.bin: $(LEVEL_NAMES_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(LEVEL_OBJMAPS_OUT_DIR)/%.bin: $(LEVEL_OBJMAPS_IN_DIR)/%.cbin - $(COMPRESS) $^ $@ +$(LEVEL_OBJMAPS_OUT_DIR)/%.bin: $(LEVEL_OBJMAPS_IN_DIR)/%.cbin + $(call print,Compressing:,$<,$@) + $(V)$(COMPRESS) $^ $@ -$(MISC_OUT_DIR)/%.bin: $(MISC_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(MISC_OUT_DIR)/%.bin: $(MISC_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(OBJECTS_OUT_DIR)/%.bin: $(OBJECTS_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(OBJECTS_OUT_DIR)/%.bin: $(OBJECTS_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(OBJECT_ANIMS_OUT_DIR)/%.bin: $(OBJECT_ANIMS_IN_DIR)/%.cbin - $(COMPRESS) $^ $@ +$(OBJECT_ANIMS_OUT_DIR)/%.bin: $(OBJECT_ANIMS_IN_DIR)/%.cbin + $(call print,Compressing:,$<,$@) + $(V)$(COMPRESS) $^ $@ -$(OBJECT_HEADERS_OUT_DIR)/%.bin: $(OBJECT_HEADERS_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(OBJECT_HEADERS_OUT_DIR)/%.bin: $(OBJECT_HEADERS_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(OBJECT_MODELS_OUT_DIR)/%.bin: $(OBJECT_MODELS_IN_DIR)/%.cbin - $(COMPRESS) $^ $@ +$(OBJECT_MODELS_OUT_DIR)/%.bin: $(OBJECT_MODELS_IN_DIR)/%.cbin + $(call print,Compressing:,$<,$@) + $(V)$(COMPRESS) $^ $@ -$(PART_BEHAVIORS_OUT_DIR)/%.bin: $(PART_BEHAVIORS_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(PART_BEHAVIORS_OUT_DIR)/%.bin: $(PART_BEHAVIORS_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(PART_PARTICLES_OUT_DIR)/%.bin: $(PART_PARTICLES_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(PART_PARTICLES_OUT_DIR)/%.bin: $(PART_PARTICLES_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(SPRITES_OUT_DIR)/%.bin: $(SPRITES_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(SPRITES_OUT_DIR)/%.bin: $(SPRITES_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(TEXT_GAME_OUT_DIR)/%.bin: $(TEXT_GAME_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(TEXT_GAME_OUT_DIR)/%.bin: $(TEXT_GAME_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(TEXT_MENU_OUT_DIR)/%.bin: $(TEXT_MENU_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(TEXT_MENU_OUT_DIR)/%.bin: $(TEXT_MENU_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ $(TEXTURES_2D_OUT_DIR)/%.bin: $(TEXTURES_2D_IN_DIR)/%.png - $(TEXBUILDER) $^ $@ + $(call print,Building Texture:,$<,$@) + $(V)$(TEXBUILDER) $^ $@ $(TEXTURES_3D_OUT_DIR)/%.bin: $(TEXTURES_3D_IN_DIR)/%.png - $(TEXBUILDER) $^ $@ + $(call print,Building Texture:,$<,$@) + $(V)$(TEXBUILDER) $^ $@ -$(TEXT_MENU_OUT_DIR)/%.bin: $(TEXT_MENU_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(TEXT_MENU_OUT_DIR)/%.bin: $(TEXT_MENU_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(TT_GHOSTS_OUT_DIR)/%.bin: $(TT_GHOSTS_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(TT_GHOSTS_OUT_DIR)/%.bin: $(TT_GHOSTS_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(UNKNOWN_0_OUT_DIR)/%.bin: $(UNKNOWN_0_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(UNKNOWN_0_OUT_DIR)/%.bin: $(UNKNOWN_0_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ -$(UCODE_OUT_DIR)/%.bin: $(UCODE_IN_DIR)/%.bin - $(ASSETS_COPY) $^ $@ +$(UCODE_OUT_DIR)/%.bin: $(UCODE_IN_DIR)/%.bin + $(call print,Copying:,$<,$@) + $(V)$(ASSETS_COPY) $^ $@ ############################### $(BUILD_DIR)/%.o: %.s | $(ALL_ASSETS_BUILT) - $(call print,Compiling:,$<,$@) + $(call print,Assembling:,$<,$@) $(V)$(AS) $(ASFLAGS) -o $@ $< $(BUILD_DIR)/%.o: %.c | $(ALL_ASSETS_BUILT) @@ -443,18 +468,22 @@ $(BUILD_DIR)/%.o: %.c | $(ALL_ASSETS_BUILT) $(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 $@ $< + $(call print,Preprocessing linker script:,$<,$@) + $(V)$(CPP) $(VERSION_CFLAGS) -DBUILD_DIR=$(BUILD_DIR) -MMD -MP -MT $@ -MF $@.d -o $@ $< $(BUILD_DIR)/$(TARGET).elf: $(O_FILES) $(BUILD_DIR)/$(LD_SCRIPT) | $(ALL_ASSETS_BUILT) - $(LD) $(LDFLAGS) -o $@ $(O_FILES) $(LIBS) + @$(PRINT) "$(GREEN)Linking ELF file: $(BLUE)$@ $(NO_COL)\n" + $(V)$(LD) $(LDFLAGS) -o $@ $(O_FILES) $(LIBS) $(BUILD_DIR)/$(TARGET).bin: $(BUILD_DIR)/$(TARGET).elf | $(ALL_ASSETS_BUILT) - $(OBJCOPY) $< $@ -O binary + $(call print,Making .bin:,$<,$@) + $(V)$(OBJCOPY) $< $@ -O binary $(BUILD_DIR)/$(TARGET).z64: $(BUILD_DIR)/$(TARGET).bin | $(ALL_ASSETS_BUILT) - cp $< $@ - $(FIXCHECKSUMS) - $(N64CRC) $@ + $(call print,Making final z64 ROM:,$<,$@) + $(V)cp $< $@ + $(V)$(FIXCHECKSUMS) + $(V)$(N64CRC) $@ ifeq ($(NON_MATCHING),0) sha1sum -c sha1/dkr.$(VERSION).sha1 else