2018-08-21 02:14:31 +01:00
|
|
|
ifeq ($(strip $(DEVKITARM)),)
|
|
|
|
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(DEVKITARM)/base_rules
|
|
|
|
|
|
|
|
TARGET := libsys_lp0
|
|
|
|
BUILD := ../../build/$(TARGET)
|
|
|
|
OUTPUT := ../../output
|
|
|
|
|
|
|
|
OBJS = $(addprefix $(BUILD)/,\
|
|
|
|
sys_sdramlp0.o \
|
|
|
|
)
|
|
|
|
|
|
|
|
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb-interwork
|
|
|
|
CFLAGS = $(ARCH) -O2 -nostdlib -fpie -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -std=gnu11 -Wall $(CUSTOMDEFINES)
|
|
|
|
LDFLAGS = $(ARCH) -fpie -pie -nostartfiles -lgcc
|
|
|
|
|
|
|
|
.PHONY: clean all
|
|
|
|
|
|
|
|
all: $(TARGET).bso
|
|
|
|
$(BUILD)/%.o: ./%.c
|
|
|
|
@mkdir -p "$(BUILD)"
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2019-10-18 16:02:06 +01:00
|
|
|
|
2018-08-21 02:14:31 +01:00
|
|
|
$(TARGET).bso: $(OBJS)
|
|
|
|
$(CC) $(LDFLAGS) -e _modInit $^ -o $(OUTPUT)/$(TARGET).bso
|
|
|
|
$(STRIP) -g $(OUTPUT)/$(TARGET).bso
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -rf $(OUTPUT)/$(TARGET).bso
|