diff --git a/src/Makefile b/src/Makefile index b173a9c..1d3a158 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,25 +1,25 @@ tests = fft_util_test fft_fr_test fft_g1_test +c_kzg_sources = fft_util.c fft_fr.c fft_g1.c +c_kzg_objects = $(c_kzg_sources:.c=.o) .PRECIOUS: %.o %.o: %.c %.h c-kzg.h clang -Wall -c $*.c -fft_fr_test: fft_fr.o fft_fr_test.c test_util.o fft_util.o Makefile - clang -Wall -o $@ $@.c test_util.o fft_fr.o fft_util.o -L../lib -lblst +libckzg.a: $(c_kzg_objects) + ar rc libckzg.a $(c_kzg_objects) + +%_test: %_test.c test_util.o libckzg.a Makefile + clang -Wall -o $@ $@.c test_util.o libckzg.a -L../lib -lblst ./$@ -fft_g1_test: fft_g1.o fft_g1_test.c test_util.o fft_util.o Makefile - clang -Wall -o $@ $@.c test_util.o fft_g1.o fft_util.o -L../lib -lblst - ./$@ - -%_test: %.o %_test.c test_util.o Makefile - clang -Wall -o $@ $@.c test_util.o $*.o -L../lib -lblst - ./$@ +lib: libckzg.a test: $(tests) clean: rm -f *.o + rm -f libckzg.a rm -f $(tests) rm -f a.out