#ident "@(#)cc-msposix.rul	1.18 07/05/08 "
###########################################################################
# Written 2006-2007 by J. Schilling
###########################################################################
#
# Platform dependent MACROS for INTERIX using MSVC in POSIX c89 mode
#
###########################################################################
# Copyright (c) J. Schilling
###########################################################################
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# See the file CDDL.Schily.txt in this distribution for details.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file CDDL.Schily.txt from this distribution.
###########################################################################

CPPFLAGS=	-DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX)
CFLAGS=		$(COPTS) $(CWARNOPTS) $(COPTOPT) $(MSCOPTOPT) $(COPTX)
C++FLAGS=	$(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(MSC++OPTOPT) $(C++OPTX)

CPPOPTS=	-I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) $(OSDEFS)
COPTS=
CWOPTS=		
COPTOPT=	-O2
COPTDYN=
#COPTGPROF=	-pg
#
# /EHs C++-EH aktivieren (ohne SEH-Ausnahmen)
# /EHa C++-EH aktivieren (mit SEH-Ausnahmen)
# /EHc nothrow als Standard fr externes "C"
# MS seems to need -EHsc in order to create useful code with exceptions
#
C++OPTS=	-EHsc
C++WOPTS=	-W3
C++OPTOPT=	-O2
C++OPTDYN=
#C++OPTGPROF=	-pg


LIB_PREFIX=
LIB_SUFFIX=	.lib
SHL_SUFFIX=	.dll

LIBS_PATH=	-L$(OLIBSDIR)
LIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) 

LDFLAGS=	$(LDOPTS) $(LDOPTX)
LDLIBS=		$(LIBS:-l%=%.lib) $(LIBX:-l%=%.lib)

#LDOPTS=		$(LIBS_PATH) $(LDPATH) $(RUNPATH)
LDOPTS=		$(LIBS_PATH) $(LDPATH)
#LDOPTDYN=	-shared -Wl,-soname,$(TARGET)
LDOPTDYN=	-dll -def:$(TARGETLIB).def
LNDYNLIB=	@

FLOAT_OPTIONS=	

CC_COM=		cc
CC=		@echo "	==> COMPILING \"$@\""; $(CC_COM)
CC++ =		@echo "	==> COMPILING \"$@\""; $(CC_COM)
#OUTPUT_OPTION=	-Fo$(O:%=%/)$@
#LD_OUTPUT_OPTION= -Fe$@
LDCC=		@echo "	==> LINKING \"$@\""; $(CC_COM)
LDCC++ =	@echo "	==> LINKING \"$@\""; $(CC_COM)
DYNLD=		@echo "	==> LINKING dynamic library \"$@\""; $(CC_COM)
DYNLDC++ =	@echo "	==> LINKING dynamic library \"$@\""; $(CC_COM) -nologo
DYNLD.o=	$(DYNLD) `$(LORDER) $(POFILES) | $(TSORT)` $(LDFLAGS) -out:$@ $(LDLIBS)

RANLIB=		@echo "	==> RANDOMIZING ARCHIVE \"$@\""; true
AR=		@echo "	==> ARCHIVING  \"$@\""; lib.exe -nologo
ARFLAGS=
AR.o=		$(AR) $(ARFLAGS) -out:$@

RMDEP=		:
MKDEP=		@echo "	==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-msc.sh
MKDEP_OUT=
MKC++DEP=	@echo "	==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-msc.sh
MKC++DEP_OUT=

VC=7

_VC_SETUP=	$(_UNIQ)$(VC_SETUP)
__VC_SETUP=	$(_VC_SETUP:$(_UNIQ)=vc$(VC)$(_PLATFORM:%=-%)-setup)
VCSETUP=	$(__VC_SETUP:$(_UNIQ)%=%)

###########################################################################
# IMPORTANT Note:
# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from Defaults.*
# in order to be able to test for the existence of "/bin/cc" early.
###########################################################################
include		$(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP)
