1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-11-26 03:32:17 +00:00
hekate/modules/hekate_libsys_lp0/Makefile

35 lines
916 B
Makefile
Raw Normal View History

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
BDKDIR := bdk
BDKINC := -I../../$(BDKDIR)
2018-08-21 02:14:31 +01:00
OBJS = $(addprefix $(BUILD)/,\
sys_sdramlp0.o \
)
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb-interwork
2020-06-13 16:40:09 +01:00
CFLAGS = $(ARCH) -O2 -nostdlib -fpie -ffunction-sections -fdata-sections -fomit-frame-pointer -std=gnu11 -Wall $(CUSTOMDEFINES)
2018-08-21 02:14:31 +01:00
LDFLAGS = $(ARCH) -fpie -pie -nostartfiles -lgcc
.PHONY: clean all
all: $(TARGET).bso
$(BUILD)/%.o: ./%.c
@mkdir -p "$(BUILD)"
@$(CC) $(CFLAGS) $(BDKINC) -c $< -o $@
2018-08-21 02:14:31 +01:00
$(TARGET).bso: $(OBJS)
@$(CC) $(LDFLAGS) -e _modInit $^ -o $(OUTPUT)/$(TARGET).bso
2020-07-17 23:36:16 +01:00
@$(STRIP) -g $(OUTPUT)/$(TARGET).bso
@echo "-------------\nBuilt module: "$(TARGET)".bso\n-------------"
2018-08-21 02:14:31 +01:00
clean:
@rm -rf $(OUTPUT)/$(TARGET).bso