From 8fceba675826140f069b4069875f7bdfbbfe7a87 Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Mon, 9 Aug 2021 13:45:05 -0400 Subject: [PATCH] turn amalgamation into two files --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile b/Makefile index e98b796..5cdc68e 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,17 @@ $(OUT): input.o exec.o tests: $(TESTS) for i in $(TESTS); do ./$$i -v; done +libscomm_amalg.h: exec.h input.h + echo '#pragma once' > libscomm_amalg.h + cat input.h exec.h | \ + sed 's/#pragma .*//g; s/#include ".*//g' \ + >> libscomm_amalg.h + +libscomm_amalg.c: exec.c input.c libscomm_amalg.h + echo '#include "libscomm_amalg.h"' > libscomm_amalg.c + cat exec.c input.c | sed 's/#include ".*//g' \ + >> libscomm_amalg.c + TEST_EXEC=test/exec.o exec.o test/exec: $(TEST_EXEC) $(CC) -Wall $(TEST_EXEC) -o test/exec