40 lines
922 B
Makefile
40 lines
922 B
Makefile
|
|
CC=sdcc
|
|
CFLAGS=-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
|
|
all: main.8xk
|
|
|
|
clean:
|
|
@rm -f obj/* main.ihx main.bin main.8xk
|
|
|
|
try: main.8xk
|
|
@tilem2 --rom=ti83pv116.bin
|
|
|
|
%.rel: lib83/%.c
|
|
@echo "(lib) CC $<"
|
|
@$(CC) $(CFLAGS) $< -o obj/$@
|
|
|
|
%.rel: %.c
|
|
@echo "CC $<"
|
|
@$(CC) $(CFLAGS) $< -o obj/$@
|
|
|
|
obj/main.ihx: $(OBJS)
|
|
@echo "LD $@"
|
|
@cd obj && $(CC) -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 $@"
|
|
@rabbitsign -P -p -t 8xk -g $<
|
|
|