bool verboseExec = FALSE;
char *preOutName;
+/* uncomment JAMIN_DS390 to always override and use ds390 port
+ for mcs51 work. This is temporary, for compatibility testing. */
+/* #define JAMIN_DS390 */
+#ifdef JAMIN_DS390
+int ds390_jammed = 0;
+#endif
+
// Globally accessible scratch buffer for file names.
char scratchFileName[FILENAME_MAX];
{ '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" },
{ 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 },
#ifdef SDCC_SUB_VERSION_STR
"/" SDCC_SUB_VERSION_STR
#endif
-#ifdef __CYGWIN32__
- " (CYGWIN32)\n"
+#ifdef __CYGWIN__
+ " (CYGWIN)\n"
#else
#ifdef __DJGPP__
" (DJGPP) \n"
/* standard library path */
if (!options.nostdlib)
{
+/****
if (TARGET_IS_DS390)
{
c = "ds390";
}
else
+*****/
{
switch (options.model)
{
c = "large";
break;
case MODEL_FLAT24:
- c = "flat24";
+ /* c = "flat24"; */
+ c = "ds390";
break;
default:
werror (W_UNKNOWN_MODEL, __FILE__, __LINE__);
fprintf (lnkfile, "-k %s/%s\n", SDCC_LIB_DIR /*STD_LIB_PATH */ , c);
/* standard library files */
- if (strcmp (port->target, "ds390") == 0)
+ /* if (strcmp (port->target, "ds390") == 0) */
+ if (options.model == MODEL_FLAT24)
{
fprintf (lnkfile, "-l %s\n", STD_DS390_LIB);
}
}
_findPort (argc, argv);
+#ifdef JAMIN_DS390
+ if (strcmp(port->target, "mcs51") == 0) {
+ printf("DS390 jammed in A\n");
+ _setPort ("ds390");
+ ds390_jammed = 1;
+ }
+#endif
/* Initalise the port. */
if (port->init)
port->init ();
setDefaultOptions ();
+#ifdef JAMIN_DS390
+ if (ds390_jammed) {
+ options.model = MODEL_SMALL;
+ options.stack10bit=0;
+ }
+#endif
parseCmdLine (argc, argv);
- initMem ();
-
- port->finaliseOptions ();
-
+ if (getenv("SDCPP"))
+ {
+ _preCmd[0] = getenv("SDCPP");
+ }
+
/* if no input then printUsage & exit */
if ((!options.c1mode && !srcFileName && !nrelFiles) ||
(options.c1mode && !srcFileName && !options.out_name))
{
preProcess (envp);
+ initMem ();
+
+ port->finaliseOptions ();
+
initSymt ();
initiCode ();
initCSupport ();
free (preOutName);
}
// EndFix
+ #if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER)
+ rm_tmpfiles();
+ #endif
return 1;
}
if (cdbFile)
fclose (cdbFile);
+ if (preOutName && !options.c1mode)
+ {
+ unlink (preOutName);
+ free (preOutName);
+ }
+
if (!options.cc_only &&
!fatalError &&
!noAssemble &&
if (yyin && yyin != stdin)
fclose (yyin);
- if (preOutName && !options.c1mode)
- {
- unlink (preOutName);
- free (preOutName);
- }
-
return 0;
}