Skip to content

Instantly share code, notes, and snippets.

@jiripospisil
Created March 16, 2014 16:51
Show Gist options
  • Save jiripospisil/1d099dda373280206aee to your computer and use it in GitHub Desktop.
Save jiripospisil/1d099dda373280206aee to your computer and use it in GitHub Desktop.
# build.ninja
ninja_required_version = 1.3
builddir = build
rm = rm -fr
cxx = gcc
ar = ar
lib = $builddir/libgit2.a
includes = -I. -Isrc -Iinclude -Ideps/http-parser -Ideps/zlib
defines = -DNO_VIZ -DSTDC -DNO_GZIP -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
cflags = $includes $defines -g -Wall -Wextra -Wno-missing-field-initializers -O2 -fPIC
rule compile
command = $cxx -MMD -MT $out -MF $out.d $cflags -c $in -o $out
description = Building C file $in
depfile = $out.d
deps = gcc
rule ar
command = $rm $out && $ar crs $out $in
description = Creating archive $out
rule clean
command = $rm $builddir
description = Cleaning directory $builddir
build clean: clean
build $builddir/attr.o: compile src/attr.c
build $builddir/attr_file.o: compile src/attr_file.c
build $builddir/blame.o: compile src/blame.c
build $builddir/blame_git.o: compile src/blame_git.c
build $builddir/blob.o: compile src/blob.c
build $builddir/branch.o: compile src/branch.c
build $builddir/buf_text.o: compile src/buf_text.c
build $builddir/buffer.o: compile src/buffer.c
build $builddir/cache.o: compile src/cache.c
build $builddir/checkout.o: compile src/checkout.c
build $builddir/clone.o: compile src/clone.c
build $builddir/commit.o: compile src/commit.c
build $builddir/commit_list.o: compile src/commit_list.c
build $builddir/config.o: compile src/config.c
build $builddir/config_cache.o: compile src/config_cache.c
build $builddir/config_file.o: compile src/config_file.c
build $builddir/crlf.o: compile src/crlf.c
build $builddir/date.o: compile src/date.c
build $builddir/delta-apply.o: compile src/delta-apply.c
build $builddir/delta.o: compile src/delta.c
build $builddir/diff.o: compile src/diff.c
build $builddir/diff_driver.o: compile src/diff_driver.c
build $builddir/diff_file.o: compile src/diff_file.c
build $builddir/diff_patch.o: compile src/diff_patch.c
build $builddir/diff_print.o: compile src/diff_print.c
build $builddir/diff_tform.o: compile src/diff_tform.c
build $builddir/diff_xdiff.o: compile src/diff_xdiff.c
build $builddir/errors.o: compile src/errors.c
build $builddir/fetch.o: compile src/fetch.c
build $builddir/fetchhead.o: compile src/fetchhead.c
build $builddir/filebuf.o: compile src/filebuf.c
build $builddir/fileops.o: compile src/fileops.c
build $builddir/filter.o: compile src/filter.c
build $builddir/fnmatch.o: compile src/fnmatch.c
build $builddir/global.o: compile src/global.c
build $builddir/graph.o: compile src/graph.c
build $builddir/hash.o: compile src/hash.c
build $builddir/hash/hash_generic.o: compile src/hash/hash_generic.c
build $builddir/hashsig.o: compile src/hashsig.c
build $builddir/ident.o: compile src/ident.c
build $builddir/ignore.o: compile src/ignore.c
build $builddir/index.o: compile src/index.c
build $builddir/indexer.o: compile src/indexer.c
build $builddir/iterator.o: compile src/iterator.c
build $builddir/merge.o: compile src/merge.c
build $builddir/merge_file.o: compile src/merge_file.c
build $builddir/message.o: compile src/message.c
build $builddir/mwindow.o: compile src/mwindow.c
build $builddir/netops.o: compile src/netops.c
build $builddir/notes.o: compile src/notes.c
build $builddir/object.o: compile src/object.c
build $builddir/object_api.o: compile src/object_api.c
build $builddir/odb.o: compile src/odb.c
build $builddir/odb_loose.o: compile src/odb_loose.c
build $builddir/odb_pack.o: compile src/odb_pack.c
build $builddir/oid.o: compile src/oid.c
build $builddir/pack-objects.o: compile src/pack-objects.c
build $builddir/pack.o: compile src/pack.c
build $builddir/path.o: compile src/path.c
build $builddir/pathspec.o: compile src/pathspec.c
build $builddir/pool.o: compile src/pool.c
build $builddir/posix.o: compile src/posix.c
build $builddir/pqueue.o: compile src/pqueue.c
build $builddir/push.o: compile src/push.c
build $builddir/refdb.o: compile src/refdb.c
build $builddir/refdb_fs.o: compile src/refdb_fs.c
build $builddir/reflog.o: compile src/reflog.c
build $builddir/refs.o: compile src/refs.c
build $builddir/refspec.o: compile src/refspec.c
build $builddir/remote.o: compile src/remote.c
build $builddir/repository.o: compile src/repository.c
build $builddir/reset.o: compile src/reset.c
build $builddir/revert.o: compile src/revert.c
build $builddir/revparse.o: compile src/revparse.c
build $builddir/revwalk.o: compile src/revwalk.c
build $builddir/settings.o: compile src/settings.c
build $builddir/sha1_lookup.o: compile src/sha1_lookup.c
build $builddir/signature.o: compile src/signature.c
build $builddir/sortedcache.o: compile src/sortedcache.c
build $builddir/stash.o: compile src/stash.c
build $builddir/status.o: compile src/status.c
build $builddir/strmap.o: compile src/strmap.c
build $builddir/submodule.o: compile src/submodule.c
build $builddir/sysdir.o: compile src/sysdir.c
build $builddir/tag.o: compile src/tag.c
build $builddir/thread-utils.o: compile src/thread-utils.c
build $builddir/trace.o: compile src/trace.c
build $builddir/transport.o: compile src/transport.c
build $builddir/transports/cred.o: compile src/transports/cred.c
build $builddir/transports/cred_helpers.o: compile src/transports/cred_helpers.c
build $builddir/transports/git.o: compile src/transports/git.c
build $builddir/transports/http.o: compile src/transports/http.c
build $builddir/transports/local.o: compile src/transports/local.c
build $builddir/transports/smart.o: compile src/transports/smart.c
build $builddir/transports/smart_pkt.o: compile src/transports/smart_pkt.c
build $builddir/transports/smart_protocol.o: compile src/transports/smart_protocol.c
build $builddir/transports/ssh.o: compile src/transports/ssh.c
build $builddir/transports/winhttp.o: compile src/transports/winhttp.c
build $builddir/tree-cache.o: compile src/tree-cache.c
build $builddir/tree.o: compile src/tree.c
build $builddir/tsort.o: compile src/tsort.c
build $builddir/unix/map.o: compile src/unix/map.c
build $builddir/unix/realpath.o: compile src/unix/realpath.c
build $builddir/util.o: compile src/util.c
build $builddir/vector.o: compile src/vector.c
build $builddir/xdiff/xdiffi.o: compile src/xdiff/xdiffi.c
build $builddir/xdiff/xemit.o: compile src/xdiff/xemit.c
build $builddir/xdiff/xhistogram.o: compile src/xdiff/xhistogram.c
build $builddir/xdiff/xmerge.o: compile src/xdiff/xmerge.c
build $builddir/xdiff/xpatience.o: compile src/xdiff/xpatience.c
build $builddir/xdiff/xprepare.o: compile src/xdiff/xprepare.c
build $builddir/xdiff/xutils.o: compile src/xdiff/xutils.c
build $builddir/zstream.o: compile src/zstream.c
# 3rd party dependencies
build $builddir/http-parser/http_parser.o: compile deps/http-parser/http_parser.c
build $builddir/zlib/adler32.o: compile deps/zlib/adler32.c
build $builddir/zlib/crc32.o: compile deps/zlib/crc32.c
build $builddir/zlib/deflate.o: compile deps/zlib/deflate.c
build $builddir/zlib/inffast.o: compile deps/zlib/inffast.c
build $builddir/zlib/inflate.o: compile deps/zlib/inflate.c
build $builddir/zlib/inftrees.o: compile deps/zlib/inftrees.c
build $builddir/zlib/trees.o: compile deps/zlib/trees.c
build $builddir/zlib/zutil.o: compile deps/zlib/zutil.c
build $lib: ar $builddir/attr.o $
$builddir/attr_file.o $
$builddir/blame.o $
$builddir/blame_git.o $
$builddir/blob.o $
$builddir/branch.o $
$builddir/buf_text.o $
$builddir/buffer.o $
$builddir/cache.o $
$builddir/checkout.o $
$builddir/clone.o $
$builddir/commit.o $
$builddir/commit_list.o $
$builddir/config.o $
$builddir/config_cache.o $
$builddir/config_file.o $
$builddir/crlf.o $
$builddir/date.o $
$builddir/delta-apply.o $
$builddir/delta.o $
$builddir/diff.o $
$builddir/diff_driver.o $
$builddir/diff_file.o $
$builddir/diff_patch.o $
$builddir/diff_print.o $
$builddir/diff_tform.o $
$builddir/diff_xdiff.o $
$builddir/errors.o $
$builddir/fetch.o $
$builddir/fetchhead.o $
$builddir/filebuf.o $
$builddir/fileops.o $
$builddir/filter.o $
$builddir/fnmatch.o $
$builddir/global.o $
$builddir/graph.o $
$builddir/hash.o $
$builddir/hash/hash_generic.o $
$builddir/hashsig.o $
$builddir/ident.o $
$builddir/ignore.o $
$builddir/index.o $
$builddir/indexer.o $
$builddir/iterator.o $
$builddir/merge.o $
$builddir/merge_file.o $
$builddir/message.o $
$builddir/mwindow.o $
$builddir/netops.o $
$builddir/notes.o $
$builddir/object.o $
$builddir/object_api.o $
$builddir/odb.o $
$builddir/odb_loose.o $
$builddir/odb_pack.o $
$builddir/oid.o $
$builddir/pack-objects.o $
$builddir/pack.o $
$builddir/path.o $
$builddir/pathspec.o $
$builddir/pool.o $
$builddir/posix.o $
$builddir/pqueue.o $
$builddir/push.o $
$builddir/refdb.o $
$builddir/refdb_fs.o $
$builddir/reflog.o $
$builddir/refs.o $
$builddir/refspec.o $
$builddir/remote.o $
$builddir/repository.o $
$builddir/reset.o $
$builddir/revert.o $
$builddir/revparse.o $
$builddir/revwalk.o $
$builddir/settings.o $
$builddir/sha1_lookup.o $
$builddir/signature.o $
$builddir/sortedcache.o $
$builddir/stash.o $
$builddir/status.o $
$builddir/strmap.o $
$builddir/submodule.o $
$builddir/sysdir.o $
$builddir/tag.o $
$builddir/thread-utils.o $
$builddir/trace.o $
$builddir/transport.o $
$builddir/transports/cred.o $
$builddir/transports/cred_helpers.o $
$builddir/transports/git.o $
$builddir/transports/http.o $
$builddir/transports/local.o $
$builddir/transports/smart.o $
$builddir/transports/smart_pkt.o $
$builddir/transports/smart_protocol.o $
$builddir/transports/ssh.o $
$builddir/transports/winhttp.o $
$builddir/tree-cache.o $
$builddir/tree.o $
$builddir/tsort.o $
$builddir/unix/map.o $
$builddir/unix/realpath.o $
$builddir/util.o $
$builddir/vector.o $
$builddir/xdiff/xdiffi.o $
$builddir/xdiff/xemit.o $
$builddir/xdiff/xhistogram.o $
$builddir/xdiff/xmerge.o $
$builddir/xdiff/xpatience.o $
$builddir/xdiff/xprepare.o $
$builddir/xdiff/xutils.o $
$builddir/zstream.o $
$builddir/http-parser/http_parser.o $
$builddir/zlib/adler32.o $
$builddir/zlib/crc32.o $
$builddir/zlib/deflate.o $
$builddir/zlib/inffast.o $
$builddir/zlib/inflate.o $
$builddir/zlib/inftrees.o $
$builddir/zlib/trees.o $
$builddir/zlib/zutil.o
default $lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment