better EXTRALIBS

This commit is contained in:
Steffen Jaeckel 2017-05-11 15:40:50 +02:00
parent 81f0297285
commit 6a4978ef5e

View File

@ -28,6 +28,20 @@ ifndef MAKE
MAKE:=make MAKE:=make
endif endif
ifndef INSTALL_CMD
$(error your makefile must define INSTALL_CMD)
endif
ifndef EXTRALIBS
ifneq ($(shell echo $(CFLAGS) | grep USE_LTM),)
EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config libtommath --libs)
else
ifneq ($(shell echo $(CFLAGS) | grep USE_TFM),)
EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config tomsfastmath --libs)
endif
endif
endif
# Compilation flags. Note the += does not write over the user's CFLAGS! # Compilation flags. Note the += does not write over the user's CFLAGS!
CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE
@ -314,14 +328,6 @@ $(OBJECTS): $(HEADERS)
$(DOBJECTS): $(HEADERS) $(THEADERS) $(DOBJECTS): $(HEADERS) $(THEADERS)
$(TOBJECTS): $(HEADERS) $(THEADERS) $(TOBJECTS): $(HEADERS) $(THEADERS)
ifndef INSTALL_CMD
$(error your makefile must define INSTALL_CMD)
endif
ifndef EXTRALIBS
EXTRALIBS=$(shell PKG_CONFIG_PATH=$(LIBPATH)/pkgconfig pkg-config libtommath --libs)
endif
bins: $(USEFUL_DEMOS) bins: $(USEFUL_DEMOS)
all_test: test tv_gen $(DEMOS) all_test: test tv_gen $(DEMOS)