summaryrefslogtreecommitdiffstats
path: root/build.ninja
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-05-02 00:48:39 (GMT)
committerEvan Martin <martine@danga.com>2011-05-02 01:02:13 (GMT)
commitd7bd4a2367046ee0458123051d9cbdc465d022d1 (patch)
treed3c92ec32dce8649b0d39786254b2a4c64099acf /build.ninja
parent101d9b2d14f6877818787921bad55783ad76f6f4 (diff)
downloadNinja-d7bd4a2367046ee0458123051d9cbdc465d022d1.zip
Ninja-d7bd4a2367046ee0458123051d9cbdc465d022d1.tar.gz
Ninja-d7bd4a2367046ee0458123051d9cbdc465d022d1.tar.bz2
check in a script that generates build.ninja
This will allow us to: 1) simplify bootstrap 2) generate windows-style paths on windows It is also in line with ninja's philosophy: the build file syntax is simple because the build files are easy to generate.
Diffstat (limited to 'build.ninja')
-rw-r--r--build.ninja105
1 files changed, 0 insertions, 105 deletions
diff --git a/build.ninja b/build.ninja
deleted file mode 100644
index 1b27790..0000000
--- a/build.ninja
+++ /dev/null
@@ -1,105 +0,0 @@
-# This file is used to build ninja itself.
-
-# NOTE: it is an explicit non-goal of ninja to make it convenient to
-# write these files by hand. For a real project, you'd generate this
-# file from higher-level rules.
-
-# I was tempted to generate this file even for ninja itself but I
-# figured it'd be easier to bootstrap this way.
-
-builddir = build
-cxx = g++
-#cxx = /home/evanm/projects/src/llvm/Release+Asserts/bin/clang++
-cflags = -g -Wall -Wno-deprecated -fno-exceptions -fvisibility=hidden -pipe
-# -rdynamic is needed for backtrace()
-ldflags = -g -rdynamic
-
-# bootstrap.sh generates a "config.ninja" file, which contains some
-# minor build customization for development purposes.
-include config.ninja
-
-rule cxx
- depfile = $out.d
- command = $cxx -MMD -MF $out.d $conf_cflags $cflags -c $in -o $out
- description = CC $out
-
-rule ar
- command = ar crs $out $in
- description = AR $out
-
-rule link
- command = $cxx $conf_ldflags $ldflags -o $out $in
- description = LINK $out
-
-rule inline
- command = src/inline.sh $varname < $in > $out
- description = INLINE $out
-
-build $builddir/browse_py.h: inline src/browse.py
- varname = kBrowsePy
-
-build $builddir/browse.o: cxx src/browse.cc | src/inline.sh || $builddir/browse_py.h
-build $builddir/build.o: cxx src/build.cc
-build $builddir/build_log.o: cxx src/build_log.cc
-build $builddir/eval_env.o: cxx src/eval_env.cc
-build $builddir/graph.o: cxx src/graph.cc
-build $builddir/graphviz.o: cxx src/graphviz.cc
-build $builddir/parsers.o: cxx src/parsers.cc
-build $builddir/subprocess.o: cxx src/subprocess.cc
-build $builddir/util.o: cxx src/util.cc
-build $builddir/clean.o: cxx src/clean.cc
-build $builddir/ninja_jumble.o: cxx src/ninja_jumble.cc
-build $builddir/ninja.a: ar $builddir/browse.o $builddir/build.o \
- $builddir/build_log.o $builddir/eval_env.o $builddir/graph.o \
- $builddir/graphviz.o $builddir/parsers.o $builddir/subprocess.o \
- $builddir/util.o $builddir/ninja_jumble.o $builddir/clean.o
-
-build $builddir/ninja.o: cxx src/ninja.cc
-build ninja: link $builddir/ninja.o $builddir/ninja.a
-
-build $builddir/build_test.o: cxx src/build_test.cc
-build $builddir/build_log_test.o: cxx src/build_log_test.cc
-build $builddir/graph_test.o: cxx src/graph_test.cc
-build $builddir/ninja_test.o: cxx src/ninja_test.cc
-build $builddir/parsers_test.o: cxx src/parsers_test.cc
-build $builddir/subprocess_test.o: cxx src/subprocess_test.cc
-build $builddir/test.o: cxx src/test.cc
-build $builddir/util_test.o: cxx src/util_test.cc
-build ninja_test: link $builddir/build_test.o $builddir/build_log_test.o \
- $builddir/graph_test.o $builddir/ninja_test.o $builddir/parsers_test.o \
- $builddir/subprocess_test.o $builddir/test.o $builddir/util_test.o \
- $builddir/ninja.a
- ldflags = -g -rdynamic -lgtest -lgtest_main -lpthread
-
-
-# Generate a graph using the -g flag.
-rule gendot
- command = ./ninja -t graph > $out
-rule gengraph
- command = dot -Tpng $in > $out
-
-build $builddir/graph.dot: gendot ninja build.ninja
-build graph.png: gengraph $builddir/graph.dot
-
-# Generate the manual.
-rule asciidoc
- command = asciidoc -a toc $in
- description = ASCIIDOC $in
-
-build manual.html: asciidoc manual.asciidoc
-build manual: phony || manual.html
-
-# Generate Doxygen.
-rule doxygen
- command = doxygen $in
- description = DOXYGEN $in
-
-doxygen_mainpage_generator = ./gen_doxygen_mainpage.sh
-
-rule doxygen_mainpage
- command = $doxygen_mainpage_generator $in > $out
- description = DOXYGEN_MAINPAGE $out
-
-build $builddir/doxygen_mainpage: doxygen_mainpage \
- README HACKING COPYING | $doxygen_mainpage_generator
-build doxygen: doxygen doxygen.config | $builddir/doxygen_mainpage || $builddir/doxygen_mainpage