dcubed@485: # dcubed@485: # Copyright 1999-2007 Sun Microsystems, Inc. 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: # dcubed@485: # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, dcubed@485: # CA 95054 USA or visit www.sun.com if you need additional information or dcubed@485: # have any questions. dcubed@485: # dcubed@485: # dcubed@485: dcubed@485: #------------------------------------------------------------------------ dcubed@485: # CC, CPP & AS dcubed@485: dcubed@485: CPP = CC dcubed@485: CC = cc dcubed@485: AS = $(CC) -c dcubed@485: 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: 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: