changeset 10:39b921d851fb

bootmatch: generating C outputs
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 10 Jun 2023 03:18:23 +0000
parents bfcc8180cf3c
children 2a62a7decd9f
files .hgignore bootmatch/Makefile bootmatch/comp_output.c
diffstat 3 files changed, 41 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sat Jun 10 02:55:29 2023 +0000
+++ b/.hgignore	Sat Jun 10 03:18:23 2023 +0000
@@ -3,3 +3,9 @@
 \.[oa]$
 
 ^bootmatch/bm-comp$
+^bootmatch/c11x_lockable\.c$
+^bootmatch/c11x_nolock\.c$
+^bootmatch/c139_lockable\.c$
+^bootmatch/c139_nolock\.c$
+^bootmatch/c155_boot\.c$
+^bootmatch/fc_patched_boot\.c$
--- a/bootmatch/Makefile	Sat Jun 10 02:55:29 2023 +0000
+++ b/bootmatch/Makefile	Sat Jun 10 03:18:23 2023 +0000
@@ -2,11 +2,43 @@
 CFLAGS=	-O2
 BMC_PROG=bm-comp
 BMC_OBJS=comp_main.o comp_output.o comp_ranges.o comp_readbin.o
+OUTPUTS=c11x_lockable.c c11x_nolock.c c139_lockable.c c139_nolock.c \
+	c155_boot.c fc_patched_boot.c
 
-all:	${BMC_PROG}
+C11XNEW_BIN=	../bootref/c11x-lockable.bin
+C11XNEW_RNG=	../bootref/c11x-lockable.ranges
+C11XOLD_BIN=	../bootref/c11x-nolock.bin
+C11XOLD_RNG=	../bootref/c11x-nolock.ranges
+C139NEW_BIN=	../bootref/c139-lockable.bin
+C139NEW_RNG=	../bootref/c139-lockable.ranges
+C139OLD_BIN=	../bootref/c139-nolock.bin
+C139OLD_RNG=	../bootref/c139-nolock.ranges
+C155BOOT_BIN=	../bootref/c156-boot.bin
+C155BOOT_RNG=	../bootref/c156-boot.ranges
+FCPATCH_BIN=	../target-bin/compal-flash-boot-for-fc.bin
+
+all:	${BMC_PROG} ${OUTPUTS}
 
 ${BMC_PROG}:	${BMC_OBJS}
 	${CC} ${CFLAGS} -o $@ ${BMC_OBJS}
 
+c11x_lockable.c:	${BMC_PROG} ${C11XNEW_BIN} ${C11XNEW_RNG}
+	./${BMC_PROG} ${C11XNEW_BIN} ${C11XNEW_RNG} bootmatch_c11x_lockable $@
+
+c11x_nolock.c:		${BMC_PROG} ${C11XOLD_BIN} ${C11XOLD_RNG}
+	./${BMC_PROG} ${C11XOLD_BIN} ${C11XOLD_RNG} bootmatch_c11x_nolock $@
+
+c139_lockable.c:	${BMC_PROG} ${C139NEW_BIN} ${C139NEW_RNG}
+	./${BMC_PROG} ${C139NEW_BIN} ${C139NEW_RNG} bootmatch_c139_lockable $@
+
+c139_nolock.c:		${BMC_PROG} ${C139OLD_BIN} ${C139OLD_RNG}
+	./${BMC_PROG} ${C139OLD_BIN} ${C139OLD_RNG} bootmatch_c139_nolock $@
+
+c155_boot.c:		${BMC_PROG} ${C155BOOT_BIN} ${C155BOOT_RNG}
+	./${BMC_PROG} ${C155BOOT_BIN} ${C155BOOT_RNG} bootmatch_c155 $@
+
+fc_patched_boot.c:	${BMC_PROG} ${FCPATCH_BIN} ${C11XOLD_RNG}
+	./${BMC_PROG} ${FCPATCH_BIN} ${C11XOLD_RNG} bootmatch_fc_patch $@
+
 clean:
-	rm -f *.o ${BMC_PROG}
+	rm -f *.o ${BMC_PROG} ${OUTPUTS}
--- a/bootmatch/comp_output.c	Sat Jun 10 02:55:29 2023 +0000
+++ b/bootmatch/comp_output.c	Sat Jun 10 03:18:23 2023 +0000
@@ -42,6 +42,7 @@
 		fprintf(outf, "0x%02X", *dp++);
 		if (dp < endp)
 			putc(',', outf);
+		linelen++;
 	}
 	fputs("\n};\n\n", outf);
 }