📄 gcc.gmk
字号:
## ## Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER# # This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License version# 2 only, as published by the Free Software Foundation.# # This program is distributed in the hope that it will be useful, but# WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU# General Public License version 2 for more details (a copy is# included at /legal/license.txt).# # You should have received a copy of the GNU General Public License# version 2 along with this work; if not, write to the Free Software# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA# 02110-1301 USA# # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa# Clara, CA 95054 or visit www.sun.com if you need additional# information or have any questions.######################################################################### Generic compiler specific defines# MIDP specific directories and libraries defines will be in gcc-jtwi.gmk.######################################################################### The following variables are required to be defined here:## File suffixes## LIB_SUFFIX suffix of library file# LIB_PREFIX prefix of library file# OBJ_SUFFIX suffix of object file## Compiler definitions## CC compiler command for c files# CPP compiler command for c++ files# CC_OUTPUT compiler option used to specify name of output file## Linker definitions## LD linker command# LINKER_OUTPUT linker option used to specify output name## Archiver or library command## AR command that creates a library## Some optional variables## AR_FLAGS flags for the library command# LIBS libraries to be linked with# LD_FLAGS linker flags# EXTRA_CFLAGS flags for c compiler # EXTRA_CPPFLAGS flags for c++ compiler# #######################################################################ifdef GNU_TOOLS_DIR GNU_TOOLS_BINDIR?=$(GNU_TOOLS_DIR)/bin/else ifeq ($(TARGET_CPU), arm) # Export GNU_TOOLS_DIR to VM makefile export GNU_TOOLS_DIR=/opt/Embedix/tools/arm-linux GNU_TOOLS_BINDIR?=$(GNU_TOOLS_DIR)/bin/ else # Otherwise, use gcc command from path GNU_TOOLS_BINDIR= endifendif# SuffixLIB_SUFFIX = .aLIB_PREFIX = libSHARED_LIB_SUFFIX = .soOBJ_SUFFIX = o# Same defines when used as either TARGET or HOST COMPILERifndef USE_GCC USE_GCC = trueendififndef GCC_VERSIONGCC_VERSION =endifCC = $(GNU_TOOLS_BINDIR)gcc$(GCC_VERSION)CPP = $(GNU_TOOLS_BINDIR)g++$(GCC_VERSION)CC_OUTPUT = -oLD = $(GNU_TOOLS_BINDIR)g++$(GCC_VERSION)LINKER_OUTPUT = -oLIBS += -lpthread -lm -lnsl# Options to force single-pass linker to search undefined references repeatly.# Note. '-Wl,' option cannot be used instead of -XlinkerLD_START_GROUP = -Xlinker --start-groupLD_END_GROUP = --end-groupAR = $(GNU_TOOLS_BINDIR)arCREATE_LIB = $(AR) -rcsLIB_OUTPUT =RANLIB = $(GNU_TOOLS_BINDIR)ranlib# commands for AR mri scriptMRI_ADD = 'ADDMOD 'MRI_CREATE = 'CREATE 'MRI_SAVE = 'SAVE'MRI_OPT = -M <ASM = $(GNU_TOOLS_BINDIR)asASM_FLAGS = -WASM_OUTPUT = -oASMGEN_OPTIONS += +GenerateGNUCodeifneq ($(TARGET_VM), cdc_vm)# CDC port is not yet clear of warnings.ifneq ($(TARGET_OS), javacall)# javacall is not clear of warningsEXTRA_CFLAGS += -Werrorendifendifinclude $(MIDP_DIR)/build/common/makefiles/gcc-warnings.gmkEXTRA_CFLAGS += -DGCCifeq ($(TARGET_VM), cdc_vm)ifneq ($(CVM_STATICLINK_LIBS), true)LD_FLAGS += -sharedendifendififeq ($(USE_NATIVE_PROFILER), true)EXTRA_CFLAGS += -pgLD_FLAGS += -pgendififeq ($(USE_GCOV), true)EXTRA_CFLAGS += -O0 -fprofile-arcs -ftest-coverageEXTRA_CPPFLAGS += -O0 -fprofile-arcs -ftest-coverageLIBS += -lgcovendififeq ($(USE_DEBUG), true)EXTRA_CFLAGS += -g -D_DEBUGLD_FLAGS += -gelseifneq ($(USE_GCOV), true)EXTRA_CFLAGS += -O3 -fexpensive-optimizationsEXTRA_CPPFLAGS += -fconserve-spaceendififeq ($(USE_NATIVE_PROFILER), false)EXTRA_CFLAGS += -s -fomit-frame-pointerendifendif# command to display information about GCCDISPLAY_CC_VERSION = `$(CC) --version | head -n 1`DISPLAY_CPP_VERSION = `$(CPP) --version | head -n 1`
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -