Skip to content

Instantly share code, notes, and snippets.

@ComputerNerd
Created November 18, 2014 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ComputerNerd/4df44359dcf85d1a2320 to your computer and use it in GitHub Desktop.
Save ComputerNerd/4df44359dcf85d1a2320 to your computer and use it in GitHub Desktop.
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