hekate/modules/hekate_libsys_minerva/Makefile

35 lines
944 B
Makefile
Raw Permalink Normal View History

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
BDKDIR := bdk
BDKINC := -I../../$(BDKDIR)
OBJS = $(addprefix $(BUILD)/,\
sys_sdrammtc.o \
)
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb-interwork
2022-10-11 04:25:21 +00:00
CFLAGS = $(ARCH) -O2 -nostdlib -fpie -ffunction-sections -fdata-sections -fomit-frame-pointer -std=gnu11 -Wall -Wsign-compare $(CUSTOMDEFINES)
LDFLAGS = $(ARCH) -fpie -pie -nostartfiles -lgcc
.PHONY: clean all
all: $(TARGET).bso
$(BUILD)/%.o: ./%.c
@mkdir -p "$(BUILD)"
@$(CC) $(CFLAGS) $(BDKINC) -c $< -o $@
$(TARGET).bso: $(OBJS)
@$(CC) $(LDFLAGS) -e _minerva_init $^ -o $(OUTPUT)/$(TARGET).bso
2020-07-17 22:36:16 +00:00
@$(STRIP) -g $(OUTPUT)/$(TARGET).bso
@echo -e "-------------\nBuilt module: "$(TARGET)".bso\n-------------"
clean:
@rm -rf $(OUTPUT)/$(TARGET).bso