2023-10-07 23:32:30 +00:00
|
|
|
|
|
|
|
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 \
|
2023-10-08 12:58:45 +00:00
|
|
|
getchar.rel put_int.rel ctype.rel memcpy.rel memset.rel memmove.rel memcmp.rel \
|
2023-10-07 23:32:30 +00:00
|
|
|
main.rel
|
|
|
|
|
|
|
|
.PHONY: all clean try
|
|
|
|
all: main.8xk
|
|
|
|
|
|
|
|
clean:
|
2023-10-08 12:15:08 +00:00
|
|
|
@rm -f obj/* main.ihx main.bin main.8xk
|
2023-10-07 23:32:30 +00:00
|
|
|
|
|
|
|
try: main.8xk
|
2023-10-08 12:15:08 +00:00
|
|
|
@tilem2 --rom=ti83pv116.bin
|
2023-10-07 23:32:30 +00:00
|
|
|
|
|
|
|
%.rel: lib83/%.c
|
2023-10-08 12:15:08 +00:00
|
|
|
@echo "(lib) CC $<"
|
|
|
|
@$(CC) $(CFLAGS) $< -o obj/$@
|
2023-10-07 23:32:30 +00:00
|
|
|
|
|
|
|
%.rel: %.c
|
2023-10-08 12:15:08 +00:00
|
|
|
@echo "CC $<"
|
|
|
|
@$(CC) $(CFLAGS) $< -o obj/$@
|
2023-10-07 23:32:30 +00:00
|
|
|
|
2023-10-08 12:42:01 +00:00
|
|
|
obj/main.ihx: $(OBJS)
|
2023-10-08 12:15:08 +00:00
|
|
|
@echo "LD $@"
|
|
|
|
@cd obj && $(CC) -mz80 --no-std-crt0 --code-loc 0x4000 --code-size 0x4000 --xram-loc 0x9D95 --xram-size 0x6060 $^ -o ../$@ && cd ..
|
2023-10-07 23:32:30 +00:00
|
|
|
|
2023-10-08 12:42:01 +00:00
|
|
|
main.bin: obj/main.ihx
|
2023-10-08 12:15:08 +00:00
|
|
|
@echo "IHX->BIN $@"
|
|
|
|
@objcopy -Iihex -Obinary $< $@
|
|
|
|
@echo `stat -c %s $@` bytes
|
2023-10-07 23:32:30 +00:00
|
|
|
|
|
|
|
main.8xk: main.bin
|
2023-10-08 12:15:08 +00:00
|
|
|
@echo "SIGN $@"
|
|
|
|
@rabbitsign -P -p -t 8xk -g $<
|
2023-10-07 23:32:30 +00:00
|
|
|
|