diff dmd/mars.c @ 580:7824c21a58e3

Restructure path handling a bit. Fixes #66.
author Christian Kamm <kamm incasoftware de>
date Sat, 06 Sep 2008 12:27:27 +0200
parents 91d436eaedee
children 12bda38ea366
line wrap: on
line diff
--- a/dmd/mars.c	Fri Sep 05 23:02:18 2008 +0200
+++ b/dmd/mars.c	Sat Sep 06 12:27:27 2008 +0200
@@ -455,11 +455,11 @@
 			global.params.preservePaths = 1;
 			break;
 
-            case 'q':
-            if (p[3])
-                goto Lerror;
-            global.params.fqnPaths = 1;
-            break;
+		    case 'q':
+			if (p[3])
+			    goto Lerror;
+			global.params.fqnNames = 1;
+			break;
 
 		    case 0:
 			error("-o no longer supported, use -of or -od");
@@ -982,8 +982,6 @@
 	id = new Identifier(name, 0);
 	m = new Module((char *) files.data[i], id, global.params.doDocComments, global.params.doHdrGeneration);
 	modules.push(m);
-
-	global.params.objfiles->push(m->objfile->name->str);
     }
 
     // Read files, parse them
@@ -995,9 +993,10 @@
 	if (!Module::rootModule)
 	    Module::rootModule = m;
 	m->importedFrom = m;
-	m->deleteObjFile();
 	m->read(0);
 	m->parse();
+	m->buildTargetFiles();
+	m->deleteObjFile();
 	if (m->isDocFile)
 	{
 	    m->gendocfile();
@@ -1005,19 +1004,6 @@
 	    // Remove m from list of modules
 	    modules.remove(i);
 	    i--;
-
-	    // Remove m's object file from list of object files
-	    for (int j = 0; j < global.params.objfiles->dim; j++)
-	    {
-		if (m->objfile->name->str == global.params.objfiles->data[j])
-		{
-		    global.params.objfiles->remove(j);
-		    break;
-		}
-	    }
-
-	    if (global.params.objfiles->dim == 0)
-		global.params.link = 0;
 	}
     }
     if (global.errors)
@@ -1120,7 +1106,10 @@
 	if (global.params.verbose)
 	    printf("code      %s\n", m->toChars());
 	if (global.params.obj)
+	{
 	    m->genobjfile(0);
+	    global.params.objfiles->push(m->objfile->name->str);
+	}
 	if (global.errors)
 	    m->deleteObjFile();
 	else