Semicolon is one
[llpp.git] / build.ninja
blob39babf495deb5c915c78ef1f82b8d8e39910fc75
1 cc = gcc
2 include .config
3 ocamlc = ocamlc.opt
4 ocamlflags = -warn-error +a -w +a -g
5 libs = -lmupdf $mujs -lpthread -L$mupdf/build/$buildtype
7 cflags = -O $cflags -Wall -Werror -I$mupdf/include -I$freetype -g $
8        -std=c99 -pedantic-errors
10 rule cc
11      deps = gcc
12      depfile = $out.d
13      command = $ocamlc -cc "$cc" -ccopt "$cflags -MMD -MF $out.d -o $out" -c $in
14      description = cc $out
16 rule ocamlc
17      deps = gcc
18      depfile = $out.d
19      command = sh $srcdir/doocaml.sh $ocamlc $out $in -c $ocamlflags
20      description = ocamlc $out
22 rule genhelp
23      command = sh $srcdir/mkhelp.sh $srcdir/keystoml.ml $srcdir/KEYS >$out
24      description = genhelp
26 sedcmd = sed -f $srcdir/pp.sed
28 build $builddir/help.ml: genhelp $
29       $srcdir/mkhelp.sh $srcdir/keystoml.ml $srcdir/KEYS
30 build $builddir/link.o: cc $srcdir/link.c
31       cflags = $cflags -D_GNU_SOURCE -DOBSCURED_OPT -DFFP
32 build $builddir/help.cmo: ocamlc $builddir/help.ml
33 build $builddir/utils.cmo: ocamlc $srcdir/utils.ml
34 build $builddir/bo.cmo: ocamlc $srcdir/le/bo.ml
35 build $builddir/wsi.cmi: ocamlc $srcdir/wsi.mli
36 build $builddir/wsi.cmo: ocamlc $srcdir/wsi.ml $
37       | $builddir/bo.cmo $builddir/utils.cmo $builddir/wsi.cmi
38 build $builddir/parser.cmo: ocamlc $srcdir/parser.ml
39 build $builddir/config.cmo: ocamlc $srcdir/config.ml $
40       | $builddir/wsi.cmi $builddir/utils.cmo $builddir/parser.cmo
41       ocamlflags = $ocamlflags -I +lablGL
42 build $builddir/main.cmo: ocamlc $srcdir/main.ml $
43       | $builddir/wsi.cmi $builddir/utils.cmo $builddir/config.cmo $
44         $builddir/help.cmo
45       ocamlflags = $ocamlflags -I +lablGL -pp "$sedcmd"
47 cmos = $builddir/help.cmo $
48      $builddir/utils.cmo $
49      $builddir/parser.cmo $
50      $builddir/bo.cmo $
51      $builddir/wsi.cmo $
52      $builddir/config.cmo $
53      $builddir/main.cmo
55 rule linkso
56      command = $cc -o $out -shared $in $libs $lflags
57      description = linkso $out
59 build $builddir/link.so: linkso $builddir/link.o
61 rule link
62      command = $ocamlc -g -o $out -I +lablGL $
63              str.cma unix.cma lablgl.cma $cmos $
64              $builddir/link.so
65      description = link $out
67 build $builddir/llpp: link $
68       $builddir/help.cmo $
69       $builddir/utils.cmo $
70       $builddir/parser.cmo $
71       $builddir/bo.cmo $
72       $builddir/wsi.cmo $
73       $builddir/config.cmo $
74       $builddir/main.cmo $
75       $builddir/link.so
77 default $builddir/llpp