2018-11-04 01:15:32 +00:00
|
|
|
ifeq ($(strip $(DEVKITARM)),)
|
|
|
|
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(DEVKITARM)/base_rules
|
|
|
|
|
|
|
|
TARGET := libsys_minerva
|
|
|
|
BUILD := ../../build/$(TARGET)
|
|
|
|
OUTPUT := ../../output
|
2020-06-14 14:45:45 +01:00
|
|
|
BDKDIR := bdk
|
|
|
|
BDKINC := -I../../$(BDKDIR)
|
2018-11-04 01:15:32 +00:00
|
|
|
|
|
|
|
OBJS = $(addprefix $(BUILD)/,\
|
|
|
|
sys_sdrammtc.o \
|
|
|
|
)
|
|
|
|
|
|
|
|
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb-interwork
|
2022-10-11 05:25:21 +01:00
|
|
|
CFLAGS = $(ARCH) -O2 -nostdlib -fpie -ffunction-sections -fdata-sections -fomit-frame-pointer -std=gnu11 -Wall -Wsign-compare $(CUSTOMDEFINES)
|
2018-11-04 01:15:32 +00:00
|
|
|
LDFLAGS = $(ARCH) -fpie -pie -nostartfiles -lgcc
|
|
|
|
|
|
|
|
.PHONY: clean all
|
|
|
|
|
|
|
|
all: $(TARGET).bso
|
|
|
|
$(BUILD)/%.o: ./%.c
|
|
|
|
@mkdir -p "$(BUILD)"
|
2020-06-14 14:45:45 +01:00
|
|
|
@$(CC) $(CFLAGS) $(BDKINC) -c $< -o $@
|
2019-10-18 16:02:06 +01:00
|
|
|
|
2018-11-04 01:15:32 +00:00
|
|
|
$(TARGET).bso: $(OBJS)
|
2020-06-13 16:39:17 +01:00
|
|
|
@$(CC) $(LDFLAGS) -e _minerva_init $^ -o $(OUTPUT)/$(TARGET).bso
|
2020-07-17 23:36:16 +01:00
|
|
|
@$(STRIP) -g $(OUTPUT)/$(TARGET).bso
|
2024-06-11 07:04:21 +01:00
|
|
|
@echo -e "-------------\nBuilt module: "$(TARGET)".bso\n-------------"
|
2018-11-04 01:15:32 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -rf $(OUTPUT)/$(TARGET).bso
|