Tue Jan 7 02:16:42 2014 UTC ()
Non-literal format strings should be an error by default for clang.


(joerg)
diff -r1.231 -r1.232 src/share/mk/bsd.sys.mk

cvs diff -r1.231 -r1.232 src/share/mk/bsd.sys.mk (switch to unified diff)

--- src/share/mk/bsd.sys.mk 2013/12/16 21:34:16 1.231
+++ src/share/mk/bsd.sys.mk 2014/01/07 02:16:41 1.232
@@ -1,278 +1,277 @@ @@ -1,278 +1,277 @@
1# $NetBSD: bsd.sys.mk,v 1.231 2013/12/16 21:34:16 matt Exp $ 1# $NetBSD: bsd.sys.mk,v 1.232 2014/01/07 02:16:41 joerg Exp $
2# 2#
3# Build definitions used for NetBSD source tree builds. 3# Build definitions used for NetBSD source tree builds.
4 4
5.if !defined(_BSD_SYS_MK_) 5.if !defined(_BSD_SYS_MK_)
6_BSD_SYS_MK_=1 6_BSD_SYS_MK_=1
7 7
8.if ${MKREPRO:Uno} == "yes" 8.if ${MKREPRO:Uno} == "yes"
9CPPFLAGS+= -Wp,-iremap,${NETBSDSRCDIR}:/usr/src 9CPPFLAGS+= -Wp,-iremap,${NETBSDSRCDIR}:/usr/src
10CPPFLAGS+= -Wp,-iremap,${DESTDIR}/:/ 10CPPFLAGS+= -Wp,-iremap,${DESTDIR}/:/
11CPPFLAGS+= -Wp,-iremap,${X11SRCDIR}:/usr/xsrc 11CPPFLAGS+= -Wp,-iremap,${X11SRCDIR}:/usr/xsrc
12.endif 12.endif
13 13
14# Enable c99 mode by default. 14# Enable c99 mode by default.
15# This has the side effect of complaining for missing prototypes 15# This has the side effect of complaining for missing prototypes
16# implicit type declarations and missing return statements. 16# implicit type declarations and missing return statements.
17.if defined(HAVE_GCC) || defined(HAVE_LLVM) 17.if defined(HAVE_GCC) || defined(HAVE_LLVM)
18CFLAGS+= -std=gnu99 18CFLAGS+= -std=gnu99
19.endif 19.endif
20 20
21.if defined(WARNS) 21.if defined(WARNS)
22CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wno-sign-compare -Wno-pointer-sign :} 22CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wno-sign-compare -Wno-pointer-sign :}
23.if ${WARNS} > 0 23.if ${WARNS} > 0
24CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 24CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
25#CFLAGS+= -Wmissing-declarations -Wredundant-decls -Wnested-externs 25#CFLAGS+= -Wmissing-declarations -Wredundant-decls -Wnested-externs
26# Add -Wno-sign-compare. -Wsign-compare is included in -Wall as of GCC 3.3, 26# Add -Wno-sign-compare. -Wsign-compare is included in -Wall as of GCC 3.3,
27# but our sources aren't up for it yet. Also, add -Wno-traditional because 27# but our sources aren't up for it yet. Also, add -Wno-traditional because
28# gcc includes #elif in the warnings, which is 'this code will not compile 28# gcc includes #elif in the warnings, which is 'this code will not compile
29# in a traditional environment' warning, as opposed to 'this code behaves 29# in a traditional environment' warning, as opposed to 'this code behaves
30# differently in traditional and ansi environments' which is the warning 30# differently in traditional and ansi environments' which is the warning
31# we wanted, and now we don't get anymore. 31# we wanted, and now we don't get anymore.
32CFLAGS+= -Wno-sign-compare 32CFLAGS+= -Wno-sign-compare
33CFLAGS+= ${${ACTIVE_CC} != "clang":? -Wno-traditional :} 33CFLAGS+= ${${ACTIVE_CC} != "clang":? -Wno-traditional :}
34.if !defined(NOGCCERROR) 34.if !defined(NOGCCERROR)
35# Set assembler warnings to be fatal 35# Set assembler warnings to be fatal
36CFLAGS+= -Wa,--fatal-warnings 36CFLAGS+= -Wa,--fatal-warnings
37.endif 37.endif
38# Set linker warnings to be fatal 38# Set linker warnings to be fatal
39# XXX no proper way to avoid "FOO is a patented algorithm" warnings 39# XXX no proper way to avoid "FOO is a patented algorithm" warnings
40# XXX on linking static libs 40# XXX on linking static libs
41.if (!defined(MKPIC) || ${MKPIC} != "no") && \ 41.if (!defined(MKPIC) || ${MKPIC} != "no") && \
42 (!defined(LDSTATIC) || ${LDSTATIC} != "-static") 42 (!defined(LDSTATIC) || ${LDSTATIC} != "-static")
43# XXX there are some strange problems not yet resolved 43# XXX there are some strange problems not yet resolved
44. if !defined(HAVE_GCC) || defined(HAVE_LLVM) 44. if !defined(HAVE_GCC) || defined(HAVE_LLVM)
45LDFLAGS+= -Wl,--fatal-warnings 45LDFLAGS+= -Wl,--fatal-warnings
46. endif 46. endif
47.endif 47.endif
48.endif 48.endif
49.if ${WARNS} > 1 49.if ${WARNS} > 1
50CFLAGS+= -Wreturn-type -Wswitch -Wshadow 50CFLAGS+= -Wreturn-type -Wswitch -Wshadow
51.endif 51.endif
52.if ${WARNS} > 2 52.if ${WARNS} > 2
53CFLAGS+= -Wcast-qual -Wwrite-strings 53CFLAGS+= -Wcast-qual -Wwrite-strings
54CFLAGS+= -Wextra -Wno-unused-parameter 54CFLAGS+= -Wextra -Wno-unused-parameter
55# Readd -Wno-sign-compare to override -Wextra with clang 55# Readd -Wno-sign-compare to override -Wextra with clang
56CFLAGS+= -Wno-sign-compare 56CFLAGS+= -Wno-sign-compare
57CXXFLAGS+= -Wabi 57CXXFLAGS+= -Wabi
58CXXFLAGS+= -Wold-style-cast 58CXXFLAGS+= -Wold-style-cast
59CXXFLAGS+= -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder \ 59CXXFLAGS+= -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder \
60 -Wno-deprecated -Woverloaded-virtual -Wsign-promo -Wsynth 60 -Wno-deprecated -Woverloaded-virtual -Wsign-promo -Wsynth
61CXXFLAGS+= ${${ACTIVE_CXX} == "gcc":? -Wno-non-template-friend -Wno-pmf-conversions :} 61CXXFLAGS+= ${${ACTIVE_CXX} == "gcc":? -Wno-non-template-friend -Wno-pmf-conversions :}
62.endif 62.endif
63.if ${WARNS} > 3 && (defined(HAVE_GCC) || defined(HAVE_LLVM)) 63.if ${WARNS} > 3 && (defined(HAVE_GCC) || defined(HAVE_LLVM))
64.if ${WARNS} > 4 64.if ${WARNS} > 4
65CFLAGS+= -Wold-style-definition 65CFLAGS+= -Wold-style-definition
66.endif 66.endif
67.if ${WARNS} > 5 && !(defined(HAVE_GCC) && ${HAVE_GCC} <= 45) 67.if ${WARNS} > 5 && !(defined(HAVE_GCC) && ${HAVE_GCC} <= 45)
68CFLAGS+= -Wconversion 68CFLAGS+= -Wconversion
69.endif 69.endif
70CFLAGS+= -Wsign-compare -Wformat=2 70CFLAGS+= -Wsign-compare -Wformat=2
71CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wno-error=format-nonliteral :} 
72CFLAGS+= ${${ACTIVE_CC} == "gcc":? -Wno-format-zero-length :} 71CFLAGS+= ${${ACTIVE_CC} == "gcc":? -Wno-format-zero-length :}
73.endif 72.endif
74.if ${WARNS} > 3 && defined(HAVE_LLVM) 73.if ${WARNS} > 3 && defined(HAVE_LLVM)
75CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wpointer-sign -Wmissing-noreturn :} 74CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wpointer-sign -Wmissing-noreturn :}
76.endif 75.endif
77.if (defined(HAVE_GCC) && ${HAVE_GCC} >= 45 \ 76.if (defined(HAVE_GCC) && ${HAVE_GCC} >= 45 \
78 && (${MACHINE_ARCH} == "coldfire" || \ 77 && (${MACHINE_ARCH} == "coldfire" || \
79 ${MACHINE_ARCH} == "sh3eb" || \ 78 ${MACHINE_ARCH} == "sh3eb" || \
80 ${MACHINE_ARCH} == "sh3el" || \ 79 ${MACHINE_ARCH} == "sh3el" || \
81 ${MACHINE_ARCH} == "m68k" || \ 80 ${MACHINE_ARCH} == "m68k" || \
82 ${MACHINE_ARCH} == "m68000")) 81 ${MACHINE_ARCH} == "m68000"))
83# XXX GCC 4.5 for sh3 and m68k (which we compile with -Os) is extra noisy for 82# XXX GCC 4.5 for sh3 and m68k (which we compile with -Os) is extra noisy for
84# cases it should be better with 83# cases it should be better with
85CFLAGS+= -Wno-uninitialized 84CFLAGS+= -Wno-uninitialized
86.if ${HAVE_GCC} >= 48 85.if ${HAVE_GCC} >= 48
87CFLAGS+= -Wno-maybe-uninitialized 86CFLAGS+= -Wno-maybe-uninitialized
88.endif 87.endif
89.endif 88.endif
90.endif 89.endif
91 90
92CWARNFLAGS+= ${CWARNFLAGS.${ACTIVE_CC}} 91CWARNFLAGS+= ${CWARNFLAGS.${ACTIVE_CC}}
93 92
94CPPFLAGS+= ${AUDIT:D-D__AUDIT__} 93CPPFLAGS+= ${AUDIT:D-D__AUDIT__}
95_NOWERROR= ${defined(NOGCCERROR) || (${ACTIVE_CC} == "clang" && defined(NOCLANGERROR)):?yes:no} 94_NOWERROR= ${defined(NOGCCERROR) || (${ACTIVE_CC} == "clang" && defined(NOCLANGERROR)):?yes:no}
96CFLAGS+= ${${_NOWERROR} == "no" :?-Werror:} ${CWARNFLAGS} 95CFLAGS+= ${${_NOWERROR} == "no" :?-Werror:} ${CWARNFLAGS}
97LINTFLAGS+= ${DESTDIR:D-d ${DESTDIR}/usr/include} 96LINTFLAGS+= ${DESTDIR:D-d ${DESTDIR}/usr/include}
98 97
99.if (${USE_SSP:Uno} != "no") && (${BINDIR:Ux} != "/usr/mdec") 98.if (${USE_SSP:Uno} != "no") && (${BINDIR:Ux} != "/usr/mdec")
100.if !defined(KERNSRCDIR) && !defined(KERN) # not for kernels nor kern modules 99.if !defined(KERNSRCDIR) && !defined(KERN) # not for kernels nor kern modules
101CPPFLAGS+= -D_FORTIFY_SOURCE=2 100CPPFLAGS+= -D_FORTIFY_SOURCE=2
102.endif 101.endif
103COPTS+= -fstack-protector -Wstack-protector  102COPTS+= -fstack-protector -Wstack-protector
104COPTS+= ${${ACTIVE_CC} == "clang":? --param ssp-buffer-size=1 :} 103COPTS+= ${${ACTIVE_CC} == "clang":? --param ssp-buffer-size=1 :}
105COPTS+= ${${ACTIVE_CC} == "gcc":? --param ssp-buffer-size=1 :} 104COPTS+= ${${ACTIVE_CC} == "gcc":? --param ssp-buffer-size=1 :}
106.endif 105.endif
107 106
108.if ${MKSOFTFLOAT:Uno} != "no" 107.if ${MKSOFTFLOAT:Uno} != "no"
109COPTS+= -msoft-float 108COPTS+= -msoft-float
110FOPTS+= -msoft-float 109FOPTS+= -msoft-float
111.elif ${MACHINE_ARCH} == "coldfire" 110.elif ${MACHINE_ARCH} == "coldfire"
112COPTS+= -mhard-float 111COPTS+= -mhard-float
113FOPTS+= -mhard-float 112FOPTS+= -mhard-float
114.endif 113.endif
115 114
116.if ${MKIEEEFP:Uno} != "no" 115.if ${MKIEEEFP:Uno} != "no"
117.if ${MACHINE_ARCH} == "alpha" 116.if ${MACHINE_ARCH} == "alpha"
118CFLAGS+= -mieee 117CFLAGS+= -mieee
119FFLAGS+= -mieee 118FFLAGS+= -mieee
120.endif 119.endif
121.endif 120.endif
122 121
123.if ${MACHINE} == "sparc64" && ${MACHINE_ARCH} == "sparc" 122.if ${MACHINE} == "sparc64" && ${MACHINE_ARCH} == "sparc"
124CFLAGS+= -Wa,-Av8plus 123CFLAGS+= -Wa,-Av8plus
125.endif 124.endif
126 125
127.if !defined(NOGCCERROR) 126.if !defined(NOGCCERROR)
128.if (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb") 127.if (${MACHINE_ARCH} == "mips64el") || (${MACHINE_ARCH} == "mips64eb")
129CPUFLAGS+= -Wa,--fatal-warnings 128CPUFLAGS+= -Wa,--fatal-warnings
130.endif 129.endif
131.endif 130.endif
132 131
133#.if ${MACHINE} == "sbmips" 132#.if ${MACHINE} == "sbmips"
134#CFLAGS+= -mips64 -mtune=sb1 133#CFLAGS+= -mips64 -mtune=sb1
135#.endif 134#.endif
136 135
137#.if (${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb") && \ 136#.if (${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb") && \
138# (defined(MKPIC) && ${MKPIC} == "no") 137# (defined(MKPIC) && ${MKPIC} == "no")
139#CPUFLAGS+= -mno-abicalls -fno-PIC 138#CPUFLAGS+= -mno-abicalls -fno-PIC
140#.endif 139#.endif
141CFLAGS+= ${CPUFLAGS} 140CFLAGS+= ${CPUFLAGS}
142AFLAGS+= ${CPUFLAGS} 141AFLAGS+= ${CPUFLAGS}
143 142
144.if !defined(LDSTATIC) || ${LDSTATIC} != "-static" 143.if !defined(LDSTATIC) || ${LDSTATIC} != "-static"
145# Position Independent Executable flags 144# Position Independent Executable flags
146PIE_CFLAGS?= -fPIC 145PIE_CFLAGS?= -fPIC
147PIE_LDFLAGS?= -Wl,-pie -shared-libgcc 146PIE_LDFLAGS?= -Wl,-pie -shared-libgcc
148PIE_AFLAGS?= -fPIC 147PIE_AFLAGS?= -fPIC
149.endif 148.endif
150 149
151# Helpers for cross-compiling 150# Helpers for cross-compiling
152HOST_CC?= cc 151HOST_CC?= cc
153HOST_CFLAGS?= -O 152HOST_CFLAGS?= -O
154HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c 153HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
155HOST_COMPILE.cc?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} -c 154HOST_COMPILE.cc?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} -c
156HOST_LINK.cc?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS} 155HOST_LINK.cc?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
157.if defined(HOSTPROG_CXX) 156.if defined(HOSTPROG_CXX)
158HOST_LINK.c?= ${HOST_LINK.cc} 157HOST_LINK.c?= ${HOST_LINK.cc}
159.else 158.else
160HOST_LINK.c?= ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS} 159HOST_LINK.c?= ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
161.endif 160.endif
162 161
163HOST_CXX?= c++ 162HOST_CXX?= c++
164HOST_CXXFLAGS?= -O 163HOST_CXXFLAGS?= -O
165 164
166HOST_CPP?= cpp 165HOST_CPP?= cpp
167HOST_CPPFLAGS?= 166HOST_CPPFLAGS?=
168 167
169HOST_LD?= ld 168HOST_LD?= ld
170HOST_LDFLAGS?= 169HOST_LDFLAGS?=
171 170
172HOST_AR?= ar 171HOST_AR?= ar
173HOST_RANLIB?= ranlib 172HOST_RANLIB?= ranlib
174 173
175HOST_LN?= ln 174HOST_LN?= ln
176 175
177# HOST_SH must be an absolute path 176# HOST_SH must be an absolute path
178HOST_SH?= /bin/sh 177HOST_SH?= /bin/sh
179 178
180ELF2ECOFF?= elf2ecoff 179ELF2ECOFF?= elf2ecoff
181MKDEP?= mkdep 180MKDEP?= mkdep
182MKDEPCXX?= mkdep 181MKDEPCXX?= mkdep
183OBJCOPY?= objcopy 182OBJCOPY?= objcopy
184OBJDUMP?= objdump 183OBJDUMP?= objdump
185PAXCTL?= paxctl 184PAXCTL?= paxctl
186STRIP?= strip 185STRIP?= strip
187 186
188# TOOL_* variables are defined in bsd.own.mk 187# TOOL_* variables are defined in bsd.own.mk
189 188
190.SUFFIXES: .o .ln .lo .c .cc .cpp .cxx .C .m ${YHEADER:D.h} 189.SUFFIXES: .o .ln .lo .c .cc .cpp .cxx .C .m ${YHEADER:D.h}
191 190
192# C 191# C
193.c.o: 192.c.o:
194 ${_MKTARGET_COMPILE} 193 ${_MKTARGET_COMPILE}
195 ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} 194 ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
196.if defined(CTFCONVERT) 195.if defined(CTFCONVERT)
197 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} 196 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
198.endif 197.endif
199 198
200.c.ln: 199.c.ln:
201 ${_MKTARGET_COMPILE} 200 ${_MKTARGET_COMPILE}
202 ${LINT} ${LINTFLAGS} ${LINTFLAGS.${.IMPSRC:T}} \ 201 ${LINT} ${LINTFLAGS} ${LINTFLAGS.${.IMPSRC:T}} \
203 ${CPPFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \ 202 ${CPPFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
204 ${CPPFLAGS.${.IMPSRC:T}:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \ 203 ${CPPFLAGS.${.IMPSRC:T}:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
205 -i ${.IMPSRC} 204 -i ${.IMPSRC}
206 205
207# C++ 206# C++
208.cc.o .cpp.o .cxx.o .C.o: 207.cc.o .cpp.o .cxx.o .C.o:
209 ${_MKTARGET_COMPILE} 208 ${_MKTARGET_COMPILE}
210 ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} 209 ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
211 210
212# Objective C 211# Objective C
213# (Defined here rather than in <sys.mk> because `.m' is not just 212# (Defined here rather than in <sys.mk> because `.m' is not just
214# used for Objective C source) 213# used for Objective C source)
215.m.o: 214.m.o:
216 ${_MKTARGET_COMPILE} 215 ${_MKTARGET_COMPILE}
217 ${COMPILE.m} ${OBJCOPTS} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} 216 ${COMPILE.m} ${OBJCOPTS} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC}
218.if defined(CTFCONVERT) 217.if defined(CTFCONVERT)
219 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} 218 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
220.endif 219.endif
221 220
222# Host-compiled C objects 221# Host-compiled C objects
223# The intermediate step is necessary for Sun CC, which objects to calling 222# The intermediate step is necessary for Sun CC, which objects to calling
224# object files anything but *.o 223# object files anything but *.o
225.c.lo: 224.c.lo:
226 ${_MKTARGET_COMPILE} 225 ${_MKTARGET_COMPILE}
227 ${HOST_COMPILE.c} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} 226 ${HOST_COMPILE.c} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
228 mv ${.TARGET}.o ${.TARGET} 227 mv ${.TARGET}.o ${.TARGET}
229 228
230# C++ 229# C++
231.cc.lo .cpp.lo .cxx.lo .C.lo: 230.cc.lo .cpp.lo .cxx.lo .C.lo:
232 ${_MKTARGET_COMPILE} 231 ${_MKTARGET_COMPILE}
233 ${HOST_COMPILE.cc} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} 232 ${HOST_COMPILE.cc} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
234 mv ${.TARGET}.o ${.TARGET} 233 mv ${.TARGET}.o ${.TARGET}
235 234
236# Assembly 235# Assembly
237.s.o: 236.s.o:
238 ${_MKTARGET_COMPILE} 237 ${_MKTARGET_COMPILE}
239 ${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} 238 ${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
240.if defined(CTFCONVERT) 239.if defined(CTFCONVERT)
241 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} 240 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
242.endif 241.endif
243 242
244.S.o: 243.S.o:
245 ${_MKTARGET_COMPILE} 244 ${_MKTARGET_COMPILE}
246 ${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} 245 ${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
247.if defined(CTFCONVERT) 246.if defined(CTFCONVERT)
248 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} 247 ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
249.endif 248.endif
250 249
251# Lex 250# Lex
252LFLAGS+= ${LPREFIX.${.IMPSRC:T}:D-P${LPREFIX.${.IMPSRC:T}}} 251LFLAGS+= ${LPREFIX.${.IMPSRC:T}:D-P${LPREFIX.${.IMPSRC:T}}}
253LFLAGS+= ${LPREFIX:D-P${LPREFIX}} 252LFLAGS+= ${LPREFIX:D-P${LPREFIX}}
254 253
255.l.c: 254.l.c:
256 ${_MKTARGET_LEX} 255 ${_MKTARGET_LEX}
257 ${LEX.l} -o${.TARGET} ${.IMPSRC} 256 ${LEX.l} -o${.TARGET} ${.IMPSRC}
258 257
259# Yacc 258# Yacc
260YFLAGS+= ${YPREFIX.${.IMPSRC:T}:D-p${YPREFIX.${.IMPSRC:T}}} ${YHEADER.${.IMPSRC:T}:D-d} 259YFLAGS+= ${YPREFIX.${.IMPSRC:T}:D-p${YPREFIX.${.IMPSRC:T}}} ${YHEADER.${.IMPSRC:T}:D-d}
261YFLAGS+= ${YPREFIX:D-p${YPREFIX}} ${YHEADER:D-d} 260YFLAGS+= ${YPREFIX:D-p${YPREFIX}} ${YHEADER:D-d}
262 261
263.y.c: 262.y.c:
264 ${_MKTARGET_YACC} 263 ${_MKTARGET_YACC}
265 ${YACC.y} -o ${.TARGET} ${.IMPSRC} 264 ${YACC.y} -o ${.TARGET} ${.IMPSRC}
266 265
267.ifdef YHEADER 266.ifdef YHEADER
268.if empty(.MAKEFLAGS:M-n) 267.if empty(.MAKEFLAGS:M-n)
269.y.h: ${.TARGET:.h=.c} 268.y.h: ${.TARGET:.h=.c}
270.endif 269.endif
271.endif 270.endif
272 271
273# Objcopy 272# Objcopy
274# ARM big endian needs to preserve $a/$d/$t symbols for the linker. 273# ARM big endian needs to preserve $a/$d/$t symbols for the linker.
275OBJCOPYLIBFLAGS?=${"${.TARGET:M*.po}" != "":?-X:-x} \ 274OBJCOPYLIBFLAGS?=${"${.TARGET:M*.po}" != "":?-X:-x} \
276 ${"${MACHINE_ARCH:M*arm*eb}" != "":?-K '\$a' -K '\$d' -K '\$t':} 275 ${"${MACHINE_ARCH:M*arm*eb}" != "":?-K '\$a' -K '\$d' -K '\$t':}
277 276
278.endif # !defined(_BSD_SYS_MK_) 277.endif # !defined(_BSD_SYS_MK_)