Help-text corrected
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 12 Aug 2001 22:15:42 +0000 (22:15 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 12 Aug 2001 22:15:42 +0000 (22:15 +0000)
delete tmp-files in case of error

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1138 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCglue.c
src/SDCCglue.h
src/SDCCmain.c
src/avr/gen.c

index effbdd6fc431dbeffa75d7eaa9e63ff33a8236a5..f378ab1af21b51a0091d0704ed3e2228fe7fc3fa 100644 (file)
@@ -1512,6 +1512,15 @@ glue ()
   applyToSet (tmpfileNameSet, rmTmpFiles);
 }
 
+#if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER)
+void
+rm_tmpfiles (void)
+{
+  applyToSet (tmpfileSet, closeTmpFiles);
+  applyToSet (tmpfileNameSet, rmTmpFiles);
+}
+#endif
+
 /** Creates a temporary file a'la tmpfile which avoids the bugs
     in cygwin wrt c:\tmp.
     Scans, in order: TMP, TEMP, TMPDIR, else uses tmpfile().
index 3d9683e7681a192c2ea3f1c54360e979727dd821..b8a987203c7963e2a2f01d4400a8118d0033de66 100644 (file)
@@ -36,4 +36,8 @@ void flushStatics (void);
 extern symbol *interrupts[];
 extern set *publics;
 extern set *tmpfileSet;
+
+#if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER)
+void rm_tmpfiles (void);
+#endif
 #endif
index 1be19dfbc8c644c375609e82553372d89c729618..837f9d7df74c1e2be36a1db22330f09b4fa5eeb4 100644 (file)
@@ -131,7 +131,7 @@ optionsTable[] = {
     { 'C',  NULL,                   NULL, "Preprocessor option" },
     { 'M',  NULL,                   NULL, "Preprocessor option" },
     { 'V',  NULL,                   &verboseExec, "Execute verbosely.  Show sub commands as they are run" },
-    { 'S',  NULL,                   &noAssemble, "Assemble only" },
+    { 'S',  NULL,                   &noAssemble, "Compile only; do not assemble or link" },
     { 'W',  NULL,                   NULL, "Pass through options to the assembler (a) or linker (l)" },
     { 'L',  NULL,                   NULL, "Add the next field to the library search path" },
     { 'l',  NULL,                   NULL, "Include the given library in the link" },
@@ -149,7 +149,7 @@ optionsTable[] = {
     { 0,    OPTION_NO_LOOP_IND,     NULL, NULL },
     { 0,    "--nojtbound",          &optimize.noJTabBoundary, "Don't generate boundary check for jump tables" },
     { 0,    "--noloopreverse",      &optimize.noLoopReverse, "Disable the loop reverse optimisation" },
-    { 'c',  "--compile-only",       &options.cc_only, "Compile only, do not assemble or link" },
+    { 'c',  "--compile-only",       &options.cc_only, "Compile and assemble, but do not link" },
     { 0,    "--dumpraw",            &options.dump_raw, "Dump the internal structure after the initial parse" },
     { 0,    "--dumpgcse",           &options.dump_gcse, NULL },
     { 0,    "--dumploop",           &options.dump_loop, NULL },
@@ -312,8 +312,8 @@ printVersionInfo ()
 #ifdef SDCC_SUB_VERSION_STR
           "/" SDCC_SUB_VERSION_STR
 #endif
-#ifdef __CYGWIN32__
-          " (CYGWIN32)\n"
+#ifdef __CYGWIN__
+          " (CYGWIN)\n"
 #else
 #ifdef __DJGPP__
           " (DJGPP) \n"
@@ -1327,6 +1327,9 @@ main (int argc, char **argv, char **envp)
   if ((!options.c1mode && !srcFileName && !nrelFiles) || 
       (options.c1mode && !srcFileName && !options.out_name))
     {
+      #if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER)
+      rm_tmpfiles();
+      #endif
       printUsage ();
       exit (0);
     }
@@ -1391,6 +1394,9 @@ main (int argc, char **argv, char **envp)
               free (preOutName);
             }
           // EndFix
+          #if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER)
+          rm_tmpfiles();
+          #endif
          return 1;
        }
 
@@ -1401,6 +1407,12 @@ main (int argc, char **argv, char **envp)
   if (cdbFile)
     fclose (cdbFile);
 
+  if (preOutName && !options.c1mode)
+    {
+      unlink (preOutName);
+      free (preOutName);
+    }
+
   if (!options.cc_only &&
       !fatalError &&
       !noAssemble &&
@@ -1416,12 +1428,6 @@ main (int argc, char **argv, char **envp)
   if (yyin && yyin != stdin)
     fclose (yyin);
 
-  if (preOutName && !options.c1mode)
-    {
-      unlink (preOutName);
-      free (preOutName);
-    }
-
   return 0;
 
 }
index 72dc91860c96cd72b0e943c29482df51a9c3c223..06258e4f018db076bbaa5f8819728dd17782b3f0 100644 (file)
@@ -37,7 +37,7 @@
 #ifdef HAVE_ENDIAN_H
 #include <endian.h>
 #else
-#if !defined(__BORLANDC__) && !defined(_MSC_VER) && !defined(__MINGW32__)
+#if !defined(__BORLANDC__) && !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__CYGWIN__)
 #warning "Cannot determine ENDIANESS of this machine assuming LITTLE_ENDIAN"
 #warning "If you running sdcc on an INTEL 80x86 Platform you are okay"
 #endif