aboutsummaryrefslogtreecommitdiffstats
path: root/makefile
diff options
context:
space:
mode:
authorChristoph Junghans <junghans@gentoo.org>2018-12-30 09:04:34 -0700
committerChristoph Junghans <junghans@gentoo.org>2018-12-30 09:04:34 -0700
commite4bb3bcbf09082748f91d312dad150246ab8b6fb (patch)
tree56d60b331ccefe224f19e89750da54f3b865be50 /makefile
parente8c280034fad30d5234590ac3c62ebd0fe3d25dd (diff)
downloadplatform_external_one-true-awk-e4bb3bcbf09082748f91d312dad150246ab8b6fb.tar.gz
platform_external_one-true-awk-e4bb3bcbf09082748f91d312dad150246ab8b6fb.tar.bz2
platform_external_one-true-awk-e4bb3bcbf09082748f91d312dad150246ab8b6fb.zip
fixed parallel build
Signed-off-by: Christoph Junghans <junghans@gentoo.org>
Diffstat (limited to 'makefile')
-rw-r--r--makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/makefile b/makefile
index e0a43da..3f3c3c2 100644
--- a/makefile
+++ b/makefile
@@ -54,10 +54,15 @@ a.out: ytab.o $(OFILES)
$(OFILES): awk.h ytab.h proto.h
-ytab.c: awk.h proto.h awkgram.y
+#Clear dependency for parallel build: (make -j)
+#YACC generated y.tab.c and y.tab.h at the same time
+#this needs to be a static pattern rules otherwise multiple target
+#are mapped onto multiple executions of yacc, which overwrite
+#each others outputs.
+y%.c y%.h: awk.h proto.h awkgram.y
$(YACC) $(YFLAGS) awkgram.y
- mv y.tab.c ytab.c
- mv y.tab.h ytab.h
+ mv y.$*.c y$*.c
+ mv y.$*.h y$*.h
ytab.h: ytab.c