1# -*- makefile -*- Time-stamp: <06/11/17 10:34:26 ptr> 2# 3# Copyright (c) 1997-1999, 2002, 2003, 2005-2007 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 12dbg-shared: $(EXTRA_PRE_DBG) $(OUTPUT_DIR_DBG) ${PRG_DBG} ${ALLPRGS_DBG} $(EXTRA_POST_DBG) 13 14dbg-static: $(EXTRA_PRE_DBG) $(OUTPUT_DIR_DBG) ${PRG_DBG} ${ALLPRGS_DBG} $(EXTRA_POST_DBG) 15 16release-shared: $(EXTRA_PRE) $(OUTPUT_DIR) ${PRG} ${ALLPRGS} $(EXTRA_POST) 17 18release-static: $(EXTRA_PRE) $(OUTPUT_DIR) ${PRG} ${ALLPRGS} $(EXTRA_POST) 19 20ifndef WITHOUT_STLPORT 21stldbg-shared: $(EXTRA_PRE_STLDBG) $(OUTPUT_DIR_STLDBG) ${PRG_STLDBG} ${ALLPRGS_STLDBG} $(EXTRA_POST_STLDBG) 22 23stldbg-static: $(EXTRA_PRE_STLDBG) $(OUTPUT_DIR_STLDBG) ${PRG_STLDBG} ${ALLPRGS_STLDBG} $(EXTRA_POST_STLDBG) 24endif 25 26ifeq ("$(findstring $(COMPILER_NAME),bcc dmc)","") 27define cpplnk_str 28$(LINK.cc) $(LINK_OUTPUT_OPTION) ${START_OBJ} $(1) $(LDLIBS) ${STDLIBS} ${END_OBJ} 29endef 30else 31ifneq ($(OSNAME),linux) 32define cpplnk_str 33$(LINK.cc) $(subst /,\\,${START_OBJ} $(1) ${END_OBJ}, $(LINK_OUTPUT_OPTION), $(MAP_OUTPUT_OPTION), $(LDLIBS) ${STDLIBS},,) 34endef 35else 36define cpplnk_str 37$(LINK.cc) ${START_OBJ} $(1) ${END_OBJ}, $(LINK_OUTPUT_OPTION), $(MAP_OUTPUT_OPTION), $(LDLIBS) ${STDLIBS},, 38endef 39endif 40endif 41 42define prog_lnk 43ifeq ($${_$(1)_C_SOURCES_ONLY},) 44$${$(1)_PRG}: $$($(1)_OBJ) $$(LIBSDEP) 45 $$(call cpplnk_str,$$($(1)_OBJ)) 46 47$${$(1)_PRG_DBG}: $$($(1)_OBJ_DBG) $$(LIBSDEP) 48 $$(call cpplnk_str,$$($(1)_OBJ_DBG)) 49 50ifndef WITHOUT_STLPORT 51$${$(1)_PRG_STLDBG}: $$($(1)_OBJ_STLDBG) $$(LIBSDEP) 52 $$(call cpplnk_str,$$($(1)_OBJ_STLDBG)) 53endif 54else 55$${$(1)_PRG}: $$($(1)_OBJ) $$(LIBSDEP) 56 $$(LINK.c) $$(LINK_OUTPUT_OPTION) $$($(1)_OBJ) $$(LDLIBS) 57 58$${$(1)_PRG_DBG}: $$(OBJ_DBG) $$(LIBSDEP) 59 $$(LINK.c) $$(LINK_OUTPUT_OPTION) $$($(1)_OBJ_DBG) $$(LDLIBS) 60 61ifndef WITHOUT_STLPORT 62$${$(1)_PRG_STLDBG}: $$($(1)_OBJ_STLDBG) $$(LIBSDEP) 63 $$(LINK.c) $$(LINK_OUTPUT_OPTION) $$($(1)_OBJ_STLDBG) $$(LDLIBS) 64endif 65endif 66endef 67 68$(foreach prg,$(PRGNAMES),$(eval $(call prog_lnk,$(prg)))) 69 70ifeq ("${_C_SOURCES_ONLY}","") 71${PRG}: $(OBJ) $(LIBSDEP) 72 $(call cpplnk_str,$(OBJ)) 73 74${PRG_DBG}: $(OBJ_DBG) $(LIBSDEP) 75 $(call cpplnk_str,$(OBJ_DBG)) 76 77ifndef WITHOUT_STLPORT 78${PRG_STLDBG}: $(OBJ_STLDBG) $(LIBSDEP) 79 $(call cpplnk_str,$(OBJ_STLDBG)) 80endif 81else 82${PRG}: $(OBJ) $(LIBSDEP) 83 $(LINK.c) $(LINK_OUTPUT_OPTION) $(OBJ) $(LDLIBS) 84 85${PRG_DBG}: $(OBJ_DBG) $(LIBSDEP) 86 $(LINK.c) $(LINK_OUTPUT_OPTION) $(OBJ_DBG) $(LDLIBS) 87 88ifndef WITHOUT_STLPORT 89${PRG_STLDBG}: $(OBJ_STLDBG) $(LIBSDEP) 90 $(LINK.c) $(LINK_OUTPUT_OPTION) $(OBJ_STLDBG) $(LDLIBS) 91endif 92endif 93