* Alan R. Baldwin
* 721 Berkeley St.
* Kent, Ohio 44240
+ * 31-Feb-2008 AD added -y to create cdb file for non gameboy
*/
/*
#endif /* GAMEBOY */
syminit();
+
+ if (dflag){
+ SaveLinkedFilePath(linkp->f_idp); //Must be the first one...
+ dfp = afile(linkp->f_idp,"cdb",1);
+ if (dfp == NULL)
+ lkexit(1);
+ }
+
for (pass=0; pass<2; ++pass) {
cfp = NULL;
sfp = NULL;
if (rfp != NULL) fclose(rfp);
if (sfp != NULL) fclose(sfp);
if (tfp != NULL) fclose(tfp);
+ if (dfp != NULL) fclose(dfp);
exit(i);
}
case 'J':
++symflag;
break;
- case 'z':
case 'Z':
oflag = 3;
break;
#endif /* SDK */
+#ifndef GAMEBOY
+ case 'z':
+ dflag = 1;
+ return(0);
+#endif
case 'm':
case 'M':
++mflag;
case 'L':
addlib();
return(0);
-
default:
fprintf(stderr, "Invalid option\n");
lkexit(1);
#else /* SDK */
if ((fp = fopen(fb, wf?"w":"r")) == NULL) {
#endif /* SDK */
+ if (strcmp(ft,"adb"))/*Do not complaint for optional adb files*/
+ {
fprintf(stderr, "%s: cannot %s.\n", fb, wf?"create":"open");
lkerr++;
+ }
}
return (fp);
}
"\n",
#endif
"Startup:",
-#ifdef SDK
- " -- [Commands] Non-interactive command line input",
-#endif /* SDK */
" -c Command line input",
" -f file[LNK] File input",
" -p Prompt and echo of file[LNK] to stdout (default)",
" -n No echo of file[LNK] to stdout",
+/*
#ifdef SDK
"Usage: [-Options] outfile file [file ...]",
#else /* SDK */
"Usage: [-Options] file [file ...]",
#endif /* SDK */
+*/
"Libraries:",
" -k Library path specification, one per -k",
" -l Library file specification, one per -l",
"Output:",
" -i Intel Hex as file[IHX]",
" -s Motorola S19 as file[S19]",
+#ifndef GAMEBOY
+ " -z Produce SDCdb debug as file[cdb]",
+#endif
#ifdef SDK
#ifdef GAMEGEAR
- " -z Gamegear image as file[GG]",
+ " -Z Gamegear image as file[GG]",
#else
- " -z Gameboy image as file[GB]",
+ " -Z Gameboy image as file[GB]",
#endif /* GAMEGEAR */
#endif /* SDK */
"List:",
fprintf(stderr, "%s\n", *dp);
lkexit(1);
}
+
+/*)Function VOID copyfile()
+ *
+ * FILE *dest destination file
+ * FILE *src source file
+ *
+ * function will copy source file to destination file
+ *
+ *
+ * functions called:
+ * int fgetc() c_library
+ * int fputc() c_library
+ *
+ * side effects:
+ * none
+ */
+VOID copyfile (dest,src)
+FILE *src,*dest ;
+{
+ int ch;
+
+ while ((ch = fgetc(src)) != EOF) {
+ fputc(ch,dest);
+ }
+}