Copy3DEngine/Makefile
2024-03-11 22:38:03 +01:00

38 lines
1.1 KiB
Makefile

CC=sh-elf-gcc
CFLAGS= -I/home/fr/.local/include -ffreestanding -flto -nostdlib -Og -Wall -Wextra -Xlinker
NAME=
FILENAME="omega"
OBJCOPY = sh-elf-objcopy
SRC_DIR=src
CONV_DIR=oconv
BUILD_DIR=build
SRC := $(wildcard $(SRC_DIR)/*.c $(SRC_DIR)/*.s)
SRC += $(wildcard $(SRC_DIR)/*/*.c $(SRC_DIR)/*/*.s)
all: mkdir convert compile clean
no_clean : mkdir convert compile
mkdir:
mkdir -p build
convert:
#cd oconv && python3 convert.py ../assets-cg/
#cd ..
compile: $(FILENAME).g3a
$(FILENAME).g3a : $(BUILD_DIR)/$(FILENAME).bin
mkg3a -n "basic:$(NAME)" -i uns:assets-cg/uns-icon.bmp -i sel:assets-cg/sel-icon.bmp $(BUILD_DIR)/$(FILENAME).bin $(FILENAME).g3a
$(BUILD_DIR)/$(FILENAME).bin : $(BUILD_DIR)/$(FILENAME).elf
$(OBJCOPY) -O binary $(BUILD_DIR)/$(FILENAME).elf $(BUILD_DIR)/$(FILENAME).bin
$(BUILD_DIR)/$(FILENAME).elf: $(SRC)
sh-elf-gcc $(CFLAGS) -T linker.ld -o $(BUILD_DIR)/$(FILENAME).elf $(SRC) /home/fr/.local/lib/omega.a /home/fr/.local/share/giteapc/Lephenixnoir/OpenLibm/libopenlibm.a $(wildcard $(CONV_DIR)/*.S) -lgcc -lm
clean:
#rm -rf build
#rm -f oconv/*.S
.PHONY: all clean