mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 12:21:18 +00:00
Make a top-level make build everything in order
This commit is contained in:
parent
8bf4cd1908
commit
d9c2a54464
3 changed files with 22 additions and 58 deletions
4
Makefile
4
Makefile
|
@ -1,4 +1,4 @@
|
||||||
SUBFOLDERS := exosphere fusee/fusee-primary fusee/fusee-secondary stratosphere/libstratosphere thermosphere
|
SUBFOLDERS := exosphere fusee stratosphere thermosphere
|
||||||
|
|
||||||
TOPTARGETS := all clean
|
TOPTARGETS := all clean
|
||||||
|
|
||||||
|
@ -7,4 +7,6 @@ $(TOPTARGETS): $(SUBFOLDERS)
|
||||||
$(SUBFOLDERS):
|
$(SUBFOLDERS):
|
||||||
$(MAKE) -C $@ $(MAKECMDGOALS)
|
$(MAKE) -C $@ $(MAKECMDGOALS)
|
||||||
|
|
||||||
|
fusee: exosphere thermosphere stratosphere
|
||||||
|
|
||||||
.PHONY: $(TOPTARGETS) $(SUBFOLDERS)
|
.PHONY: $(TOPTARGETS) $(SUBFOLDERS)
|
||||||
|
|
|
@ -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)),)
|
TOPTARGETS := all clean
|
||||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(DEVKITARM)/base_tools
|
$(TOPTARGETS): $(SUBFOLDERS)
|
||||||
|
|
||||||
dir_source := src
|
$(SUBFOLDERS):
|
||||||
dir_out := out
|
$(MAKE) -C $@ $(MAKECMDGOALS)
|
||||||
dir_exosphere := ../exosphere
|
|
||||||
dir_loader := fusee-secondary
|
|
||||||
dir_stage1 := fusee-primary
|
|
||||||
|
|
||||||
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork
|
.PHONY: $(TOPTARGETS) $(SUBFOLDERS)
|
||||||
|
|
||||||
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"
|
|
||||||
|
|
||||||
|
|
13
stratosphere/Makefile
Normal file
13
stratosphere/Makefile
Normal file
|
@ -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)
|
Loading…
Reference in a new issue