mirror of
https://github.com/coderkei/akmenu-next.git
synced 2025-06-18 08:55:46 -04:00

* Fix DSI build. Now works correctly on DSi. * Fixed soft reset into boot.nds. Now works on both DSi and flashcarts. Also fixed for theme reset. * Fixed soft reset into GBA mode. Was using libnds's broken swi call. Replaced with modified version that isn't broken. * Fixed warnings generated during compile. * Removed old LD/Specs from arm7 folder. This is needed to allow proper arm7 entry point for TWL_FIRM compatiblity on 3DS. Didn't seem to break DS mode copy so a DSi specific build of arm7 make file is not needed at the moment. * custom banner added via banner.bin and -t ndstool command. * Flashcart build now uses -h 0x200 command for better compatiblity with older homebrew launchers/flashcarts.
123 lines
4.8 KiB
Makefile
123 lines
4.8 KiB
Makefile
#---------------------------------------------------------------------------------
|
|
.SUFFIXES:
|
|
#---------------------------------------------------------------------------------
|
|
ifeq ($(strip $(DEVKITARM)),)
|
|
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
endif
|
|
|
|
include $(DEVKITARM)/ds_rules
|
|
|
|
#---------------------------------------------------------------------------------
|
|
# BUILD is the directory where object files & intermediate files will be placed
|
|
# SOURCES is a list of directories containing source code
|
|
# INCLUDES is a list of directories containing extra header files
|
|
# DATA is a list of directories containing binary files
|
|
# all directories are relative to this makefile
|
|
#---------------------------------------------------------------------------------
|
|
BUILD := build
|
|
SOURCES := source
|
|
INCLUDES := include build ../share $(SOURCES)
|
|
DATA :=
|
|
|
|
#---------------------------------------------------------------------------------
|
|
# options for code generation
|
|
#---------------------------------------------------------------------------------
|
|
ARCH := -mthumb-interwork
|
|
|
|
CFLAGS := -g -Wall -O3\
|
|
$(ARCH) $(INCLUDE) -DARM7
|
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
|
ASFLAGS := -g $(ARCH)
|
|
LDFLAGS = -specs=ds_arm7.specs -g $(ARCH) -Wl,--nmagic -Wl,-Map,$(notdir $*).map
|
|
|
|
LIBS := -ldswifi7 -lmm7 -lnds7
|
|
|
|
#---------------------------------------------------------------------------------
|
|
# list of directories containing libraries, this must be the top level containing
|
|
# include and lib
|
|
#---------------------------------------------------------------------------------
|
|
LIBDIRS := $(LIBNDS)
|
|
|
|
#---------------------------------------------------------------------------------
|
|
# 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 ARM7ELF := $(CURDIR)/$(TARGET).elf
|
|
export DEPSDIR := $(CURDIR)/$(BUILD)
|
|
|
|
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))\
|
|
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
|
|
|
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
|
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
|
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
|
|
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
|
|
|
#---------------------------------------------------------------------------------
|
|
# use CXX for linking C++ projects, CC for standard C
|
|
#---------------------------------------------------------------------------------
|
|
ifeq ($(strip $(CPPFILES)),)
|
|
#---------------------------------------------------------------------------------
|
|
export LD := $(CC)
|
|
#---------------------------------------------------------------------------------
|
|
else
|
|
#---------------------------------------------------------------------------------
|
|
export LD := $(CXX)
|
|
#---------------------------------------------------------------------------------
|
|
endif
|
|
#---------------------------------------------------------------------------------
|
|
|
|
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
|
|
|
|
export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
|
|
|
|
export OFILES := $(OFILES_BIN) $(OFILES_SOURCES)
|
|
|
|
export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES)))
|
|
|
|
export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir))\
|
|
$(foreach dir,$(LIBDIRS),-I$(dir)/include)\
|
|
-I$(CURDIR)/$(BUILD)
|
|
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
|
|
|
|
.PHONY: $(BUILD) clean
|
|
|
|
#---------------------------------------------------------------------------------
|
|
$(BUILD):
|
|
@[ -d $@ ] || mkdir -p $@
|
|
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
|
|
|
#---------------------------------------------------------------------------------
|
|
clean:
|
|
@echo clean ...
|
|
@rm -fr $(BUILD) $(TARGET).elf
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
else
|
|
|
|
DEPENDS := $(OFILES:.o=.d)
|
|
|
|
#---------------------------------------------------------------------------------
|
|
# main targets
|
|
#---------------------------------------------------------------------------------
|
|
$(ARM7ELF) : $(OFILES)
|
|
@echo linking $(notdir $@)
|
|
@$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
%.bin.o %_bin.h : %.bin
|
|
#---------------------------------------------------------------------------------
|
|
@echo $(notdir $<)
|
|
@$(bin2o)
|
|
|
|
-include $(DEPENDS)
|
|
|
|
#---------------------------------------------------------------------------------------
|
|
endif
|
|
#---------------------------------------------------------------------------------------
|