From d9c2a544646dc731656e64b13cf1becdc4012970 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Tue, 15 May 2018 01:30:56 +0200 Subject: [PATCH] Make a top-level make build everything in order --- Makefile | 4 ++- fusee/Makefile | 63 +++++-------------------------------------- stratosphere/Makefile | 13 +++++++++ 3 files changed, 22 insertions(+), 58 deletions(-) create mode 100644 stratosphere/Makefile diff --git a/Makefile b/Makefile index 54ea31ca7..2441b5310 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUBFOLDERS := exosphere fusee/fusee-primary fusee/fusee-secondary stratosphere/libstratosphere thermosphere +SUBFOLDERS := exosphere fusee stratosphere thermosphere TOPTARGETS := all clean @@ -7,4 +7,6 @@ $(TOPTARGETS): $(SUBFOLDERS) $(SUBFOLDERS): $(MAKE) -C $@ $(MAKECMDGOALS) +fusee: exosphere thermosphere stratosphere + .PHONY: $(TOPTARGETS) $(SUBFOLDERS) diff --git a/fusee/Makefile b/fusee/Makefile index bed30fac9..7a8542b38 100644 --- a/fusee/Makefile +++ b/fusee/Makefile @@ -1,61 +1,10 @@ -rwildcard = $(foreach d, $(wildcard $1*), $(filter $(subst *, %, $2), $d) $(call rwildcard, $d/, $2)) +SUBFOLDERS := fusee-primary fusee-secondary -ifeq ($(strip $(DEVKITARM)),) -$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM") -endif +TOPTARGETS := all clean -include $(DEVKITARM)/base_tools +$(TOPTARGETS): $(SUBFOLDERS) -dir_source := src -dir_out := out -dir_exosphere := ../exosphere -dir_loader := fusee-secondary -dir_stage1 := fusee-primary +$(SUBFOLDERS): + $(MAKE) -C $@ $(MAKECMDGOALS) -ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork - -ASFLAGS := -g $(ARCH) - -# For debug builds, replace -O2 by -Og and comment -fomit-frame-pointer out -CFLAGS = \ - $(ARCH) \ - -g \ - -O2 \ - -fomit-frame-pointer \ - -ffunction-sections \ - -fdata-sections \ - -std=gnu11 \ - -Werror \ - -Wall - -LDFLAGS = -specs=linker.specs -g $(ARCH) - -.PHONY: all -all: $(dir_out) - -.PHONY: clean -clean: - @$(MAKE) -C $(dir_exosphere) clean - @$(MAKE) -C $(dir_loader) clean - @$(MAKE) -C $(dir_stage1) clean - @rm -rf $(dir_out) - -.PHONY: $(dir_exosphere) $(dir_loader) $(dir_stage1) - -$(dir_out): $(dir_loader) $(dir_stage1) - @mkdir -p "$(dir_out)" - @$(MAKE) -C $(dir_exosphere) - -$(dir_exosphere)/out/exosphere.bin: $(dir_exosphere) - @$(MAKE) -C $< - -$(dir_loader): - @mkdir -p "$(dir_out)" - @$(MAKE) -C $(dir_loader) - @cp "$(dir_loader)/out/$(dir_loader).bin" "out/$(dir_loader).bin" - -$(dir_stage1): - @mkdir -p "$(dir_out)" - @$(MAKE) -C $(dir_stage1) - @cp "$(dir_stage1)/out/$(dir_stage1).bin" "out/$(dir_stage1).bin" - \ No newline at end of file +.PHONY: $(TOPTARGETS) $(SUBFOLDERS) diff --git a/stratosphere/Makefile b/stratosphere/Makefile new file mode 100644 index 000000000..5eadb0bdf --- /dev/null +++ b/stratosphere/Makefile @@ -0,0 +1,13 @@ +KIPS := boot boot2 loader pm sm +SUBFOLDERS := libstratosphere $(KIPS) + +TOPTARGETS := all clean + +$(TOPTARGETS): $(SUBFOLDERS) + +$(SUBFOLDERS): + $(MAKE) -C $@ $(MAKECMDGOALS) + +$(KIPS): libstratosphere + +.PHONY: $(TOPTARGETS) $(SUBFOLDERS)