2021-07-31 20:39:04 -04:00
|
|
|
OUT=libscomp.a
|
2021-07-30 23:57:22 -04:00
|
|
|
TESTS=test/input test/exec
|
2021-07-10 15:10:00 -04:00
|
|
|
|
2021-07-31 20:39:04 -04:00
|
|
|
$(OUT): input.o exec.o
|
|
|
|
$(AR) rcs $(OUT) input.o exec.o
|
2021-07-10 15:10:00 -04:00
|
|
|
tests: $(TESTS)
|
2021-07-10 15:43:39 -04:00
|
|
|
for i in $(TESTS); do ./$$i -v; done
|
2021-07-10 15:10:00 -04:00
|
|
|
|
2021-08-09 13:45:05 -04:00
|
|
|
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
|
|
|
|
|
2021-07-30 23:57:22 -04:00
|
|
|
TEST_EXEC=test/exec.o exec.o
|
|
|
|
test/exec: $(TEST_EXEC)
|
|
|
|
$(CC) -Wall $(TEST_EXEC) -o test/exec
|
2021-07-10 15:10:00 -04:00
|
|
|
TEST_INPUT=test/input.o input.o
|
|
|
|
test/input: $(TEST_INPUT)
|
|
|
|
$(CC) -Wall $(TEST_INPUT) -o test/input
|
|
|
|
.c.o:
|
2021-07-30 23:57:22 -04:00
|
|
|
$(CC) -g -std=c89 -Wall -c $< -o $@
|
2021-07-31 20:42:30 -04:00
|
|
|
clean:
|
|
|
|
$(RM) $(TESTS) $(OUT) *.o
|