Index: /trunk/src/kDepPre/kDepPre.c
===================================================================
--- /trunk/src/kDepPre/kDepPre.c	(revision 2954)
+++ /trunk/src/kDepPre/kDepPre.c	(revision 2955)
@@ -465,5 +465,5 @@
     if (!i)
     {
-        depOptimize(fFixCase, 0 /* fQuiet */);
+        depOptimize(fFixCase, 0 /* fQuiet */, NULL /*pszIgnoredExt*/);
         fprintf(pOutput, "%s:", pszTarget);
         depPrint(pOutput);
Index: /trunk/src/kObjCache/kObjCache.c
===================================================================
--- /trunk/src/kObjCache/kObjCache.c	(revision 2954)
+++ /trunk/src/kObjCache/kObjCache.c	(revision 2955)
@@ -1101,5 +1101,5 @@
         FatalMsg("Failed to open dependency file '%s': %s\n", pszFilename, strerror(errno));
 
-    depOptimize(fFixCase, fQuiet);
+    depOptimize(fFixCase, fQuiet, NULL /*pszIgnoredExt*/);
 
     /* Make object file name with unix slashes. */
Index: /trunk/src/kmk/kmkbuiltin/kDepIDB.c
===================================================================
--- /trunk/src/kmk/kmkbuiltin/kDepIDB.c	(revision 2954)
+++ /trunk/src/kmk/kmkbuiltin/kDepIDB.c	(revision 2955)
@@ -865,5 +865,5 @@
     if (!i)
     {
-        depOptimize(fFixCase, fQuiet);
+        depOptimize(fFixCase, fQuiet, NULL /*pszIgnoredExt*/);
         fprintf(pOutput, "%s:", pszTarget);
         depPrint(pOutput);
Index: /trunk/src/kmk/kmkbuiltin/kDepObj.c
===================================================================
--- /trunk/src/kmk/kmkbuiltin/kDepObj.c	(revision 2954)
+++ /trunk/src/kmk/kmkbuiltin/kDepObj.c	(revision 2955)
@@ -974,5 +974,5 @@
 static void usage(const char *a_argv0)
 {
-    printf("usage: %s -o <output> -t <target> [-fqs] <OMF-file>\n"
+    printf("usage: %s -o <output> -t <target> [-fqs] [-e <ignore-ext>] <OMF or COFF file>\n"
            "   or: %s --help\n"
            "   or: %s --version\n",
@@ -992,4 +992,5 @@
     int         fStubs = 0;
     int         fFixCase = 0;
+    const char *pszIgnoreExt = NULL;
     /* Argument parsing. */
     int         fInput = 0;             /* set when we've found input argument. */
@@ -1010,16 +1011,52 @@
         if (argv[i][0] == '-')
         {
+            const char *pszValue;
             const char *psz = &argv[i][1];
-            if (*psz == '-')
+            char chOpt;
+            chOpt = *psz++;
+            if (chOpt == '-')
             {
-                if (!strcmp(psz, "-quiet"))
-                    psz = "q";
-                else if (!strcmp(psz, "-help"))
-                    psz = "?";
-                else if (!strcmp(psz, "-version"))
-                    psz = "V";
+                /* Convert long to short option. */
+                if (!strcmp(psz, "quiet"))
+                    chOpt = 'q';
+                else if (!strcmp(psz, "help"))
+                    chOpt = '?';
+                else if (!strcmp(psz, "version"))
+                    chOpt = 'V';
+                else
+                {
+                    fprintf(stderr, "%s: syntax error: Invalid argument '%s'.\n", argv[0], argv[i]);
+                    usage(argv[0]);
+                    return 2;
+                }
+                psz = "";
             }
 
-            switch (*psz)
+            /*
+             * Requires value?
+             */
+            switch (chOpt)
+            {
+                case 'o':
+                case 't':
+                case 'e':
+                    if (*psz)
+                        pszValue = psz;
+                    else if (++i < argc)
+                        pszValue = argv[i];
+                    else
+                    {
+                        fprintf(stderr, "%s: syntax error: The '-%c' option takes a value.\n", chOpt);
+                        return 2;
+                    }
+                    break;
+
+                default:
+                    pszValue = NULL;
+                    break;
+            }
+
+
+            switch (chOpt)
             {
                 /*
@@ -1028,19 +1065,10 @@
                 case 'o':
                 {
-                    pszOutput = &argv[i][2];
                     if (pOutput)
                     {
                         fprintf(stderr, "%s: syntax error: only one output file!\n", argv[0]);
-                        return 1;
+                        return 2;
                     }
-                    if (!*pszOutput)
-                    {
-                        if (++i >= argc)
-                        {
-                            fprintf(stderr, "%s: syntax error: The '-o' argument is missing the filename.\n", argv[0]);
-                            return 1;
-                        }
-                        pszOutput = argv[i];
-                    }
+                    pszOutput = pszValue;
                     if (pszOutput[0] == '-' && !pszOutput[1])
                         pOutput = stdout;
@@ -1065,14 +1093,5 @@
                         return 1;
                     }
-                    pszTarget = &argv[i][2];
-                    if (!*pszTarget)
-                    {
-                        if (++i >= argc)
-                        {
-                            fprintf(stderr, "%s: syntax error: The '-t' argument is missing the target name.\n", argv[0]);
-                            return 1;
-                        }
-                        pszTarget = argv[i];
-                    }
+                    pszTarget = pszValue;
                     break;
                 }
@@ -1102,4 +1121,18 @@
                 {
                     fStubs = 1;
+                    break;
+                }
+
+                /*
+                 * Extension to ignore.
+                 */
+                case 'e':
+                {
+                    if (pszIgnoreExt)
+                    {
+                        fprintf(stderr, "%s: syntax error: The '-e' option can only be used once!\n");
+                        return 2;
+                    }
+                    pszIgnoreExt = pszValue;
                     break;
                 }
@@ -1121,5 +1154,5 @@
                     fprintf(stderr, "%s: syntax error: Invalid argument '%s'.\n", argv[0], argv[i]);
                     usage(argv[0]);
-                    return 1;
+                    return 2;
             }
         }
@@ -1179,5 +1212,5 @@
     if (!i)
     {
-        depOptimize(fFixCase, fQuiet);
+        depOptimize(fFixCase, fQuiet, pszIgnoreExt);
         fprintf(pOutput, "%s:", pszTarget);
         depPrint(pOutput);
Index: /trunk/src/lib/kDep.c
===================================================================
--- /trunk/src/lib/kDep.c	(revision 2954)
+++ /trunk/src/lib/kDep.c	(revision 2955)
@@ -187,11 +187,12 @@
  * 'Optimizes' and corrects the dependencies.
  */
-void depOptimize(int fFixCase, int fQuiet)
+void depOptimize(int fFixCase, int fQuiet, const char *pszIgnoredExt)
 {
     /*
      * Walk the list correct the names and re-insert them.
      */
-    PDEP pDepOrg = g_pDeps;
-    PDEP pDep = g_pDeps;
+    size_t  cchIgnoredExt = pszIgnoredExt ? strlen(pszIgnoredExt) : 0;
+    PDEP    pDepOrg = g_pDeps;
+    PDEP    pDep = g_pDeps;
     g_pDeps = NULL;
     for (; pDep; pDep = pDep->pNext)
@@ -214,4 +215,12 @@
             continue;
         pszFilename = pDep->szFilename;
+
+        /*
+         * Skip pszIgnoredExt if given.
+         */
+        if (   pszIgnoredExt
+            && pDep->cchFilename > cchIgnoredExt
+            && memcmp(&pDep->szFilename[pDep->cchFilename - cchIgnoredExt], pszIgnoredExt, cchIgnoredExt) == 0)
+            continue;
 
 #if K_OS != K_OS_OS2 && K_OS != K_OS_WINDOWS
Index: /trunk/src/lib/kDep.h
===================================================================
--- /trunk/src/lib/kDep.h	(revision 2954)
+++ /trunk/src/lib/kDep.h	(revision 2955)
@@ -48,5 +48,5 @@
 
 extern PDEP depAdd(const char *pszFilename, size_t cchFilename);
-extern void depOptimize(int fFixCase, int fQuiet);
+extern void depOptimize(int fFixCase, int fQuiet, const char *pszIgnoredExt);
 extern void depPrint(FILE *pOutput);
 extern void depPrintStubs(FILE *pOutput);
