1# Time-stamp: <07/05/31 01:03:50 ptr> 2# 3# Copyright (c) 1997-1999, 2002, 2003, 2005-2007 4# Petr Ovtchenkov 5# 6# Copyright (c) 2006, 2007 7# Francois Dumont 8# 9# Portion Copyright (c) 1999-2001 10# Parallel Graphics Ltd. 11# 12# Licensed under the Academic Free License version 3.0 13# 14 15# For DMC Cygwin/MSys are only build environment, they do not represent 16# the targetted OS so per default we keep all generated files in STLport 17# folder. 18BASE_INSTALL_DIR ?= ${STLPORT_DIR} 19 20ALL_TAGS = all-static all-shared 21ifdef LIBNAME 22INSTALL_TAGS = install-static install-shared 23endif 24 25CXX := dmc 26CC := dmc 27 28DEFS ?= 29OPT ?= 30 31CFLAGS = -Ae -C -p -3 -w6 -w12 32CXXFLAGS = -Ae -C -p -3 -w12 33 34DEFS += -DSTRICT 35 36ifdef WITH_DYNAMIC_RTL 37release-static : OPT += -ND 38dbg-static : OPT += -ND 39stldbg-static : OPT += -ND 40endif 41 42ifndef WITH_STATIC_RTL 43release-shared : OPT += -ND 44dbg-shared : OPT += -ND 45stldbg-shared : OPT += -ND 46endif 47 48ifdef WITHOUT_THREAD 49DEFS += -D_STLP_NO_THREADS 50endif 51 52ifndef WITHOUT_RTTI 53OPT += -Ar 54endif 55 56WINVER ?= 0x0501 57DEFS += -DWINVER=$(WINVER) 58 59OUTPUT_OPTION = -o$@ 60LINK_OUTPUT_OPTION = $@ 61CPPFLAGS = $(DEFS) $(OPT) $(INCLUDES) 62 63ifdef EXTRA_CXXFLAGS 64CXXFLAGS += $(EXTRA_CXXFLAGS) 65endif 66 67ifdef EXTRA_CFLAGS 68CFLAGS += $(EXTRA_CFLAGS) 69endif 70 71CDEPFLAGS = -E -M 72CCDEPFLAGS = -E -M 73RCFLAGS = --include-dir=${STLPORT_INCLUDE_DIR} -DCOMP=dmc 74 75release-shared : RCFLAGS += -DBUILD=r -DBUILD_INFOS="-o" 76dbg-shared : RCFLAGS += -DBUILD=g -DBUILD_INFOS="-gl -D_DEBUG" 77stldbg-shared : RCFLAGS += -DBUILD=stlg -DBUILD_INFOS="-gl -D_STLP_DEBUG" 78RC_OUTPUT_OPTION = $(OUTPUT_OPTION) 79 80COMPILE.rc = ${RC} ${RCFLAGS} 81LINK.cc = link $(LDFLAGS) 82 83LDLIBS += user32.lib kernel32.lib snn.lib 84 85# STLport DEBUG mode specific defines 86dbg-static : DEFS += -D_DEBUG 87dbg-shared : DEFS += -D_DEBUG 88stldbg-static : DEFS += -D_DEBUG 89stldbg-shared : DEFS += -D_DEBUG 90dbg-static-dep : DEFS += -D_DEBUG 91dbg-shared-dep : DEFS += -D_DEBUG 92stldbg-static : DEFS += -D_STLP_DEBUG 93stldbg-shared : DEFS += -D_STLP_DEBUG 94stldbg-static-dep : DEFS += -D_STLP_DEBUG 95stldbg-shared-dep : DEFS += -D_STLP_DEBUG 96 97# optimization and debug compiler flags 98release-static : OPT += -o 99release-shared : OPT += -o 100dbg-static : OPT += -gl 101dbg-shared : OPT += -gl 102stldbg-static : OPT += -gl 103stldbg-shared : OPT += -gl 104 105ifndef WITHOUT_THREAD 106release-static : OPT += -D_MT 107dbg-static : OPT += -D_MT 108stldbg-static : OPT += -D_MT 109endif 110 111release-static : AR += -p128 112dbg-static : AR += -p512 113stldbg-static : AR += -p512 114 115ifndef LIBNAME 116ifdef WITH_DYNAMIC_RTL 117release-static: DEFS += -D_STLP_USE_STATIC_LIB 118dbg-static: DEFS += -D_STLP_USE_STATIC_LIB 119stldbg-static: DEFS += -D_STLP_USE_STATIC_LIB 120endif 121ifdef WITH_STATIC_RTL 122release-shared: DEFS += -D_STLP_USE_DYNAMIC_LIB 123dbg-shared: DEFS += -D_STLP_USE_DYNAMIC_LIB 124stldbg-shared: DEFS += -D_STLP_USE_DYNAMIC_LIB 125endif 126endif 127 128# map output option (move map files to output dir) 129 130ifdef LIBNAME 131release-shared: MAP_OUTPUT_OPTION = $(OUTPUT_DIR)/$(SO_NAME_BASE).map 132dbg-shared: MAP_OUTPUT_OPTION = $(OUTPUT_DIR_DBG)/$(SO_NAME_DBG_BASE).map 133stldbg-shared: MAP_OUTPUT_OPTION = $(OUTPUT_DIR_STLDBG)/$(SO_NAME_STLDBG_BASE).map 134else 135release-shared: MAP_OUTPUT_OPTION = $(OUTPUT_DIR)/$(PRGNAME).map 136release-static: MAP_OUTPUT_OPTION = $(OUTPUT_DIR)/$(PRGNAME).map 137dbg-shared: MAP_OUTPUT_OPTION = $(OUTPUT_DIR_DBG)/$(PRGNAME).map 138dbg-static: MAP_OUTPUT_OPTION = $(OUTPUT_DIR_DBG)/$(PRGNAME).map 139stldbg-shared: MAP_OUTPUT_OPTION = $(OUTPUT_DIR_STLDBG)/$(PRGNAME).map 140stldbg-static: MAP_OUTPUT_OPTION = $(OUTPUT_DIR_STLDBG)/$(PRGNAME).map 141endif 142 143# dependency output parser (dependencies collector) 144 145DP_OUTPUT_DIR = | sed 's|\($*\)\.o[ :]*|$(OUTPUT_DIR)/\1.o $@ : |g' > $@; \ 146 [ -s $@ ] || rm -f $@ 147 148DP_OUTPUT_DIR_DBG = | sed 's|\($*\)\.o[ :]*|$(OUTPUT_DIR_DBG)/\1.o $@ : |g' > $@; \ 149 [ -s $@ ] || rm -f $@ 150 151DP_OUTPUT_DIR_STLDBG = | sed 's|\($*\)\.o[ :]*|$(OUTPUT_DIR_STLDBG)/\1.o $@ : |g' > $@; \ 152 [ -s $@ ] || rm -f $@ 153 154