📄 metrowerks-tools.jam
字号:
# (C) Copyright David Abrahams 2001. Permission to copy, use,
# modify, sell and distribute this software is granted provided this
# copyright notice appears in all copies. This software is provided
# "as is" without express or implied warranty, and with no claim as
# to its suitability for any purpose.
# You can either use Metrowerks-supplied scripts (e.g. "<CodeWarrior>/Other
# Metrowerks Tools/Command Line Tools/cwenv.bat") to set up the appropriate
# environment, set up environment variables by hand as described in
# "<CodeWarrior>/Release Notes/CLT Notes/CLT_Usage_Notes.txt", or you can define
# METROWERKS_ROOT to be the metrowerks installation directory, and cwenv.bat
# will be invoked before each tool invocation.
# We go this route because the environment needed to run the metrowerks tools
# from the command-line is sufficiently complex to make using the borland
# approach impractical.
# The following #// line will be used by the regression test table generation
# program as the column heading for HTML tables. Must not include version number.
#//<a href="http://www.metrowerks.com/MW/Develop/Desktop/default.htm">Metro-<br>werks<br>Code-<br>Warrior</a>
# singleton variables...
set-as-singleton METROWERKS_ROOT CWFOLDER ;
# Get these variable set on the targets so that we can re-use the
# build actions for other toolsets using this one as a base.
flags metrowerks METROWERKS_SETUP ;
flags metrowerks METROWERKS_LINK_SETUP ;
# if METROWERKS_ROOT is unset, this will "multiply away" to nothing.
METROWERKS_SETUP = "call "\"$(METROWERKS_ROOT)$(SLASH)"Other Metrowerks Tools"$(SLASH)"Command Line Tools"$(SLASH)cwenv.bat\"" -quiet" ;
METROWERKS_LINK_SETUP = "set MWWinx86LibraryFiles=" ;
flags metrowerks CFLAGS <cflags> ;
flags metrowerks C++FLAGS <cxxflags> ;
flags metrowerks DEFINES <define> ;
flags metrowerks UNDEFS <undef> ;
flags metrowerks HDRS <include> ;
flags metrowerks STDHDRS <sysinclude> ;
flags metrowerks LINKFLAGS <linkflags> ;
flags metrowerks ARFLAGS <arflags> ;
flags metrowerks CFLAGS <debug-symbols>on : -g ;
flags metrowerks LINKFLAGS <debug-symbols>on : -g ;
flags metrowerks LINKFLAGS <target-type>$(SHARED_TYPES) : -shared ;
flags metrowerks CFLAGS <optimization>off : -O0 ;
flags metrowerks CFLAGS <optimization>speed : -opt full ;
flags metrowerks CFLAGS <optimization>space : -O4,s "-opt intrinsics" ;
flags metrowerks CFLAGS <inlining>off : -inline off ;
flags metrowerks CFLAGS <inlining>on : -inline on ;
flags metrowerks CFLAGS <inlining>full : -inline auto -inline level=8 ;
flags metrowerks CFLAGS <user-interface>console/<runtime-link>dynamic : -prefix UseDLLPrefix.h ;
flags metrowerks LINKFLAGS <user-interface>console : "-subsystem console" ;
flags metrowerks LINKFLAGS <user-interface>gui : "-subsystem windows" ;
flags metrowerks LINKFLAGS <user-interface>wince : "-subsystem wince" ;
flags metrowerks LINKFLAGS <user-interface>native : "-subsystem native" ;
flags metrowerks LINKFLAGS <user-interface>auto : "-subsystem auto" ;
flags metrowerks CFLAGS <eh-model>msvc : -exc ms ;
if ! $(BOOST_CODEWARRIOR_6)
{
flags metrowerks STDLIBS <runtime-link>static/<runtime-build>release : MSL_C_x86.lib;MSL_Runtime_x86.lib;msl_c++_x86.lib;gdi32.lib;user32.lib;kernel32.lib ;
flags metrowerks STDLIBS <runtime-link>dynamic/<runtime-build>release : MSL_All-DLL_x86.lib;gdi32.lib;user32.lib;kernel32.lib ;
flags metrowerks STDLIBS <runtime-link>static/<runtime-build>debug : MSL_C_x86_D.lib;MSL_Runtime_x86_D.lib;msl_c++_x86_D.lib;gdi32.lib;user32.lib;kernel32.lib ;
flags metrowerks STDLIBS <runtime-link>dynamic/<runtime-build>debug : MSL_All-DLL_x86_D.lib;gdi32.lib;user32.lib;kernel32.lib ;
}
else
{
flags metrowerks STDLIBS <runtime-link>static : ansicx86.lib;mwcrtl.lib;ansicppx86.lib;gdi32.lib;user32.lib;kernel32.lib ;
flags metrowerks STDLIBS <runtime-link>dynamic : mwcrtldll.lib;gdi32.lib;user32.lib;kernel32.lib ;
}
flags metrowerks LIBPATH <library-path> ;
flags metrowerks NEEDLIBS <library-file> ;
flags metrowerks FINDLIBS <find-library> ;
# How will we find metrowerks standard headers?
# If the user specified METROWERKS_ROOT, use that
# Otherwise, look at the "standard" environment variable CWFOLDER
METROWERKS_INCLUDE_ROOT = $(METROWERKS_ROOT) ;
METROWERKS_INCLUDE_ROOT ?= $(CWFOLDER) ;
#### Link ####
rule Link-action
{
gRUN_PATH($(<)) += $(METROWERKS_INCLUDE_ROOT)"\\Win32-X86 Support\\Libraries\\Runtime"
$(METROWERKS_INCLUDE_ROOT)"\\Win32-X86 Support\\Libraries\\Runtime\\Libs\\MSL_ALL-DLLs" ;
IMPLIB_COMMAND on $(<) = "-implib " ; # will be "multiplied away" if not
# needed.
with-command-file metrowerks-Link-action $(<) : $(>) $(NEEDLIBS)
;
}
# Here we set the environment variable MWWinx86LibraryFiles (customize for other
# platforms) because the alternatives for getting the right libraries on the
# command-line would produce enormous paths in the command-line, obscuring what
# really happens.
actions metrowerks-Link-action
{
$(METROWERKS_SETUP)
$(METROWERKS_LINK_SETUP)$(STDLIBS)
mwld -search -maxerrors 5 -maxwarnings 20 -export dllexport -nowraplines $(LINKFLAGS) -L$(LIBPATH) -L$(STDLIBPATH) $(IMPLIB_COMMAND)"$(<[2])" -o "$(<[1])" @"$(>)" $(FINDLIBS)$(SUFLIB)
}
#### Cc #####
rule Cc-action
{
metrowerks-Cc-action $(<) : $(>) ;
}
actions metrowerks-Cc-action
{
$(METROWERKS_SETUP)
mwcc -maxerrors 5 -maxwarnings 20 -c -warn on,nounusedexpr,nounused -cwd include -U$(UNDEFS) -D$(DEFINES) -nowraplines $(CFLAGS) -I"$(HDRS)" -I- -I"$(STDHDRS)" -o "$(<)" "$(>)"
}
#### C++ ####
rule C++-action
{
metrowerks-C++-action $(<) : $(>) ;
}
actions metrowerks-C++-action
{
$(METROWERKS_SETUP)
mwcc -maxerrors 5 -maxwarnings 20 -c -warn on,nounusedexpr,nounused -cwd include -U$(UNDEFS) -D$(DEFINES) -DNOMINMAX -nowraplines -lang c++ $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I- -I"$(STDHDRS)" -o "$(<)" "$(>)"
}
#### Archive ####
rule Archive-action
{
with-command-file metrowerks-Archive-action $(<) : $(>) ;
}
actions together metrowerks-Archive-action
{
$(METROWERKS_SETUP)
mwld -library $(ARFLAGS) -o "$(<)" @"$(>)"
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -