1# Time-stamp: <08/01/12 00:50:38 ptr> 2# 3# Copyright (c) 1997-1999, 2002, 2003, 2005-2008 4# Petr Ovtchenkov 5# 6# Portion Copyright (c) 1999-2001 7# Parallel Graphics Ltd. 8# 9# Licensed under the Academic Free License version 3.0 10# 11 12INCLUDES := 13 14ifndef _FORCE_CXX 15CXX := CC 16else 17CXX := ${_FORCE_CXX} 18endif 19 20ifndef _FORCE_CC 21CC := cc 22else 23CC := ${_FORCE_CC} 24endif 25 26CXX_VERSION := $(shell ${CXX} -V 2>&1 | grep ${CXX} | awk '{ print $$4; }') 27 28CXX_VERSION_MAJOR := $(shell echo ${CXX_VERSION} | awk 'BEGIN { FS = "."; } { print $$1; }') 29CXX_VERSION_MINOR := $(shell echo ${CXX_VERSION} | awk 'BEGIN { FS = "."; } { print $$2; }') 30CXX_VERSION_PATCH := $(shell echo ${CXX_VERSION} | awk 'BEGIN { FS = "."; } { if (NF > 2) {print $$3;}else{print "0"} }') 31 32DEFS ?= 33OPT ?= 34 35OUTPUT_OPTION = -o $@ 36LINK_OUTPUT_OPTION = ${OUTPUT_OPTION} 37CPPFLAGS = $(DEFS) $(INCLUDES) 38 39OPT += -mt +w2 40CCFLAGS = -erroff=doubunder -qoption ccfe -expand=1000 -library=no%Cstd,no%iostream,no%rwtools7-xildoff $(OPT) 41CFLAGS = $(OPT) 42CXXFLAGS = -erroff=doubunder -qoption ccfe -expand=1000 -library=no%Cstd,no%iostream,no%rwtools7 -xildoff $(OPT) 43CDEPFLAGS = -xM 44CCDEPFLAGS = -xM 45 46# STLport DEBUG mode specific defines 47stldbg-static : DEFS += -D_STLP_DEBUG 48stldbg-shared : DEFS += -D_STLP_DEBUG 49stldbg-static-dep : DEFS += -D_STLP_DEBUG 50stldbg-shared-dep : DEFS += -D_STLP_DEBUG 51 52# optimization and debug compiler flags 53release-static : OPT += -xO2 54release-shared : OPT += -xO2 55 56dbg-static : OPT += -g 57dbg-shared : OPT += -g 58#dbg-static-dep : OPT += -g 59#dbg-shared-dep : OPT += -g 60 61stldbg-static : OPT += -g 62stldbg-shared : OPT += -g 63#stldbg-static-dep : OPT += -g 64#stldbg-shared-dep : OPT += -g 65 66# dependency output parser (dependencies collector) 67 68DP_OUTPUT_DIR = | sed 's|\($*\)\.o[ :]*|$(OUTPUT_DIR)/\1.o $@ : |g' > $@; \ 69 [ -s $@ ] || rm -f $@ 70 71DP_OUTPUT_DIR_DBG = | sed 's|\($*\)\.o[ :]*|$(OUTPUT_DIR_DBG)/\1.o $@ : |g' > $@; \ 72 [ -s $@ ] || rm -f $@ 73 74DP_OUTPUT_DIR_STLDBG = | sed 's|\($*\)\.o[ :]*|$(OUTPUT_DIR_STLDBG)/\1.o $@ : |g' > $@; \ 75 [ -s $@ ] || rm -f $@ 76 77 78