1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-12-23 00:22:01 +00:00
hekate/modules/simple_sample/Makefile

34 lines
876 B
Makefile
Raw Normal View History

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