main shrubtools / nviz / build.ninja
 1# i know this is a ninja file, but you're allowed to edit it.
 2# you can also pass things on the command line if you like, eg
 3#
 4#     CC=clang ninja
 5
 6cc = $${CC:-cc}
 7cflags = $${CFLAGS:--O2 -std=c99}
 8ldflags = $${LDFLAGS:-}
 9libs = $${LIBS:-}
10prefix = $${PREFIX:-/usr/local}
11destdir = $${DESTDIR:-}
12bindir = $${BINDIR:-$${DESTDIR:-}$${PREFIX:-/usr/local}/bin}
13
14rule cc
15  command = $cc $cflags -MMD -MF $out.d -c -o $out $in
16  deps = gcc
17  depfile = $out.d
18  description = cc $out
19
20rule link
21  command = $cc $ldflags -o $out $in $libs
22  description = link $out
23
24rule install
25  command = mkdir -p $bindir && cp nviz $bindir/
26  description = install nviz
27
28build env.o: cc env.c
29build graph.o: cc graph.c
30build htab.o: cc htab.c
31build log.o: cc log.c
32build nviz.o: cc nviz.c
33build os-posix.o: cc os-posix.c
34build parse.o: cc parse.c
35build scan.o: cc scan.c
36build tree.o: cc tree.c
37build util.o: cc util.c
38
39build nviz: link env.o graph.o htab.o log.o nviz.o os-posix.o parse.o scan.o tree.o util.o
40build all: phony nviz
41build install: install nviz
42
43default all