Drop tbs in favour of ninja
[llpp.git] / build.ninja
blob6718d3eaaa8d27f884cd5b6f36bcd477d61c986b
1 cc = gcc
2 include .config
3 ocamlc = ocamlc.opt
4 ocaml = ocamlc.opt
5 ocamlflags = -g -w a -I $builddir
6 libs = -lmupdf $mujs -lpthread -L$mupdf/build/$buildtype
8 cflags =$cflags  -Wall -Werror -I$mupdf/include -I$freetype $
9        -I$mupdf/include
11 rule cc
12      deps = gcc
13      depfile = $out.d
14      command = $ocamlc -cc $cc -ccopt "$cflags -MMD -MF $out.d -o $out" -c $in
16 rule ocamlc
17      command = sh $srcdir/doocaml $out $in -c $ocamlflags
19 rule helpcmo
20      command = cd $builddir >/dev/null && $
21           $ocaml $ocamlflags -c -o help.cmo help.ml
23 rule genhelp
24      command = sh $srcdir/mkhelp.sh $srcdir/keystoml.ml $srcdir/KEYS >$out
26 sedcmd = sed -f $srcdir/pp.sed
28 build $builddir/help.ml: genhelp
29 build $builddir/link.o: cc $srcdir/link.c
30       cflags = $cflags -D_GNU_SOURCE -DOBSCURED_OPT -DFFP $
31              -DUSE_FONTCONFIG -g
32 build $builddir/help.cmo: helpcmo | $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/wsi.cmi $builddir/bo.cmo
38 build $builddir/parser.cmo: ocamlc $srcdir/parser.ml
39 build $builddir/config.cmo: ocamlc $srcdir/config.ml
40       ocamlflags = $ocamlflags -I +lablGL
41 build $builddir/main.cmo: ocamlc $srcdir/main.ml
42       ocamlflags = $ocamlflags -I +lablGL -pp "$sedcmd"
44 cmos = $builddir/help.cmo $
45      $builddir/utils.cmo $
46      $builddir/parser.cmo $
47      $builddir/bo.cmo $
48      $builddir/wsi.cmo $
49      $builddir/config.cmo $
50      $builddir/main.cmo
52 rule linkso
53      command = $cc -o $out -shared $in $libs
55 build $builddir/link.so: linkso $builddir/link.o
57 rule link
58       command = $ocaml -custom -g $
59               -cclib "$builddir/link.so $lflags" $
60               -o $out -I +lablGL str.cma unix.cma lablgl.cma $cmos
62 build $builddir/llpp: link | $
63       $builddir/help.cmo $
64       $builddir/utils.cmo $
65       $builddir/parser.cmo $
66       $builddir/bo.cmo $
67       $builddir/wsi.cmo $
68       $builddir/config.cmo $
69       $builddir/main.cmo $
70       $builddir/link.so
72 default $builddir/llpp