comparison src/compiler.sml @ 1044:0d916892e39e

Exit code of 1 on compilation failure
author Adam Chlipala <adamc@hcoop.net>
date Wed, 25 Nov 2009 08:38:12 -0500
parents dfe34fad749d
children 36efaf119b85
comparison
equal deleted inserted replaced
1043:d73cf02427df 1044:0d916892e39e
926 (compile, link) 926 (compile, link)
927 927
928 val link = foldl (fn (s, link) => link ^ " " ^ s) link link' 928 val link = foldl (fn (s, link) => link ^ " " ^ s) link link'
929 in 929 in
930 if not (OS.Process.isSuccess (OS.Process.system compile)) then 930 if not (OS.Process.isSuccess (OS.Process.system compile)) then
931 print "C compilation failed\n" 931 OS.Process.exit OS.Process.failure
932 else if not (OS.Process.isSuccess (OS.Process.system link)) then 932 else if not (OS.Process.isSuccess (OS.Process.system link)) then
933 print "C linking failed\n" 933 OS.Process.exit OS.Process.failure
934 else 934 else
935 () 935 ()
936 end 936 end
937 937
938 fun compile job = 938 fun compile job =
939 case run toChecknest job of 939 case run toChecknest job of
940 NONE => print "Ur compilation failed\n" 940 NONE => OS.Process.exit OS.Process.failure
941 | SOME file => 941 | SOME file =>
942 let 942 let
943 val job = valOf (run (transform parseUrp "parseUrp") job) 943 val job = valOf (run (transform parseUrp "parseUrp") job)
944 944
945 val (cname, oname, cleanup) = 945 val (cname, oname, cleanup) =