sbsv1/abld/makmake/makhelp.pm
changeset 629 541af5ee3ed9
parent 599 fa7a3cc6effd
equal deleted inserted replaced
628:7c4a911dc066 629:541af5ee3ed9
       
     1 # Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of "Eclipse Public License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Nokia Corporation - initial contribution.
       
    10 #
       
    11 # Contributors:
       
    12 #
       
    13 # Description:
       
    14 #
       
    15 
       
    16 
       
    17 package Makhelp;
       
    18 require Exporter;
       
    19 @ISA=qw(Exporter);
       
    20 @EXPORT=qw(
       
    21 	Help_Invocation
       
    22 	Help_Mmp
       
    23 	Help_Plat
       
    24 );
       
    25 
       
    26 
       
    27 use E32tpver;
       
    28 use featurevariantparser;
       
    29 # also requires main module to have loaded platform module(s) and Modload.pm and Trgtype.pm
       
    30 
       
    31 sub Help_Invocation () {
       
    32 
       
    33 	print
       
    34 		"\n",
       
    35 		"MAKMAKE - Makefile Creation Utility (Build ",&E32tpver,")\n",
       
    36 		"\n",
       
    37 		"MAKMAKE {flags} [{MMPFilePath}MMPFileRoot] [Platform[.Feature Variant]]\n",
       
    38 		"\n",
       
    39 		"Flags: (case insensitive)\n",
       
    40 		" -D               -> create makefile in ", $E32env::Data{BldPath}, "[project]\\[platform]\\\n",
       
    41 		" -MMP             -> information - basic mmp syntax\n",
       
    42 		" -PLAT [platform] -> information - platform-specific mmp syntax\n",
       
    43 		" -V               -> verbose mode\n",
       
    44 		" -ND              -> generate no dependencies info\n",
       
    45 		" -[debug|no_debug]-> enable/disable generation of symbolic debug information for ARM ABI compliant platforms\n",
       
    46 		" -LOGFC           -> enable function call logging\n",
       
    47 		" -INVARIANT       -> force default feature variant processing only, unless FEATUREVARIANT is present in the .mmp file\n",
       
    48 		"\n"
       
    49 	;
       
    50 
       
    51 	my @Plats=&main::Plat_List;
       
    52 	print
       
    53 		"Available Platforms: (case insensitive)\n",
       
    54 		" @Plats\n"
       
    55 	;
       
    56 
       
    57 	my @BuildableFeatureVariants=featurevariantparser->GetBuildableFeatureVariants();
       
    58 	if (@BuildableFeatureVariants)
       
    59 		{
       
    60 		@BuildableFeatureVariants = map{uc($_)} @BuildableFeatureVariants;
       
    61 
       
    62 		print
       
    63 			"\nAvailable Feature Variants for Supporting Platforms: (case insensitive)\n",
       
    64 			" @BuildableFeatureVariants\n"
       
    65 		;
       
    66 		}
       
    67 }
       
    68 
       
    69 sub Help_Mmp () {
       
    70 
       
    71 	my @TrgTypes=&main::Trg_List;
       
    72 	my $TrgTypes='TARGETTYPE             [';
       
    73 	my $Spacing=length($TrgTypes);
       
    74 	my $LineLen=$Spacing;
       
    75 	foreach (@TrgTypes) {
       
    76 		$TrgTypes.=$_.'|';
       
    77 		$LineLen+=(length($_)+1);
       
    78 		if ($LineLen>($Spacing+50)) {
       
    79 			$TrgTypes.="\n".(' 'x$Spacing);
       
    80 			$LineLen=$Spacing;
       
    81 		}
       
    82 	}
       
    83 	chop $TrgTypes;
       
    84 	$TrgTypes.=']';
       
    85 
       
    86 	print <<ENDHERE;
       
    87 
       
    88 Makmake Project File - Basic Syntax
       
    89 
       
    90 /* Use C++ comments if required */
       
    91 START BITMAP           [target]
       
    92 TARGETPATH             [emulated_path_on_target_machine]
       
    93 HEADER
       
    94 SOURCEPATH             [.mmp-relative_source_path (default - .mmp_dir)]
       
    95 SOURCE                 [color_depth] [source_bitmaps]
       
    96 END
       
    97 
       
    98 START RESOURCE         [source]
       
    99 TARGET                 [target (default - source)]
       
   100 TARGETPATH             [emulated_path_on_target_machine]
       
   101 HEADER
       
   102 LANG                   [languages (overrides global LANG)]
       
   103 UID                    [uid(s) for resource file]
       
   104 END
       
   105 
       
   106 START STRINGTABLE      [source]
       
   107 EXPORTPATH             [location]
       
   108 HEADERONLY             [export only header file]
       
   109 END
       
   110 
       
   111 AIF                    [target] [src_path] [resource] {[color_depth] [bitmaps]}
       
   112 ALWAYS_BUILD_AS_ARM
       
   113 ARMFPU                 [SOFTVFP | VFPV2]
       
   114 ASSPABI
       
   115 ASSPEXPORTS
       
   116 ASSPLIBRARY            [ASSP_libraries]
       
   117 BYTEPAIRCOMPRESSTARGET
       
   118 CAPABILITY             [NONE | list of {-}CAPABILITY_NAME]
       
   119 COMPRESSTARGET
       
   120 DEBUGGABLE             [Executable can be debugged in a running system]
       
   121 DEBUGGABLE_UDEBONLY    [Only Debug (UDEB) executables can be debugged in a running system]
       
   122 DEBUGLIBRARY           [libraries - use in addition to LIBRARY for DEBUG builds]
       
   123 
       
   124 DEFFILE                [{path}{deffile} (default -
       
   125                           \[project]\B[platform]\[target basename].DEF)
       
   126                         If the path ends in \~\ the ~ is replace by B[platform] ]
       
   127 
       
   128 DOCUMENT               [sourcepath-relative_documents]
       
   129 EPOCALLOWDLLDATA
       
   130 EPOCCALLDLLENTRYPOINTS
       
   131 EPOCDATALINKADDRESS    [relocation_address]
       
   132 EPOCFIXEDPROCESS
       
   133 EPOCHEAPSIZE           [min_size][max_size]
       
   134 EPOCPROCESSPRIORITY    [PRIORITY_NAME]
       
   135 EPOCSTACKSIZE          [stack_size]
       
   136 EXPORTLIBRARY          [executables export library name if different from TARGET]
       
   137 EXPORTUNFROZEN
       
   138 FIRSTLIB               [first link object - overrides EEXE.LIB or EDLL.LIB]
       
   139 FEATUREVARIANT         [process for all variants when '-invariant' is used in MAKMAKE calls]
       
   140 INFLATECOMPRESSTARGET
       
   141 LANG                   [languages (defaults to SC)]
       
   142 LIBRARY                [libraries]
       
   143 LINKAS                 [executable's linking name if different from TARGET]
       
   144 LINKEROPTION           [COMPILER] [rest of line is linker options]
       
   145 MACRO                  [user-defined_macros]
       
   146 NEWLIB                 [override default operator new/operator delete library]
       
   147 NOCOMPRESSTARGET
       
   148 NOEXPORTLIBRARY        [don't generate an export library]
       
   149 NOSTRICTDEF
       
   150 OPTION                 [COMPILER] [rest of line is extra compiler options]
       
   151 OPTION_REPLACE         [oldComplierOption] [newOption]
       
   152 PAGED
       
   153 PAGEDCODE
       
   154 PAGEDDATA
       
   155 RAMTARGET              // syntax not yet finalized
       
   156 RESOURCE               [sourcepath-relative_resources]
       
   157 ROMTARGET              // syntax not yet finalized
       
   158 SECUREID               [secure ID]
       
   159 SMPSAFE                [mark executable as SMP safe]
       
   160 SOURCE                 [sourcepath-relative_sources]
       
   161 SOURCEPATH             [.mmp relative_source_path (default - .mmp_dir]
       
   162 SRCDBG
       
   163 STATICLIBRARY          [static_libraries]
       
   164 STDCPP
       
   165 NOSTDCPP
       
   166 STRICTDEPEND
       
   167 SYSTEMINCLUDE          [system_include_path]
       
   168 SYSTEMRESOURCE         [sourcepath-relative_system_resources]
       
   169 TARGET                 [target]
       
   170 TARGETPATH             [emulated_path_on_target_machine]
       
   171 $TrgTypes
       
   172 UID                    [uid2|0 {uid3}]
       
   173 UNPAGED
       
   174 UNPAGEDCODE
       
   175 UNPAGEDDATA
       
   176 USERINCLUDE            [user_include_path - source_dir searched first always]
       
   177 VENDORID               [vendorid]
       
   178 VERSION                [MAJOR.minor {explicit} - specify version number of
       
   179                          the target. If EXPLICIT specified decorate target
       
   180                          filename and DEF file name with version.]
       
   181 WCHARENTRYPOINT
       
   182 
       
   183 #if defined([PLATFORM])
       
   184 [universal keyword statements restricted to [PLATFORM] ]
       
   185 #endif
       
   186 
       
   187 START [PLATFORM]
       
   188 [platform-specific keyword statements]
       
   189 // use MAKMAKE /PLAT [PLATFORM] to display these
       
   190 END
       
   191 
       
   192 ENDHERE
       
   193 
       
   194 }
       
   195 
       
   196 sub Help_Plat ($$$$$) {
       
   197 	my ($Plat,$CPU,$DefFile,$MmpMacrosRef, $MacrosRef)=@_;
       
   198 
       
   199 #	list of source macros is incomplete in this function.  It may also contain:
       
   200 #	__MARM_<ABI>__ if the platform CPU is MARM - (ABI may vary according to .MMP contents though)
       
   201 #	Any macros defined in the .MMP file
       
   202 #	__DLL__ or __EXE__ respectively if the $BasicTrgType is DLL or EXE
       
   203 #	WIN32 and _WINDOWS if the project links to Win32 libraries
       
   204 #
       
   205 #	Furthermore, build macros _UNICODE, _DEBUG or _NDEBUG aren't listed - the _UNICODE
       
   206 #	macro should probably be defined as a permanent macro now that we're not doing Narrow
       
   207 #	builds anymore.
       
   208 
       
   209 	$DefFile= 'B'.$DefFile unless ($DefFile eq 'EABI');
       
   210 	print
       
   211 		"\n",
       
   212 		"Makmake Project File - Platform-specific Syntax\n",
       
   213 		"\n",
       
   214 		"// Platform   -> $Plat\n",
       
   215 		"// Default_Def_Dir -> \\[project]\\$DefFile\\\n",
       
   216 		"// MMP_Macros -> @$MmpMacrosRef\n",
       
   217 		"// Source_Macros -> @$MacrosRef (+ others)\n",
       
   218 		"\n",
       
   219 		"START [MMP_Macro]\n"
       
   220 	;
       
   221 	&main::PMHelp_Mmp if defined &main::PMHelp_Mmp;
       
   222 	print "END\n";
       
   223 }
       
   224 
       
   225 1;