libMicrofx/microfx_src/Makefile

42 lines
783 B
Makefile
Raw Normal View History

2023-01-14 12:14:19 +01:00
CC = sh-elf-gcc
AR = sh-elf-ar
OUT = libMicrofx.a
OUT_DIR = lib
2023-04-17 09:55:52 +02:00
SRC = src/start.c \
src/syscall.S \
src/display.c \
src/keyboard.c \
src/misc.c \
src/time.c \
src/gui.c \
src/memory.c \
2023-04-20 18:52:58 +02:00
src/rtc.c \
src/ext/img.c \
src/ext/gametools/map.c \
src/ext/gametools/collisions.c
2023-01-14 12:14:19 +01:00
OBJ = $(SRC:src/%=build/%.o)
2023-02-03 19:47:07 +01:00
CFLAGS = -Os -Wall -Wextra -Wpedantic -Werror -std=c89
2023-01-14 12:14:19 +01:00
BUILD = build
all: $(OBJ) | $(OUT_DIR)/
2023-04-17 09:55:52 +02:00
$(AR) rsv $(OUT_DIR)/$(OUT) $(addprefix build/, $(notdir $(OBJ)))
2023-01-14 12:14:19 +01:00
cp --recursive include $(OUT_DIR)/
cp src/fx98xx.ld $(OUT_DIR)/
rm -fr $(BUILD)
2023-01-14 12:14:19 +01:00
$(BUILD)/%.o: src/% | $(BUILD)/
2023-04-17 09:55:52 +02:00
$(CC) -c $< -o build/$(notdir $@) $(CFLAGS)
2023-01-14 12:14:19 +01:00
.PRECIOUS: %/
%/:
@ mkdir -p $@
clean: $(BUILD)/ | $(OUT_DIR)/
rm $(OUT_DIR) --recursive
rm $(BUILD) --recursive