* link/z80/lkmain.c (afile),
* as/mcs51/lkmain.c (afile),
* as/hc08/lkmain.c (afile): allow linker script file to have an
extension other than ".lnk"
* link/z80/lklex.c (getfid),
* link/z80/lkmain.c (parse),
* as/mcs51/lklex.c (getfid),
* as/mcs51/lkmain.c (parse),
* as/hc08/lklex.c (getfid),
* as/hc08/lkmain.c (parse): Support comments in the linker script
file on lines by themselves and after filenames
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3295
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2004-04-21 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+ * link/z80/lkmain.c (afile): allow periods in directory names
+ * link/z80/lkmain.c (afile),
+ * as/mcs51/lkmain.c (afile),
+ * as/hc08/lkmain.c (afile): allow linker script file to have an
+ extension other than ".lnk"
+ * link/z80/lklex.c (getfid),
+ * link/z80/lkmain.c (parse),
+ * as/mcs51/lklex.c (getfid),
+ * as/mcs51/lkmain.c (parse),
+ * as/hc08/lklex.c (getfid),
+ * as/hc08/lkmain.c (parse): Support comments in the linker script
+ file on lines by themselves and after filenames
+
2004-04-20 Jesus Calvino-Fraga <jesusc AT ece.ubc.ca>
* as/link_hc08.dsp: Added as/hc08/lkelf.c to project.
if (p < &str[PATH_MAX-1])
*p++ = c;
c = get();
+ if (c == ';')
+ while (c)
+ c = get();
} while (c);
/* trim trailing spaces */
--p;
char fid[NINPUT];
while ((c = getnb()) != 0) {
+ if ( c == ';')
+ return(0);
if ( c == '-') {
while (ctype[c=get()] & LETTER) {
switch(c) {
lkexit(1);
}
}
+ if ( c == ';')
+ return(0);
} else
if (ctype[c] & ILL) {
fprintf(stderr, "Invalid input");
}
/*Add the extension*/
- strcat(fb, ".");
- strcat(fb, strlen(ft)?ft:"rel");
-
+ if (fb[i] != '.')
+ {
+ strcat(fb, ".");
+ strcat(fb, strlen(ft)?ft:"rel");
+ }
+
fp = fopen(fb, omode);
if (fp==NULL)
{
if (p < &str[PATH_MAX-1])
*p++ = c;
c = get();
+ if (c == ';')
+ while (c)
+ c = get();
} while (c);
/* trim trailing spaces */
--p;
char fid[NINPUT];
while ((c = getnb()) != 0) {
+ if ( c == ';')
+ return(0);
if ( c == '-') {
while (ctype[c=get()] & LETTER) {
switch(c) {
lkexit(1);
}
}
+ if ( c == ';')
+ return(0);
} else
if (ctype[c] & ILL) {
fprintf(stderr, "Invalid input");
}
/*Add the extension*/
- strcat(fb, ".");
- strcat(fb, strlen(ft)?ft:"rel");
+ if (fb[i] != '.')
+ {
+ strcat(fb, ".");
+ strcat(fb, strlen(ft)?ft:"rel");
+ }
fp = fopen(fb, omode);
if (fp==NULL)
if (p < &str[FILSPC-1])
*p++ = c;
c = get();
+ if (c == ';')
+ while (c)
+ c = get();
#ifdef SDK
} while (c);
#else /* SDK */
char fid[NINPUT];
while ((c = getnb()) != 0) {
+ if (c == ';')
+ return(0);
if ( c == '-') {
while (ctype[c=get()] & LETTER) {
switch(c) {
lkexit(1);
}
}
+ if (c == ';')
+ return(0);
} else
if (ctype[c] != ILL) {
if (linkp == NULL) {
char *fn;
char *ft;
{
+#if 0
register char *p1, *p2, *p3;
register int c;
+#else
+ int i;
+#endif
FILE *fp;
char fb[FILSPC];
+#if 0
p1 = fn;
p2 = fb;
p3 = ft;
*p2++ = c;
}
*p2++ = 0;
+#else
+ /*Look backward the name path and get rid of the extension, if any*/
+ i=strlen(fn);
+ for(; (fn[i]!='.')&&(fn[i]!='\\')&&(fn[i]!='/')&&(i>=0); i--);
+ if( (fn[i]=='.') && *ft && strcmp(ft, "lnk") )
+ {
+ strncpy(fb, fn, i);
+ fb[i]=0;
+ }
+ else
+ {
+ strcpy(fb, fn);
+ }
+
+ /*Add the extension*/
+ if (fb[i] != '.')
+ {
+ strcat(fb, ".");
+#ifdef SDK
+ strcat(fb, strlen(ft)?ft:"rel");
+#else
+ strcat(fb, strlen(ft)?ft:"REL");
+#endif
+ }
+#endif
+
#ifdef SDK
if ((fp = fopen(fb, wf?(binary?"wb":"w"):(binary?"rb":"r"))) == NULL) {
#else /* SDK */