2019-09-09 01:26:46 +00:00
|
|
|
TOOLCHAIN := $(DEVKITARM)
|
|
|
|
COMPARE ?= 0
|
|
|
|
|
2020-12-17 01:31:56 +00:00
|
|
|
# don't use dkP's base_tools anymore
|
|
|
|
# because the redefinition of $(CC) conflicts
|
|
|
|
# with when we want to use $(CC) to preprocess files
|
|
|
|
# thus, manually create the variables for the bin
|
|
|
|
# files, or use arm-none-eabi binaries on the system
|
|
|
|
# if dkP is not installed on tihs system
|
2020-12-17 01:31:10 +00:00
|
|
|
|
2020-12-17 01:31:56 +00:00
|
|
|
ifneq (,$(TOOLCHAIN))
|
|
|
|
ifneq ($(wildcard $(TOOLCHAIN)/bin),)
|
|
|
|
export PATH := $(TOOLCHAIN)/bin:$(PATH)
|
|
|
|
endif
|
2020-12-17 00:54:12 +00:00
|
|
|
endif
|
2020-11-25 15:37:50 +00:00
|
|
|
|
|
|
|
PREFIX := arm-none-eabi-
|
|
|
|
OBJCOPY := $(PREFIX)objcopy
|
2020-12-17 01:31:56 +00:00
|
|
|
AS := $(PREFIX)as
|
|
|
|
CPP := $(CC) -E
|
|
|
|
LD := $(PREFIX)ld
|
|
|
|
|
|
|
|
# note: the makefile must be set up so MODERNCC is never called
|
|
|
|
# if MODERN=0
|
|
|
|
MODERNCC := $(PREFIX)gcc
|
2020-11-25 15:37:50 +00:00
|
|
|
|
2019-09-09 01:26:46 +00:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
EXE := .exe
|
|
|
|
else
|
|
|
|
EXE :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
ASFLAGS := -mcpu=arm7tdmi
|
|
|
|
ARFLAGS := rc
|
|
|
|
|
|
|
|
SYSCALLS := IntrWait \
|
|
|
|
RegisterRamReset \
|
|
|
|
Sqrt \
|
|
|
|
MusicPlayerOpen \
|
|
|
|
SoundBiasReset \
|
|
|
|
SoundDriverVSyncOn \
|
|
|
|
Mod \
|
|
|
|
VBlankIntrWait \
|
|
|
|
MusicPlayerStart \
|
|
|
|
SoundDriverVSyncOff \
|
|
|
|
HuffUnComp \
|
|
|
|
SoftResetExram \
|
|
|
|
MusicPlayerFadeOut \
|
|
|
|
LZ77UnCompWram \
|
|
|
|
SoundDriverMain \
|
|
|
|
SoundBiasChange \
|
|
|
|
LZ77UnCompVram \
|
|
|
|
ArcTan2 \
|
|
|
|
MusicPlayerStop \
|
|
|
|
DivArm \
|
|
|
|
ModArm \
|
|
|
|
SoundDriverVSync \
|
|
|
|
SoundDriverInit \
|
|
|
|
BgAffineSet \
|
|
|
|
Diff8bitUnFilterWram \
|
|
|
|
MultiBoot \
|
|
|
|
MidiKey2Freq \
|
|
|
|
Div \
|
|
|
|
Diff8bitUnFilterVram \
|
|
|
|
ArcTan \
|
|
|
|
ObjAffineSet \
|
|
|
|
SoftResetRom \
|
|
|
|
SoundDriverMode \
|
|
|
|
RLUnCompWram \
|
|
|
|
BitUnPack \
|
|
|
|
SoundChannelClear \
|
|
|
|
CpuFastSet \
|
|
|
|
CpuSet \
|
|
|
|
Diff16bitUnFilter \
|
|
|
|
SoundBiasSet \
|
|
|
|
MusicPlayerContinue \
|
|
|
|
SoftReset \
|
|
|
|
RLUnCompVram
|
|
|
|
|
|
|
|
ASM_SRCS := libagbsyscall.s
|
|
|
|
ASM_OBJS := $(foreach syscall, $(SYSCALLS), $(syscall).o)
|
|
|
|
|
|
|
|
LIB := libagbsyscall.a
|
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|
|
|
|
all: $(LIB)
|
|
|
|
@:
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(LIB) $(ASM_OBJS)
|
|
|
|
|
|
|
|
$(LIB): $(ASM_OBJS)
|
|
|
|
$(AR) $(ARFLAGS) $@ $^
|
|
|
|
|
|
|
|
$(ASM_OBJS): libagbsyscall.s
|
|
|
|
$(AS) $(ASFLAGS) --defsym L_$(*F)=1 -o $@ $<
|