ti83-sdk/Makefile

44 lines
1.0 KiB
Makefile

SDCC=sdcc
SDCCFLAGS=-Ilib83 -c -mz80 --std-sdcc2x --no-std-crt0 --reserve-regs-iy --opt-code-size
OBJS=_crt0.rel clrscr.rel putchar.rel puts.rel exit.rel gotoxy.rel __assert_fail.rel \
getchar.rel put_int.rel ctype.rel memcpy.rel memset.rel memmove.rel memcmp.rel \
strcpy.rel strlen.rel strncpy.rel \
main.rel
.PHONY: all clean try init
all: main.8xk
init:
@echo "Compiling rabbitsign..."
@$(CC) tool/rabbitsign-src/*.c -o tool/rabbitsign -O2 -g -w -DPROTOTYPES
clean:
@rm -f obj/* main.ihx main.bin main.8xk
try: main.8xk
@tilem2 --rom=ti83pv116.bin
%.rel: lib83/%.c
@echo "(lib) SDCC $<"
@$(SDCC) $(SDCCFLAGS) $< -o obj/$@
%.rel: %.c
@echo "SDCC $<"
@$(SDCC) $(SDCCFLAGS) $< -o obj/$@
obj/main.ihx: $(OBJS)
@echo "SDCCLD $@"
@cd obj && $(SDCC) -mz80 --no-std-crt0 --code-loc 0x4000 --code-size 0x4000 --xram-loc 0x9D95 --xram-size 0x6060 $^ -o ../$@ && cd ..
main.bin: obj/main.ihx
@echo "IHX->BIN $@"
@objcopy -Iihex -Obinary $< $@
@echo `stat -c %s $@` bytes
main.8xk: main.bin
@echo "SIGN $@"
@tool/rabbitsign -P -p -t 8xk -g $<