1 # This file is used to build ninja itself.
3 # NOTE: it is an explicit non-goal of ninja to make it convenient to
4 # write these files by hand. For a real project, you'd generate this
5 # file from higher-level rules.
7 # I was tempted to generate this file even for ninja itself but I
8 # figured it'd be easier to bootstrap this way.
12 #cxx = /home/evanm/projects/src/llvm/Release+Asserts/bin/clang++
13 cflags = -g -Wall -Wno-deprecated -fno-exceptions -fvisibility=hidden -pipe
14 # -rdynamic is needed for backtrace()
15 ldflags = -g -rdynamic
17 # bootstrap.sh generates a "config.ninja" file, which contains some
18 # minor build customization for development purposes.
23 command = $cxx -MMD -MF $out.d $conf_cflags $cflags -c $in -o $out
27 command = ar crs $out $in
31 command = $cxx $conf_ldflags $ldflags -o $out $in
32 description = LINK $out
35 command = src/inline.sh $varname < $in > $out
36 description = INLINE $out
38 build $builddir/browse_py.h: inline src/browse.py
41 build $builddir/browse.o: cxx src/browse.cc | src/inline.sh || $builddir/browse_py.h
42 build $builddir/build.o: cxx src/build.cc
43 build $builddir/build_log.o: cxx src/build_log.cc
44 build $builddir/eval_env.o: cxx src/eval_env.cc
45 build $builddir/graph.o: cxx src/graph.cc
46 build $builddir/graphviz.o: cxx src/graphviz.cc
47 build $builddir/parsers.o: cxx src/parsers.cc
48 build $builddir/subprocess.o: cxx src/subprocess.cc
49 build $builddir/util.o: cxx src/util.cc
50 build $builddir/ninja_jumble.o: cxx src/ninja_jumble.cc
51 build $builddir/ninja.a: ar $builddir/browse.o $builddir/build.o \
52 $builddir/build_log.o $builddir/eval_env.o $builddir/graph.o \
53 $builddir/graphviz.o $builddir/parsers.o $builddir/subprocess.o \
54 $builddir/util.o $builddir/ninja_jumble.o
56 build $builddir/ninja.o: cxx src/ninja.cc
57 build ninja: link $builddir/ninja.o $builddir/ninja.a
59 build $builddir/build_test.o: cxx src/build_test.cc
60 build $builddir/build_log_test.o: cxx src/build_log_test.cc
61 build $builddir/graph_test.o: cxx src/graph_test.cc
62 build $builddir/ninja_test.o: cxx src/ninja_test.cc
63 build $builddir/parsers_test.o: cxx src/parsers_test.cc
64 build $builddir/subprocess_test.o: cxx src/subprocess_test.cc
65 build $builddir/test.o: cxx src/test.cc
66 build ninja_test: link $builddir/build_test.o $builddir/build_log_test.o \
67 $builddir/graph_test.o $builddir/ninja_test.o $builddir/parsers_test.o \
68 $builddir/subprocess_test.o $builddir/test.o $builddir/ninja.a
69 ldflags = -g -rdynamic -lgtest -lgtest_main -lpthread
72 # Generate a graph using the -g flag.
74 command = ./ninja -t graph all > $out
76 command = dot -Tpng $in > $out
78 build $builddir/graph.dot: gendot ninja build.ninja
79 build graph.png: gengraph $builddir/graph.dot
83 command = asciidoc -a toc $in
84 description = ASCIIDOC $in
86 build manual.html: asciidoc manual.asciidoc
87 build doc: phony || manual.html
89 build all: phony || ninja ninja_test graph.png doc