# (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. "/Other # Metrowerks Tools/Command Line Tools/cwenv.bat") to set up the appropriate # environment, set up environment variables by hand as described in # "/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. #//Metro-
werks
Code-
Warrior
# 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 ; flags metrowerks C++FLAGS ; flags metrowerks DEFINES ; flags metrowerks UNDEFS ; flags metrowerks HDRS ; flags metrowerks STDHDRS ; flags metrowerks LINKFLAGS ; flags metrowerks ARFLAGS ; flags metrowerks CFLAGS on : -g ; flags metrowerks LINKFLAGS on : -g ; flags metrowerks LINKFLAGS $(SHARED_TYPES) : -shared ; flags metrowerks CFLAGS off : -O0 ; flags metrowerks CFLAGS speed : -opt full ; flags metrowerks CFLAGS space : -O4,s "-opt intrinsics" ; flags metrowerks CFLAGS off : -inline off ; flags metrowerks CFLAGS on : -inline on ; flags metrowerks CFLAGS full : -inline auto -inline level=8 ; flags metrowerks CFLAGS console/dynamic : -prefix UseDLLPrefix.h ; if ! $(BOOST_CODEWARRIOR_6) { flags metrowerks STDLIBS static/release : MSL_C_x86.lib;MSL_Runtime_x86.lib;msl_c++_x86.lib;gdi32.lib;user32.lib;kernel32.lib ; flags metrowerks STDLIBS dynamic/release : MSL_All-DLL_x86.lib;gdi32.lib;user32.lib;kernel32.lib ; flags metrowerks STDLIBS static/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 dynamic/debug : MSL_All-DLL_x86_D.lib;gdi32.lib;user32.lib;kernel32.lib ; } else { flags metrowerks STDLIBS static : ansicx86.lib;mwcrtl.lib;ansicppx86.lib;gdi32.lib;user32.lib;kernel32.lib ; flags metrowerks STDLIBS dynamic : mwcrtldll.lib;gdi32.lib;user32.lib;kernel32.lib ; } flags metrowerks LIBPATH ; flags metrowerks NEEDLIBS ; flags metrowerks FINDLIBS ; # 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 20 -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 20 -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 20 -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 "$(<)" @"$(>)" }