c-kzg-4844/src/Makefile

49 lines
1.3 KiB
Makefile
Raw Normal View History

TESTS = bls12_381_test c_kzg_util_test fft_common_test fft_fr_test fft_g1_test \
fk20_proofs_test kzg_proofs_test poly_test utility_test
2021-02-07 20:58:19 +00:00
BENCH = fft_fr_bench fft_g1_bench
LIB_SRC = bls12_381.c c_kzg_util.c das_extension.c fft_common.c fft_fr.c fft_g1.c fk20_proofs.c kzg_proofs.c poly.c utility.c
2021-02-03 16:59:59 +00:00
LIB_OBJ = $(LIB_SRC:.c=.o)
2021-02-10 11:55:38 +00:00
CFLAGS =
2021-02-01 20:15:45 +00:00
.PRECIOUS: %.o
2021-02-01 20:15:45 +00:00
2021-02-03 21:00:14 +00:00
%.o: %.c %.h c_kzg.h Makefile
2021-02-03 16:59:59 +00:00
clang -Wall $(CFLAGS) -c $*.c
2021-02-03 16:59:59 +00:00
libckzg.a: $(LIB_OBJ) Makefile
ar rc libckzg.a $(LIB_OBJ)
2021-02-10 11:55:38 +00:00
%_test: %_test.c debug_util.o test_util.o libckzg.a Makefile
clang -Wall $(CFLAGS) -o $@ $@.c debug_util.o test_util.o libckzg.a -L../lib -lblst
2021-02-02 23:06:42 +00:00
./$@
2021-02-10 11:55:38 +00:00
# This version will abort on error and print the file and line number
%_test_debug: CFLAGS += -g -O0 -DDEBUG
%_test_debug: %_test.c debug_util.o test_util.o libckzg.a Makefile
clang -Wall $(CFLAGS) -o $@ $*_test.c debug_util.o test_util.o libckzg.a -L../lib -lblst
# Benchmarks
2021-02-17 12:25:03 +00:00
%_bench: CFLAGS += -O
%_bench: %_bench.c bench_util.o test_util.o $(LIB_OBJ) Makefile
clang -Wall $(CFLAGS) -o $@ $@.c bench_util.o test_util.o $(LIB_OBJ) -L../lib -lblst
2021-02-07 20:58:19 +00:00
./$@
2021-02-17 12:25:03 +00:00
lib: CFLAGS += -O
2021-02-03 16:59:59 +00:00
lib: clean libckzg.a
2021-02-07 20:58:19 +00:00
profilelib: CFLAGS += -fprofile-instr-generate -fcoverage-mapping
profilelib: clean libckzg.a
2021-02-03 16:59:59 +00:00
test: $(TESTS)
2021-02-01 20:15:45 +00:00
2021-02-07 20:58:19 +00:00
bench: $(BENCH)
2021-02-01 20:15:45 +00:00
clean:
rm -f *.o
2021-02-03 14:30:44 +00:00
rm -f libckzg.a
2021-02-03 16:59:59 +00:00
rm -f $(TESTS)
2021-02-08 08:39:24 +00:00
rm -f $(BENCH)
2021-02-10 11:55:38 +00:00
rm -f *_debug
2021-02-01 20:15:45 +00:00
rm -f a.out