pike.git
/
NT
/
tools
/
rntecl
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/NT/tools/rntecl:1:
#!/usr/local/bin/pike // -*- Pike -*-
-
// $Id: rntecl,v 1.
3
2000/08/
01
15
:
53
:
31
grubba Exp $
+
// $Id: rntecl,v 1.
4
2000/08/
14
16
:
11
:
46
grubba Exp $
// RNTECL, a front-end to Intel ECL with options similar to GCC // Written by Fredrik Hubinette & Henrik Grubbström. inherit "lib.pike"; // Verbose is default for now, this can be turned off one this // frontend has been refined to where it does not require more // debugging.
pike.git/NT/tools/rntecl:33:
sscanf(file=lower_case(reverse(file)),"%s.",file); return reverse(file); } string remove_ext(string file) { sscanf(file=reverse(file),"%*s.%s",file,file); return reverse(file); }
+
string o_to_obj(string fname)
+
{
+
if (fname[sizeof(fname)-3..] == ".o") {
+
return fname + "bj";
+
}
+
return fname;
+
}
int main(int argc, string *argv) { string *ldopts=({"-INCREMENTAL:no"}); string *cflags=({ "-Wp64", // Generate warnings for loss of precision. //"-W4", // Maximum verbosity. "-W3", // More warnings. "-D__WIN32__", "-D_WIN32",
pike.git/NT/tools/rntecl:190:
case "define": cflags+=({"-D"+option[1]}); break; case "undefine": cflags+=({"-U"+option[1]}); break; case "output": output=option[1]; break; } } // Scan through the remaining arguments argv=Getopt.get_args(argv);
-
cflags+=Array.map(argv[1..],fixpath);
+
cflags+=Array.map(
Array.map(
argv[1..],fixpath)
, o_to_obj)
;
foreach(argv[1..], string tmp) { if(tmp[0]=='-') { werror("Unrecognized option "+tmp+".\n"); exit(1); } }
pike.git/NT/tools/rntecl:213:
case "exe": if(!output) output="a.out"; cflags+=({"-Fe"+fixpath(output)+".exe"}); // cflags+=({"-MT" + (debug?"d":"") }); wantfile=output+".exe"; break; case "obj": if(!output) output=remove_ext(argv[1])+".o";
-
cflags+=({"-Fo"+fixpath(
output
)});
+
cflags+=({"-Fo"+fixpath(
output+"bj"
)});
wantfile=output; break; case "asm": if(!output) output=remove_ext(argv[1])+".s"; cflags+=({"-Fa"+fixpath(output)}); wantfile=output; break;
pike.git/NT/tools/rntecl:303:
} if(ret) { werror("ECL returned error code %d.\n",ret); exit(ret); } if(wantfile) {
+
if (target == "obj") {
+
if(!file_stat(wantfile+"bj"))
+
{
+
werror("RNTECL: output file not generated (%s).\n",
+
wantfile+"bj");
+
exit(1);
+
}
+
rm(wantfile);
+
hardlink(wantfile+"bj", wantfile);
+
}
if(!file_stat(wantfile)) { werror("RNTECL: output file not generated (%s).\n",wantfile); exit(1); } } if(target=="exe" && !share) { rm(output);