From 54c7a2f8fe81b8a23c83c0b696081131017c3492 Mon Sep 17 00:00:00 2001 From: jaby Date: Fri, 25 Aug 2023 15:31:06 +0200 Subject: [PATCH] Improve rebuild behaviour --- examples/PoolBox/Makefile | 5 +---- lib/ISOTarget.mk | 2 +- lib/Makefile | 2 -- lib/PSEXETarget.mk | 6 +++++- lib/RebuildTarget.mk | 4 +--- template/JabyEngine-PSX_Game/Makefile | 5 +---- 6 files changed, 9 insertions(+), 15 deletions(-) diff --git a/examples/PoolBox/Makefile b/examples/PoolBox/Makefile index f379550a..6061d128 100644 --- a/examples/PoolBox/Makefile +++ b/examples/PoolBox/Makefile @@ -3,10 +3,7 @@ make_assets = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C assets make_application = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C application make_cd = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -f $(JABY_ENGINE_DIR)/lib/ISOTarget.mk -C iso -all clean rebuild: always - $(call make_assets,$(MAKECMDGOALS)) - $(call make_application,$(MAKECMDGOALS)) - $(call make_cd,$(MAKECMDGOALS)) +all clean rebuild: |assets_$(MAKECMDGOALS) application_$(MAKECMDGOALS) cd_$(MAKECMDGOALS) all_%: always $(call make_assets,$*) diff --git a/lib/ISOTarget.mk b/lib/ISOTarget.mk index f37fe9f0..1fa1a984 100644 --- a/lib/ISOTarget.mk +++ b/lib/ISOTarget.mk @@ -6,7 +6,7 @@ $(CD_OUTPUT): always all: $(CD_OUTPUT) -clean: +clean: rm -fr *.bin rm -fr *.cue rm -fr *.lba diff --git a/lib/Makefile b/lib/Makefile index f59f3bd0..4b9d388f 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -87,7 +87,5 @@ $(OUTPUT_DIR)/%.o: $$(subst !super,..,%.s) @mkdir -p $(dir $@) $(CC) $(ARCHFLAGS) -I$(PCSX_REDUX) -g -c -o $@ $< -include $(SELF_DIR)RebuildTarget.mk - #Inclusion of dependencies (object files to source and includes) -include $(OBJS:%.o=%.d) \ No newline at end of file diff --git a/lib/PSEXETarget.mk b/lib/PSEXETarget.mk index 6776709d..6f16adbd 100644 --- a/lib/PSEXETarget.mk +++ b/lib/PSEXETarget.mk @@ -30,4 +30,8 @@ $(AUTO_OVERLAY_DIR)/Overlays.mk: $(OVERLAY_CONFIG) all: $(TARGET).psexe $(OVERLAY_TARGET) clean: - rm -fr $(OUTPUT_DIR) \ No newline at end of file + rm -fr $(OUTPUT_DIR) + +# For mkoverlay to function correctly this is required (otherwise Overlays.mk is not re-generated) +rebuild: clean + $(MAKE) all diff --git a/lib/RebuildTarget.mk b/lib/RebuildTarget.mk index c180f356..59c7d2a0 100644 --- a/lib/RebuildTarget.mk +++ b/lib/RebuildTarget.mk @@ -1,3 +1 @@ -rebuild: - $(MAKE) clean - $(MAKE) all \ No newline at end of file +rebuild: |clean all \ No newline at end of file diff --git a/template/JabyEngine-PSX_Game/Makefile b/template/JabyEngine-PSX_Game/Makefile index 6acbd708..66b3d67a 100644 --- a/template/JabyEngine-PSX_Game/Makefile +++ b/template/JabyEngine-PSX_Game/Makefile @@ -3,10 +3,7 @@ make_assets = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C assets make_application = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C application make_cd = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -f $(JABY_ENGINE_DIR)/lib/ISOTarget.mk -C iso -all clean rebuild: always - $(call make_assets,$(MAKECMDGOALS)) - $(call make_application,$(MAKECMDGOALS)) - $(call make_cd,$(MAKECMDGOALS)) +all clean rebuild: |assets_$(MAKECMDGOALS) application_$(MAKECMDGOALS) cd_$(MAKECMDGOALS) all_%: always $(call make_assets,$*)