2021-05-26 01:53:11 +02:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
.SUFFIXES:
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
ifeq ($(strip $(DEVKITARM)),)
|
|
|
|
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
|
|
endif
|
|
|
|
|
2023-07-23 01:55:05 +02:00
|
|
|
include $(DEVKITARM)/base_rules
|
|
|
|
|
|
|
|
GCC_VERSION := $(shell $(CC) -dumpversion)
|
2021-05-26 01:53:11 +02:00
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# TARGET is the name of the output
|
|
|
|
# BUILD is the directory where object files & intermediate files will be placed
|
|
|
|
# SOURCES is a list of directories containing source code
|
|
|
|
# DATA is a list of directories containing data files
|
|
|
|
# INCLUDES is a list of directories containing header files
|
|
|
|
# SPECS is the directory containing the important build and link files
|
|
|
|
#---------------------------------------------------------------------------------
|
2023-10-30 16:42:59 +01:00
|
|
|
export TARGET := minute_minute
|
2021-05-26 01:53:11 +02:00
|
|
|
export BUILD ?= build
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# no real need to edit anything past this point unless you need to add additional
|
|
|
|
# rules for different file extensions
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export ROOTDIR := $(CURDIR)
|
|
|
|
export OUTPUT := $(CURDIR)/$(TARGET)
|
|
|
|
|
|
|
|
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
|
|
|
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
|
|
|
|
|
|
|
export DEPSDIR := $(CURDIR)/$(BUILD)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: $(BUILD) clean all
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
all: $(BUILD)
|
|
|
|
|
|
|
|
$(BUILD):
|
|
|
|
@[ -d $@ ] || mkdir -p $@
|
|
|
|
@$(MAKE) -C $(BUILD) -f $(CURDIR)/Makefile
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
clean:
|
|
|
|
@echo clean ...
|
2023-10-30 16:42:59 +01:00
|
|
|
@$(MAKE) -C $(ROOTDIR)/$(TARGET) -f Makefile.isfshax clean
|
2021-05-26 01:53:11 +02:00
|
|
|
@$(MAKE) -C $(ROOTDIR)/stage2ldr clean
|
|
|
|
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT)-strip.elf $(OUTPUT).bin
|
|
|
|
@rm -fr $(ROOTDIR)/superblock.img $(ROOTDIR)/superblock.img.sha
|
|
|
|
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
else
|
|
|
|
|
|
|
|
DEPENDS := $(OFILES:.o=.d)
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
# main targets
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
ELFLOADER = $(ROOTDIR)/stage2ldr/stage2ldr.bin
|
2023-10-30 16:42:59 +01:00
|
|
|
BOOT1 = $(ROOTDIR)/$(TARGET)/isfshax_stage2-strip.elf
|
2021-05-26 01:53:11 +02:00
|
|
|
|
|
|
|
$(ROOTDIR)/superblock.img: $(OUTPUT).bin
|
|
|
|
@echo $(notdir $@)
|
|
|
|
@python3 $(ROOTDIR)/isfshax.py $< $@
|
|
|
|
|
2023-10-30 16:42:59 +01:00
|
|
|
$(OUTPUT).bin: $(BOOT1) $(ELFLOADER)
|
2021-05-26 01:53:11 +02:00
|
|
|
@echo $(notdir $@)
|
|
|
|
@cat $(ELFLOADER) $< > $@
|
|
|
|
|
|
|
|
$(ELFLOADER):
|
|
|
|
@$(MAKE) -C $(ROOTDIR)/stage2ldr
|
|
|
|
|
2023-10-30 16:42:59 +01:00
|
|
|
$(BOOT1):
|
|
|
|
@$(MAKE) -C $(ROOTDIR)/$(TARGET) -f Makefile.isfshax
|
|
|
|
|
2021-05-26 01:53:11 +02:00
|
|
|
|
|
|
|
-include $(DEPENDS)
|
|
|
|
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------
|
|
|
|
endif
|
|
|
|
#---------------------------------------------------------------------------------------
|