]> git.sur5r.net Git - cc65/blobdiff - src/ld65/main.c
Corrected indentation - no code change.
[cc65] / src / ld65 / main.c
index 7821cdd7b8b1f1b7aec4f11c7350d059b3a6a06f..10fff402e6c05a0d484397405ca2996453822e1f 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                          */
 /*                                                                          */
 /*                                                                          */
-/* (C) 1998-2009, Ullrich von Bassewitz                                      */
+/* (C) 1998-2010, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -105,6 +105,7 @@ static void Usage (void)
             "  -m name\t\tCreate a map file\n"
             "  -o name\t\tName the default output file\n"
             "  -t sys\t\tSet the target system\n"
+            "  -u sym\t\tForce an import of symbol `sym'\n"
             "  -v\t\t\tVerbose mode\n"
             "  -vm\t\t\tVerbose map file\n"
             "\n"
@@ -176,11 +177,11 @@ static void LinkFile (const char* Name, FILETYPE Type)
     switch (Type) {
 
         case FILETYPE_LIB:
-            PathName = SearchFile (Name, SEARCH_LIB);
+            PathName = SearchFile (LibSearchPath, Name);
             break;
 
         case FILETYPE_OBJ:
-            PathName = SearchFile (Name, SEARCH_OBJ);
+            PathName = SearchFile (ObjSearchPath, Name);
             break;
 
         default:
@@ -281,7 +282,7 @@ static void DefineSymbol (const char* Def)
 static void OptCfgPath (const char* Opt attribute ((unused)), const char* Arg)
 /* Specify a config file search path */
 {
-    AddSearchPath (Arg, SEARCH_CFG);
+    AddSearchPath (CfgSearchPath, Arg);
 }
 
 
@@ -295,7 +296,7 @@ static void OptConfig (const char* Opt attribute ((unused)), const char* Arg)
        Error ("Cannot use -C/-t twice");
     }
     /* Search for the file */
-    PathName = SearchFile (Arg, SEARCH_CFG);
+    PathName = SearchFile (CfgSearchPath, Arg);
     if (PathName == 0) {
         Error ("Cannot find config file `%s'", Arg);
     } else {
@@ -353,7 +354,7 @@ static void OptForceImport (const char* Opt attribute ((unused)), const char* Ar
     if (ColPos == 0) {
 
         /* Use default address size (which for now is always absolute
-         * addressing) 
+         * addressing)
          */
         InsertImport (GenImport (Arg, ADDR_SIZE_ABS));
 
@@ -404,7 +405,7 @@ static void OptLib (const char* Opt attribute ((unused)), const char* Arg)
 static void OptLibPath (const char* Opt attribute ((unused)), const char* Arg)
 /* Specify a library file search path */
 {
-    AddSearchPath (Arg, SEARCH_LIB);
+    AddSearchPath (LibSearchPath, Arg);
 }
 
 
@@ -440,7 +441,7 @@ static void OptObj (const char* Opt attribute ((unused)), const char* Arg)
 static void OptObjPath (const char* Opt attribute ((unused)), const char* Arg)
 /* Specify an object file search path */
 {
-    AddSearchPath (Arg, SEARCH_OBJ);
+    AddSearchPath (ObjSearchPath, Arg);
 }
 
 
@@ -489,8 +490,8 @@ static void OptVersion (const char* Opt attribute ((unused)),
 /* Print the assembler version */
 {
     fprintf (stderr,
-                    "ld65 V%u.%u.%u - (C) Copyright 1998-2005 Ullrich von Bassewitz\n",
-            VER_MAJOR, VER_MINOR, VER_PATCH);
+                    "ld65 V%s - (C) Copyright 1998-2009, Ullrich von Bassewitz\n",
+            GetVersionAsString ());
 }
 
 
@@ -572,16 +573,20 @@ int main (int argc, char* argv [])
 
                case 't':
                    if (CfgAvail ()) {
-                       Error ("Cannot use -C/-t twice");
+                       Error ("Cannot use -C/-t twice");
                    }
                    OptTarget (Arg, GetArg (&I, 2));
                    break;
 
+                case 'u':
+                    OptForceImport (Arg, GetArg (&I, 2));
+                    break;
+
                case 'v':
                    switch (Arg [2]) {
                        case 'm':   VerboseMap = 1;     break;
-                       case '\0':  ++Verbosity;        break;
-                       default:    UnknownOption (Arg);
+                       case '\0':  ++Verbosity;        break;
+                       default:    UnknownOption (Arg);
                    }
                    break;
 
@@ -596,8 +601,8 @@ int main (int argc, char* argv [])
                case 'L':
                    switch (Arg [2]) {
                         /* ## The first one is obsolete and will go */
-                       case 'n': LabelFileName = GetArg (&I, 3);   break;
-                       default:  OptLibPath (Arg, GetArg (&I, 2)); break;
+                       case 'n': LabelFileName = GetArg (&I, 3);   break;
+                       default:  OptLibPath (Arg, GetArg (&I, 2)); break;
                    }
                    break;