1From 971d48a00ef82880c34e89778bf430a01360ebd5 Mon Sep 17 00:00:00 2001
2From: Roy Li <rongqing.li@windriver.com>
3Date: Mon, 18 May 2015 16:28:36 +0800
4Subject: [PATCH] [PATCH] fix the YACC rule to fix a building failure
5
6Upstream-Statu: Pending
7
8The original rule will create the header file twice, one is that the header
9file as the object file is created, other time is when create the C source file.
10since YACC always has "-d" parameter.
11
12This lead to a race when compile amd_tok.o, the header file maybe rewritten.
13  |----------------------
14  |amd_tok.l:359:10: error: 'RBRACKET' undeclared (first use in this function)
15  |  ")" { return RBRACKET; }
16  |          ^
17  |../Makefile.rules:64: recipe for target 'amd_tok.o' failed
18  |----------------------
19Signed-off-by: Roy Li <rongqing.li@windriver.com>
20
21---
22Upstream-Status: Pending
23
24 lib/Makefile     | 6 ++++--
25 modules/Makefile | 3 ++-
26 2 files changed, 6 insertions(+), 3 deletions(-)
27
28--- a/lib/Makefile
29+++ b/lib/Makefile
30@@ -53,7 +53,8 @@ mount_xdr.o: mount_xdr.c
31 nss_tok.c: nss_tok.l
32 	$(LEX) -o$@ -Pnss_ $?
33
34-nss_parse.tab.c nss_parse.tab.h: nss_parse.y
35+nss_parse.tab.h: nss_parse.tab.c
36+nss_parse.tab.c: nss_parse.y
37 	$(YACC) -v -d -p nss_ -b nss_parse $?
38
39 nss_tok.o: nss_tok.c nss_parse.tab.h
40--- a/modules/Makefile
41+++ b/modules/Makefile
42@@ -103,7 +103,8 @@ amd_tok.c: amd_tok.l
43
44 amd_tok.o: amd_tok.c amd_parse.tab.h
45
46-amd_parse.tab.c amd_parse.tab.h: amd_parse.y
47+amd_parse.tab.h: amd_parse.tab.c
48+amd_parse.tab.c: amd_parse.y
49 	$(YACC) -v -d -p amd_ -b amd_parse $?
50
51 amd_parse.tab.o: amd_parse.tab.c amd_parse.tab.h
52--- a/daemon/Makefile
53+++ b/daemon/Makefile
54@@ -16,7 +16,7 @@ YACCSRC = master_tok.c master_parse.tab.
55 version := $(shell cat ../.version)
56
57 CFLAGS += -rdynamic $(DAEMON_CFLAGS) -D_GNU_SOURCE -I../include
58-CFLAGS += -DAUTOFS_LIB_DIR=\"$(autofslibdir)\"
59+CFLAGS += -DAUTOFS_LIB_DIR=\"$(autofslibdir)\"
60 CFLAGS += -DAUTOFS_MAP_DIR=\"$(autofsmapdir)\"
61 CFLAGS += -DAUTOFS_CONF_DIR=\"$(autofsconfdir)\"
62 CFLAGS += -DAUTOFS_FIFO_DIR=\"$(autofsfifodir)\"
63@@ -44,7 +44,8 @@ automount: $(OBJS) $(AUTOFS_LIB)
64 master_tok.c: master_tok.l
65 	$(LEX) -o$@ -Pmaster_ $?
66
67-master_parse.tab.c master_parse.tab.h: master_parse.y
68+master_parse.tab.h: master_parse.tab.c
69+master_parse.tab.c: master_parse.y
70 	$(YACC) -v -d -p master_ -b master_parse $?
71
72 master_tok.o: master_tok.c master_parse.tab.h
73@@ -57,5 +58,3 @@ clean:
74 install: all
75 	install -d -m 755 $(INSTALLROOT)$(sbindir)
76 	install -c automount -m 755 $(INSTALLROOT)$(sbindir)
77-
78-
79