# MAKHELP.PM
#
# Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
#


package Makhelp;
require Exporter;
@ISA=qw(Exporter);
@EXPORT=qw(
	Help_InvocationL
	Help_Mmp
);


use E32tpver;
# also requires main module to have loaded platform module(s) and Modload.pm

sub Help_InvocationL () {

	print
		"\n",
		"MAKMAKE - Makefile Creation Utility (Build ",&E32tpver,")\n",
		"\n",
		"MAKMAKE {flags} [{MMPFilePath}MMPFileRoot] [Platform]\n",
		"\n",
		"Flags: (case insensitive)\n",
		" /CLEAN          ->  delete all project's non-source files\n",
		" /D              ->  put TargetMakeFile in default directory\n",
		"                                 \\EPOC32\\MAKE\\[platform]\n",
		" /MAKEWORK       ->  make the work directories, not the MakeFile\n",
		" /MMP {platform} ->  basic mmp syntax\n",
		" /V              ->  verbose mode\n",
		"\n"
	;

	my @CallablePlats;
	eval { @CallablePlats=&main::Load_PlatModListL; };
	die $@ if $@;
	print
		"Available Platforms: (case insensitive)\n",
		" @CallablePlats\n"
	;

}


sub Help_Mmp ($) {
	my $Plat='';
	if ($_[0]) {
		$Plat=$_[0];
	}

	print
		"\n",
		"Makmake Project File - Basic Syntax\n",
		"\n",
		"/* Use C++ comments if required */\n",
		"\n",
		"AIF                    [subproject-relative aif]\n",
		"DEFFILE                [{path}deffile]\n",
		"DOCUMENT               [subproject-relative documents]\n",
		"EPOCALLOWDLLDATA\n",
		"EPOCCALLDLLENTRYPOINTS\n",
		"EPOCDATALINKADDRESS    [relocation address]\n",
		"EPOCFIXEDPROCESS\n",
		"EPOCHEAPSIZE           [min size][max size]\n",
		"EPOCPROCESSPRIORITY    [low|background|foreground|high|windowserver|\n",
		"                                  fileserver|realtimeserver|supervisor]\n",
		"EPOCSTACKSIZE          [stack size]\n",
		"LANG                   [languages (defaults to SC)]\n",
		"LIBRARY                [libraries]\n",
		"LINKAS                 [executable name if different from TARGET]\n",
		"LONGBLDPATH            [{extra dir in bldpath}]\n",
		"NOSTRICTDEF\n",
		"OBJECT                 [object basenames]\n",
		"PROJECT                [project]\n",
		"RESOURCE               [subproject-relative resources]\n",
		"SOURCE                 [subproject-relative sources]\n",
		"STRICTDEPEND\n",
		"SUBPROJECT             [subproject]\n",
		"SYSTEMINCLUDE          [system include path]\n",
		"SYSTEMRESOURCE         [subproject-relative system resources]\n",
		"TARGET                 [target]\n",
		"TARGETPATH             [emulated path on target machine]\n",
		"TARGETTYPE             [app|dll|exe|exedll|fsy|ldd|pdd]\n",
		"UID                    [uid2 {uid3}]\n",
		"UNICODEUID             [unicode uid2 {unicode uid3}]\n",
		"USERINCLUDE            [user include path - source dir searched first always]\n",
		"\n",
		"#if defined([PLATFORM])\n",
		"[universal keyword statements restricted to [PLATFORM] ]\n",
		"#endif\n",
		"\n",
		"START [PLATFORM]\n",
		"[platform-specific keyword statements]\n",
		"END\n",
		"\n"
	;

	if ($Plat) {
	
		# Get platform specific mmp syntax
		my $But=0;
		my @MmpMacros=();
		if (defined &main::PMGetResetPlatName) {
			push @MmpMacros, &main::PMGetResetPlatName;
			$But=1;
		}
		else {
			push @MmpMacros, $Plat;
		}
		if (defined &main::PMGetExtraMmpMacros) {
			push @MmpMacros, &main::PMGetExtraMmpMacros;
			$But=1;
		}
		print "// THIS PLATFORM -> $Plat\n";
		print "//";
		if ($But) {
			print " BUT";
		}
		print " MMP PLATFORM MACROS -> @MmpMacros\n",
			"\n"
		;
		print "START [MACRO]\n";
		&main::PMHelp_Mmp if defined &main::PMHelp_Mmp;
		print
			"END",
			"\n";
	}
}

1;
