.DEFAULT_GOAL := opt # Determine the path to this Makefile MAKEFILES_PATH := $(dir $(lastword $(MAKEFILE_LIST))) MAKEFILES_PATH_TMP := $(patsubst %Makefiles/, %, $(MAKEFILES_PATH)) # The base lib path is one above this Makefile. BASE_LIB_PATH := $(dir $(MAKEFILES_PATH_TMP)) # Path names that may be needed. DIR_PARTS := $(subst /, , $(CURDIR)) DIR_NAME := $(word $(words $(DIR_PARTS)), $(DIR_PARTS)) VERSION ?= 1.0.0 # Define the paths/names of the Stagen Libraries STAT_GEN_LIB = $(STAT_GEN_LIB_OPT) STAT_GEN_LIB_OPT = $(BASE_LIB_PATH)libStatGen.a STAT_GEN_LIB_DEBUG = $(BASE_LIB_PATH)libStatGen_debug.a STAT_GEN_LIB_PROFILE = $(BASE_LIB_PATH)libStatGen_profile.a # Currently only the statgen library is required. REQ_LIBS_OPT ?= $(STAT_GEN_LIB) REQ_LIBS_DEBUG ?= $(STAT_GEN_LIB_DEBUG) REQ_LIBS_PROFILE ?= $(STAT_GEN_LIB_PROFILE) INCLUDE_PATH = $(BASE_LIB_PATH)include include $(MAKEFILES_PATH)Makefile.toolchain # -fno-ftti is sometimes useful to increase speed # 2-5%, but makes linking consistently more difficult OPTFLAG_OPT?=-O4 -fPIC OPTFLAG_DEBUG?=-ggdb -O0 OPTFLAG_PROFILE?=-pg # User specific variables listed here. # USER_INCLUDES = # USER_COMPILE_VARS = # USER_WARNINGS = # If you don't wnat to include the current directory, set in your Makefile: # CURRENT_DIR_INCLUDE= CURRENT_DIR_INCLUDE?=-I. ZLIB_AVAIL ?= 1 USE_ZLIB = -D__ZLIB_AVAILABLE__ ZLIB_LIB = -lz ifeq ($(ZLIB_AVAIL), 0) USE_ZLIB = ZLIB_LIB = endif KNET_ON ?= 0 USE_KNET ?= ifeq ($(KNET_ON), 1) USE_KNET = -D_USE_KNETFILE endif CXX11_AVAIL ?= 1 CPP0X=$(shell if [ X$(CCVERSION) \> X4.3.0 ] ; then echo " -std=gnu++0x" ; fi) ifeq ($(CXX11_AVAIL), 0) CPP0X= endif REQ_SETTINGS = UPSTREAMCFLAGS ?= $(OPTFLAG) -pipe -Wall $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) COMPFLAGS = $(UPSTREAMCFLAGS) $(USER_WARNINGS) -I$(INCLUDE_PATH) $(CURRENT_DIR_INCLUDE) $(USER_INCLUDES) $(USE_KNET) $(USE_ZLIB) -D_FILE_OFFSET_BITS=64 -D__STDC_LIMIT_MACROS $(USER_COMPILE_VARS) # default installation directory INSTALLDIR?=/usr/local/bin