From 3febebce7fc74d0d6b284d8530c0ebde2d502561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=B6ller?= Date: Sun, 17 May 2020 20:25:47 +0200 Subject: [PATCH] Ease external options for optimisation or hardening --- Makefile | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 34a4610..56ae9a4 100644 --- a/Makefile +++ b/Makefile @@ -39,35 +39,36 @@ VDB_LIB := -L $(VDB_PATH)/lib64 NGS_INCL := -I $(NGS_PATH)/include NGS_LIB := -L $(NGS_PATH)/lib64 -CC = c++ -std=c++11 -fdiagnostics-color=never -CFLAGS = -Wall -Wno-format-y2k -pthread -fPIC -O3 -finline-functions -fstrict-aliasing \ - -fomit-frame-pointer -msse4.2 $(BOOST_INCL) $(NGS_INCL) $(VDB_INCL) +CC ?= c++ +CFLAGS ?= -O3 -finline-functions -fstrict-aliasing -fomit-frame-pointer -msse4.2 -fdiagnostics-color=never +CFLAGS += -std=c++11 +CFLAGS += -Wall -Wno-format-y2k -pthread -fPIC $(BOOST_INCL) $(NGS_INCL) $(VDB_INCL) PLATFORM=$(shell uname -s) ifeq ($(PLATFORM),Linux) -LIBS = $(VDB_LIB) -lncbi-ngs-c++-static -lncbi-vdb-static \ - $(NGS_LIB) -lngs-c++-static \ - -Wl,-Bstatic $(BOOST_LIB) \ - -lboost_program_options \ - -lboost_iostreams \ - -lboost_regex \ - -lboost_timer \ - -lboost_chrono \ - -lboost_system \ - -Wl,-Bdynamic -lrt -ldl -lm -lpthread -lz +LIBS += $(VDB_LIB) -lncbi-ngs-c++-static -lncbi-vdb-static \ + $(NGS_LIB) -lngs-c++-static \ + -Wl,-Bstatic $(BOOST_LIB) \ + -lboost_program_options \ + -lboost_iostreams \ + -lboost_regex \ + -lboost_timer \ + -lboost_chrono \ + -lboost_system \ + -Wl,-Bdynamic -lrt -ldl -lm -lpthread -lz else -LIBS = $(BOOST_LIB) \ - -lboost_program_options \ - -lboost_iostreams \ - -lboost_regex \ - -lboost_timer \ - -lboost_chrono \ - -lboost_system \ - -ldl -lm -lpthread -lz +LIBS += $(BOOST_LIB) \ + -lboost_program_options \ + -lboost_iostreams \ + -lboost_regex \ + -lboost_timer \ + -lboost_chrono \ + -lboost_system \ + -ldl -lm -lpthread -lz endif