turn amalgamation into two files

This commit is contained in:
Peter McGoron 2021-08-09 13:45:05 -04:00
parent dea5819d67
commit 8fceba6758
1 changed files with 11 additions and 0 deletions

View File

@ -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