utils: Implement -j properly.
[goals.git] / Goalfile.in
index 623a09d..d38e70f 100644 (file)
@@ -51,11 +51,15 @@ goal maintainer-clean = : clean {
 #----------------------------------------------------------------------
 # Build the goals tool itself.
 
+let CC = "@CC@"
+let OCAMLLIB = "@OCAMLLIB@"
 let MENHIR = "@MENHIR@"
 let OCAMLDEP = "@OCAMLDEP@"
 let OCAMLFIND = "@OCAMLFIND@"
 let OCAMLLEX = "@OCAMLLEX@"
 # XXX
+let CFLAGS = [ "-g", "-O2", "-I%OCAMLLIB", "-I." ]
+#let CFLAGS = "@CFLAGS@ -I%OCAMLLIB -I."
 let OCAMLFLAGS = [ "-g", "-safe-string", "-warn-error", "CDEFLMPSUVYZX+52-3" ]
 let OCAMLPACKAGES = [ "-package", "str,unix,threads", "-I", "src", "-thread" ]
 #let OCAMLFLAGS = "@OCAMLFLAGS@"
@@ -64,6 +68,7 @@ let OCAMLPACKAGES = [ "-package", "str,unix,threads", "-I", "src", "-thread" ]
 let objects = [
     # These must be in dependency order.
     "src/config.cmx",
+    "src/utils-c.o",
     "src/utils.cmx",
     "src/cmdline.cmx",
     "src/jobs.cmx",
@@ -79,6 +84,11 @@ let objects = [
 
 goal tool = : ocaml_link ("src/goals", objects) ;
 
+# C code.
+"src/utils-c.o" : "src/utils-c.c" {
+    %CC %CFLAGS -c %< -o %@
+}
+
 # Parser.
 "src/parser.mli", "src/parser.ml" : "src/parser.mly" {
     %MENHIR --explain %<