dcubed@485: # mikael@4153: # Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. dcubed@485: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. dcubed@485: # dcubed@485: # This code is free software; you can redistribute it and/or modify it dcubed@485: # under the terms of the GNU General Public License version 2 only, as dcubed@485: # published by the Free Software Foundation. dcubed@485: # dcubed@485: # This code is distributed in the hope that it will be useful, but WITHOUT dcubed@485: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dcubed@485: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dcubed@485: # version 2 for more details (a copy is included in the LICENSE file that dcubed@485: # accompanied this code). dcubed@485: # dcubed@485: # You should have received a copy of the GNU General Public License version dcubed@485: # 2 along with this work; if not, write to the Free Software Foundation, dcubed@485: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. dcubed@485: # trims@1907: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: # or visit www.oracle.com if you need additional information or have any trims@1907: # questions. dcubed@485: # dcubed@485: # dcubed@485: dcubed@485: #------------------------------------------------------------------------ erikj@3518: # CC, CXX & AS dcubed@485: erikj@3600: # If a SPEC is not set already, then use these defaults. erikj@3600: ifeq ($(SPEC),) erikj@3600: CXX = CC erikj@3600: CC = cc erikj@3600: AS = $(CC) -c dcubed@485: erikj@3600: HOSTCXX = $(CXX) erikj@3600: HOSTCC = $(CC) erikj@3600: endif roland@2683: dcubed@485: ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) dcubed@485: ARCHFLAG/i486 = -m32 dcubed@485: ARCHFLAG/amd64 = -m64 dcubed@485: dcubed@485: CFLAGS += $(ARCHFLAG) dcubed@485: AOUT_FLAGS += $(ARCHFLAG) dcubed@485: LFLAGS += $(ARCHFLAG) dcubed@485: ASFLAGS += $(ARCHFLAG) dcubed@485: dcubed@485: #------------------------------------------------------------------------ dcubed@485: # Compiler flags dcubed@485: dcubed@485: # position-independent code dcubed@485: PICFLAG = -KPIC dcubed@485: dcubed@485: CFLAGS += $(PICFLAG) dcubed@485: # no more exceptions dcubed@485: CFLAGS += -features=no%except dcubed@485: # Reduce code bloat by reverting back to 5.0 behavior for static initializers dcubed@485: CFLAGS += -features=no%split_init dcubed@485: # allow zero sized arrays dcubed@485: CFLAGS += -features=zla dcubed@485: dcubed@485: # Use C++ Interpreter dcubed@485: ifdef CC_INTERP dcubed@485: CFLAGS += -DCC_INTERP dcubed@485: endif dcubed@485: dcubed@485: # We don't need libCstd.so and librwtools7.so, only libCrun.so dcubed@485: CFLAGS += -library=Crun dcubed@485: LIBS += -lCrun dcubed@485: dcubed@485: CFLAGS += -mt dcubed@485: LFLAGS += -mt dcubed@485: dcubed@485: # Compiler warnings are treated as errors dcubed@485: #WARNINGS_ARE_ERRORS = -errwarn=%all dcubed@485: CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) dcubed@485: # Special cases dcubed@485: CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) dcubed@485: dcubed@485: # The flags to use for an Optimized build dcubed@485: OPT_CFLAGS+=-xO4 dcubed@485: OPT_CFLAGS/NOOPT=-xO0 dcubed@485: stefank@2314: # Flags for creating the dependency files. stefank@2314: ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) stefank@2314: DEPFLAGS = -xMMD -xMF $(DEP_DIR)/$(@:%=%.d) stefank@2314: endif stefank@2314: stefank@2325: # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. stefank@2325: CFLAGS += -DDONT_USE_PRECOMPILED_HEADER stefank@2325: dcubed@485: #------------------------------------------------------------------------ dcubed@485: # Linker flags dcubed@485: dcubed@485: # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file. dcubed@485: MAPFLAG = -Wl,--version-script=FILENAME dcubed@485: dcubed@485: # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj dcubed@485: SONAMEFLAG = -h SONAME dcubed@485: dcubed@485: # Build shared library dcubed@485: SHARED_FLAG = -G dcubed@485: dcubed@485: #------------------------------------------------------------------------ dcubed@485: # Debug flags dcubed@485: DEBUG_CFLAGS += -g dcubed@485: FASTDEBUG_CFLAGS = -g0 dcubed@485: