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