2023-10-07 23:32:30 +00:00
|
|
|
|
2023-10-08 16:33:37 +00:00
|
|
|
SDCC=sdcc
|
|
|
|
SDCCFLAGS=-Ilib83 -c -mz80 --std-sdcc2x --no-std-crt0 --reserve-regs-iy --opt-code-size
|
2023-10-07 23:32:30 +00:00
|
|
|
|
|
|
|
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-08 16:20:19 +00:00
|
|
|
strcpy.rel strlen.rel strncpy.rel \
|
2023-10-07 23:32:30 +00:00
|
|
|
main.rel
|
|
|
|
|
2023-10-08 16:33:37 +00:00
|
|
|
.PHONY: all clean try init
|
2023-10-07 23:32:30 +00:00
|
|
|
all: main.8xk
|
|
|
|
|
2023-10-08 16:33:37 +00:00
|
|
|
init:
|
|
|
|
@echo "Compiling rabbitsign..."
|
|
|
|
@$(CC) tool/rabbitsign-src/*.c -o tool/rabbitsign -O2 -g -w -DPROTOTYPES
|
|
|
|
|
2023-10-07 23:32:30 +00:00
|
|
|
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 16:33:37 +00:00
|
|
|
@echo "(lib) SDCC $<"
|
|
|
|
@$(SDCC) $(SDCCFLAGS) $< -o obj/$@
|
2023-10-07 23:32:30 +00:00
|
|
|
|
|
|
|
%.rel: %.c
|
2023-10-08 16:33:37 +00:00
|
|
|
@echo "SDCC $<"
|
|
|
|
@$(SDCC) $(SDCCFLAGS) $< -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 16:33:37 +00:00
|
|
|
@echo "SDCCLD $@"
|
|
|
|
@cd obj && $(SDCC) -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 $@"
|
2023-10-08 16:33:37 +00:00
|
|
|
@tool/rabbitsign -P -p -t 8xk -g $<
|
2023-10-07 23:32:30 +00:00
|
|
|
|