diff --git a/makefile_include.mk b/makefile_include.mk index 9984fad..ff89df7 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -28,6 +28,20 @@ ifndef MAKE MAKE:=make 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! CFLAGS += -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE @@ -314,14 +328,6 @@ $(OBJECTS): $(HEADERS) $(DOBJECTS): $(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) all_test: test tv_gen $(DEMOS)