Merge CfgProcess and CfgAssignSegments because both do some sort of

postprocessing. Print a warning if %O was used in the config file and the
output file name is changed later using -o.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4842 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2010-11-09 21:01:27 +00:00
parent c9b9069208
commit a2b7ef2b08
6 changed files with 49 additions and 37 deletions

View File

@@ -449,6 +449,21 @@ static void OptObjPath (const char* Opt attribute ((unused)), const char* Arg)
static void OptOutputName (const char* Opt, const char* Arg)
/* Give the name of the output file */
{
/* If the name of the output file has been used in the config before
* (by using %O) we're actually changing it later, which - in most cases -
* gives unexpected results, so emit a warning in this case.
*/
if (OutputNameUsed) {
Warning ("Option `%s' should preceede options `-t' or `-C'", Opt);
}
OutputName = Arg;
}
static void OptStartAddr (const char* Opt, const char* Arg)
/* Set the default start address */
{
@@ -574,7 +589,7 @@ int main (int argc, char* argv [])
break;
case 'o':
OutputName = GetArg (&I, 2);
OptOutputName (Arg, GetArg (&I, 2));
break;
case 't':
@@ -652,14 +667,11 @@ int main (int argc, char* argv [])
/* Create the condes tables if requested */
ConDesCreate ();
/* Process data from the config file */
CfgProcess ();
/* Assign start addresses for the segments, define linker symbols. The
* function will return the number of memory area overflows (zero on
* success).
/* Process data from the config file. Assign start addresses for the
* segments, define linker symbols. The function will return the number
* of memory area overflows (zero on success).
*/
MemoryAreaOverflows = CfgAssignSegments ();
MemoryAreaOverflows = CfgProcess ();
/* Check module assertions */
CheckAssertions ();