comparison src/compiler.sml @ 186:88d46972de53

bool in Basis
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 18:53:20 -0400
parents c0ea24dcb86f
children 8a70e2919e86
comparison
equal deleted inserted replaced
185:19ee24bffbc0 186:88d46972de53
428 val link = "gcc -pthread -O3 clib/lacweb.o " ^ oname ^ " clib/driver.o -o " ^ ename 428 val link = "gcc -pthread -O3 clib/lacweb.o " ^ oname ^ " clib/driver.o -o " ^ ename
429 in 429 in
430 if not (OS.Process.isSuccess (OS.Process.system compile)) then 430 if not (OS.Process.isSuccess (OS.Process.system compile)) then
431 print "C compilation failed\n" 431 print "C compilation failed\n"
432 else if not (OS.Process.isSuccess (OS.Process.system link)) then 432 else if not (OS.Process.isSuccess (OS.Process.system link)) then
433 print "C linking failed\n" 433 print "C linking failed\n"
434 else 434 else
435 print "Success\n" 435 print "Success\n"
436 end 436 end
437 437
438 fun compile job = 438 fun compile job =
439 case cjrize job of 439 case cjrize job of
440 NONE => print "Laconic compilation failed\n" 440 NONE => print "Laconic compilation failed\n"
441 | SOME file => 441 | SOME file =>
442 let 442 if ErrorMsg.anyErrors () then
443 val cname = "/tmp/lacweb.c" 443 print "Laconic compilation failed\n"
444 val oname = "/tmp/lacweb.o" 444 else
445 val ename = "/tmp/webapp" 445 let
446 446 val cname = "/tmp/lacweb.c"
447 val outf = TextIO.openOut cname 447 val oname = "/tmp/lacweb.o"
448 val s = TextIOPP.openOut {dst = outf, wid = 80} 448 val ename = "/tmp/webapp"
449 in 449
450 Print.fprint s (CjrPrint.p_file CjrEnv.empty file); 450 val outf = TextIO.openOut cname
451 TextIO.closeOut outf; 451 val s = TextIOPP.openOut {dst = outf, wid = 80}
452 452 in
453 compileC {cname = cname, oname = oname, ename = ename} 453 Print.fprint s (CjrPrint.p_file CjrEnv.empty file);
454 end 454 TextIO.closeOut outf;
455
456 compileC {cname = cname, oname = oname, ename = ename}
457 end
455 458
456 end 459 end