Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple casio prizm makefile example
CC=sh3eb-elf-gcc
MKG3A=mkg3a
RM=rm
CFLAGS=-m4a-nofpu -mb -O2 -mhitachi -Wall -I../../include -lgcc -L../../lib -flto -fuse-linker-plugin
LDFLAGS=$(CFLAGS) -nostartfiles -T../../toolchain/prizm.x -Wl,-static -Wl,-gc-sections
CSOURCES=src/main.c
OBJECTS=$(CSOURCES:.c=.o)
PROJ_NAME=g3aNameWithoutExtension
BIN=$(PROJ_NAME).bin
ADDIN=$(PROJ_NAME).g3a
all: $(ADDIN)
$(ADDIN): $(BIN)
$(MKG3A) -n :"Program name" -i uns:unselected.png -i sel:selected.png $< $@
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
$(BIN): $(OBJECTS)
$(CC) $(OBJECTS) $(LDFLAGS) -o $@
clean:
$(RM) -f $(OBJECTS) $(BIN) $(ADDIN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment