aboutsummaryrefslogtreecommitdiff
path: root/extra/nawk/files/ninja.in
blob: 2bbc706495878cf75b85c1c2df175dff172dd1a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
rule cc
  command = $cc $cflags -MD -MF $out.d -c -o $out $in
  description = CC $out
  depfile = $out.d
  deps = gcc

rule link
  command = $cc $ldflags -o $out $in
  description = LINK $out

rule yacc
  command = $yacc -o awkgram.tab.c -H awkgram.tab.h awkgram.y
  description = YACC $out

rule maketab
  command = ./maketab $in > $out
  description = MAKETAB $out

rule custom
  command = false
  description = 

rule install-bin
  command = clinst -Dm755 nawk "$destdir/usr/bin/nawk" && ln -s nawk "$destdir/usr/bin/awk"
  description = Installing nawk and linking awk

rule install-man
  command = clman -d $destdir nawk.1 && ln -s nawk.1 "$destdir/usr/share/man/man1/awk.1"
  description = Installing nawk.1 and linking awk.1

build all: phony nawk
build nawk: link b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o awkgram.tab.o
build awkgram.tab.c awkgram.tab.h: yacc awkgram.y | awk.h proto.h
build b.o: cc b.c
build main.o: cc main.c
build parse.o: cc parse.c
build proctab.o: cc proctab.c
build tran.o: cc tran.c
build lib.o: cc lib.c
build run.o: cc run.c
build lex.o: cc lex.c
build awkgram.tab.o: cc awkgram.tab.c
build proctab.c: maketab awkgram.tab.h | maketab
build maketab: link maketab.c
build maketab.o: cc maketab.c | awkgram.tab.h
build PHONY: phony
build INSTALL_BIN: install-bin PHONY
build INSTALL_MAN: install-man PHONY nawk.1
build install: phony INSTALL_BIN INSTALL_MAN
build nawk.1: custom awk.1
  command = cp awk.1 nawk.1
  description = GEN nawk.1
default all