Merge pull request #2 from Nashatyrev/fix/include

Specify blst include dir in Makefile
This commit is contained in:
Ben Edgington 2021-06-11 11:07:49 +01:00 committed by GitHub
commit e23d7457b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -5,28 +5,29 @@ LIB_SRC = bls12_381.c c_kzg_util.c das_extension.c fft_common.c fft_fr.c fft_g1.
LIB_OBJ = $(LIB_SRC:.c=.o) LIB_OBJ = $(LIB_SRC:.c=.o)
CFLAGS = CFLAGS =
INCLUDE_DIRS = ../inc
.PRECIOUS: %.o .PRECIOUS: %.o
%.o: %.c %.h c_kzg.h Makefile %.o: %.c %.h c_kzg.h Makefile
clang -Wall $(CFLAGS) -c $*.c clang -Wall -I$(INCLUDE_DIRS) $(CFLAGS) -c $*.c
libckzg.a: $(LIB_OBJ) Makefile libckzg.a: $(LIB_OBJ) Makefile
ar rc libckzg.a $(LIB_OBJ) ar rc libckzg.a $(LIB_OBJ)
%_test: %_test.c debug_util.o test_util.o libckzg.a Makefile %_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 clang -Wall -I$(INCLUDE_DIRS) $(CFLAGS) -o $@ $@.c debug_util.o test_util.o libckzg.a -L../lib -lblst
./$@ ./$@
# This version will abort on error and print the file and line number # This version will abort on error and print the file and line number
%_test_debug: CFLAGS += -g -O0 -DDEBUG %_test_debug: CFLAGS += -g -O0 -DDEBUG
%_test_debug: %_test.c debug_util.o test_util.o libckzg.a Makefile %_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 clang -Wall -I$(INCLUDE_DIRS) $(CFLAGS) -o $@ $*_test.c debug_util.o test_util.o libckzg.a -L../lib -lblst
# Benchmarks # Benchmarks
%_bench: CFLAGS += -O %_bench: CFLAGS += -O
%_bench: %_bench.c bench_util.o test_util.o $(LIB_OBJ) Makefile %_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 clang -Wall -I$(INCLUDE_DIRS) $(CFLAGS) -o $@ $@.c bench_util.o test_util.o $(LIB_OBJ) -L../lib -lblst
./$@ ./$@
lib: CFLAGS += -O lib: CFLAGS += -O

View File

@ -34,7 +34,7 @@
// Settings for linking with the BLST library // Settings for linking with the BLST library
#ifdef BLST #ifdef BLST
#include "../inc/blst.h" #include "blst.h"
typedef blst_scalar scalar_t; /**< Internal scalar type */ typedef blst_scalar scalar_t; /**< Internal scalar type */
typedef blst_fr fr_t; /**< Internal Fr field element type */ typedef blst_fr fr_t; /**< Internal Fr field element type */