summaryrefslogtreecommitdiff
path: root/pkg/awk/gen.rc
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/awk/gen.rc')
-rw-r--r--pkg/awk/gen.rc25
1 files changed, 25 insertions, 0 deletions
diff --git a/pkg/awk/gen.rc b/pkg/awk/gen.rc
new file mode 100644
index 00000000..9d9b3a2e
--- /dev/null
+++ b/pkg/awk/gen.rc
@@ -0,0 +1,25 @@
+cflags\
+ '-std=c90' \
+ -D '_POSIX_C_SOURCE=200809L' \
+ -I '$outdir' \
+ -I '$srcdir'
+
+yacc gram '$srcdir'/awkgram.y
+build '$outdir'/ytab.h copy '$outdir'/gram.tab.h
+
+{
+ include 'toolchain/$host_toolchain.ninja'
+ cflags -I '$outdir'
+ exe maketab -d '$outdir'/ytab.h maketab.c
+} >tools.ninja ; subninja tools.ninja
+
+rule maketab '(cd $outdir && ./maketab) >$out.tmp && mv $out.tmp $out'
+build '$outdir'/proctab.c maketab '|' '$outdir'/^(maketab ytab.h)
+
+exe awk -d '$outdir'/ytab.h\
+ b.c main.c parse.c tran.c lib.c run.c lex.c\
+ '$outdir'/^(gram.tab.c proctab.c)
+file bin/awk '$outdir'/awk 755
+file share/man/man1/awk.1 '$srcdir'/awk.1 644
+
+fetch git