Lines Matching +full:y +full:-

1 # SPDX-License-Identifier: BSD-2-Clause
6 # @(#) Copyright (c) 1999-2011, Simon J. Gerraty
15 # Please send copies of changes and bug-fixes to:
19 # this file contains rules to DTRT when SRCS contains foo.y or foo.c
20 # when only a foo.y exists.
23 YFLAGS?= -v -t
26 YACC.y?= ${YACC} ${YFLAGS}
28 # first deal with explicit *.y in SRCS
29 .for y in ${SRCS:M*.y}
30 .if ${YACC.y:M-d} == "" || defined(NO_RENAME_Y_TAB_H)
31 .ORDER: ${y:T:R}.c y.tab.h
32 y.tab.h: .NOMETA
33 ${y:T:R}.c y.tab.h: $y
34 ${YACC.y} ${.IMPSRC}
35 [ ! -s y.tab.c ] || mv y.tab.c ${.TARGET}
36 ${RM} -f y.tab.[!h]
38 .ORDER: ${y:T:R}.c ${y:T:R}.h
39 ${y:T:R}.h: .NOMETA
40 ${y:T:R}.c ${y:T:R}.h: $y
41 ${YACC.y} ${.IMPSRC}
42 [ ! -s y.tab.c ] || mv y.tab.c ${.TARGET:T:R}.c
43 [ ! -s y.tab.h ] || cmp -s y.tab.h ${.TARGET:T:R}.h \
44 || mv y.tab.h ${.TARGET:T:R}.h
45 ${RM} -f y.tab.*
49 .if ${SRCS:M*.y} == ""
50 .if ${YACC.y:M-d} == "" || defined(NO_RENAME_Y_TAB_H)
52 .y.c:
53 ${YACC.y} ${.IMPSRC}
54 [ ! -s y.tab.c ] || mv y.tab.c ${.TARGET}
55 ${RM} -f y.tab.[!h]
60 .y.h:
61 ${YACC.y} ${.IMPSRC}
62 [ ! -s y.tab.c ] || mv y.tab.c ${.TARGET:T:R}.c
63 [ ! -s y.tab.h ] || cmp -s y.tab.h ${.TARGET:T:R}.h \
64 || mv y.tab.h ${.TARGET:T:R}.h
66 ${RM} -f y.tab.*
68 # Normally the .y.h rule does the work - to avoid races.
71 .y.c: ${.TARGET:T:R}.h
72 [ -s ${.TARGET} ] || { \
73 ${YACC.y} ${.IMPSRC} && \
74 { [ ! -s y.tab.c ] || mv y.tab.c ${.TARGET}; \
75 ${RM} y.tab.*; }; }
79 beforedepend: ${SRCS:T:M*.y:S/.y/.c/g}
81 CLEANFILES+= ${SRCS:T:M*.y:S/.y/.[ch]/g}
82 CLEANFILES+= y.tab.[ch]