Annotation of src/share/mk/bsd.sys.mk, Revision 1.124
1.124 ! jwise 1: # $NetBSD: bsd.sys.mk,v 1.123 2005/08/09 22:16:19 he Exp $
1.1 christos 2: #
1.58 tv 3: # Build definitions used for NetBSD source tree builds.
1.2 cgd 4:
1.94 lukem 5: .if !defined(_BSD_SYS_MK_)
6: _BSD_SYS_MK_=1
1.96 lukem 7:
1.35 christos 8: .if defined(WARNS)
9: .if ${WARNS} > 0
1.60 tv 10: CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
11: #CFLAGS+= -Wmissing-declarations -Wredundant-decls -Wnested-externs
1.82 thorpej 12: # Add -Wno-sign-compare. -Wsign-compare is included in -Wall as of GCC 3.3,
1.95 christos 13: # but our sources aren't up for it yet. Also, add -Wno-traditional because
14: # gcc includes #elif in the warnings, which is 'this code will not compile
15: # in a traditional environment' warning, as opposed to 'this code behaves
16: # differently in traditional and ansi environments' which is the warning
17: # we wanted, and now we don't get anymore.
18: CFLAGS+= -Wno-sign-compare -Wno-traditional
1.119 lukem 19: .if !defined(HAVE_GCC3) || (${HAVE_GCC3} == "no")
1.60 tv 20: CFLAGS+= -Wno-uninitialized
1.35 christos 21: .endif
1.119 lukem 22: .endif
1.35 christos 23: .if ${WARNS} > 1
1.79 msaitoh 24: CFLAGS+= -Wreturn-type -Wswitch -Wshadow
1.56 lukem 25: .endif
26: .if ${WARNS} > 2
1.60 tv 27: CFLAGS+= -Wcast-qual -Wwrite-strings
1.122 he 28: .if defined(HAVE_GCC3) && (${HAVE_GCC3} != "no")
1.123 he 29: CXXFLAGS+= -Wabi
30: .if (${MACHINE_CPU} != "sh3")
31: CXXFLAGS+= -Wold-style-cast
32: .endif
1.122 he 33: .endif
34: CXXFLAGS+= -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder \
35: -Wno-deprecated -Wno-non-template-friend \
1.121 christos 36: -Woverloaded-virtual -Wno-pmf-conversions -Wsign-promo -Wsynth
1.35 christos 37: .endif
1.116 tron 38: .if ${WARNS} > 3 && ${MACHINE_ARCH} != "vax"
1.115 matt 39: CFLAGS+= -std=c99
40: .endif
1.9 christos 41: .endif
1.41 sommerfe 42:
1.43 thorpej 43: .if defined(WFORMAT) && defined(FORMAT_AUDIT)
44: .if ${WFORMAT} > 1
1.60 tv 45: CFLAGS+= -Wnetbsd-format-audit -Wno-format-extra-args
1.41 sommerfe 46: .endif
47: .endif
48:
1.61 tv 49: CPPFLAGS+= ${AUDIT:D-D__AUDIT__}
1.66 tv 50: CFLAGS+= ${CWARNFLAGS} ${NOGCCERROR:D:U-Werror}
1.53 tv 51: LINTFLAGS+= ${DESTDIR:D-d ${DESTDIR}/usr/include}
1.47 simonb 52:
1.62 wiz 53: .if defined(MKSOFTFLOAT) && (${MKSOFTFLOAT} != "no")
1.47 simonb 54: COPTS+= -msoft-float
55: FOPTS+= -msoft-float
1.70 ross 56: .endif
57:
58: .if defined(MKIEEEFP) && (${MKIEEEFP} != "no")
59: .if ${MACHINE_ARCH} == "alpha"
60: CFLAGS+= -mieee
61: FFLAGS+= -mieee
62: .endif
1.81 mrg 63: .endif
64:
65: .if ${MACHINE} == "sparc64" && ${MACHINE_ARCH} == "sparc"
66: CFLAGS+= -Wa,-Av8plus
1.3 scottr 67: .endif
1.87 thorpej 68:
69: CFLAGS+= ${CPUFLAGS}
1.114 simonb 70: AFLAGS+= ${CPUFLAGS}
1.4 thorpej 71:
72: # Helpers for cross-compiling
73: HOST_CC?= cc
74: HOST_CFLAGS?= -O
75: HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
1.124 ! jwise 76: HOST_COMPILE.cc?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} -c
! 77: .if defined(HOSTPROG_CXX)
! 78: HOST_LINK.c?= ${HOST_CXX} ${HOST_CXXFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
! 79: .else
1.4 thorpej 80: HOST_LINK.c?= ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
1.124 ! jwise 81: .endif
1.49 tv 82:
83: HOST_CXX?= c++
84: HOST_CXXFLAGS?= -O
1.4 thorpej 85:
86: HOST_CPP?= cpp
87: HOST_CPPFLAGS?=
88:
89: HOST_LD?= ld
90: HOST_LDFLAGS?=
1.60 tv 91:
92: HOST_AR?= ar
93: HOST_RANLIB?= ranlib
1.108 matt 94:
95: HOST_LN?= ln
1.84 christos 96:
1.85 christos 97: .if !empty(HOST_CYGWIN)
1.84 christos 98: HOST_SH?= /usr/bin/bash
99: .else
100: HOST_SH?= sh
101: .endif
1.28 tv 102:
1.77 simonb 103: ELF2ECOFF?= elf2ecoff
1.74 lukem 104: MKDEP?= mkdep
105: OBJCOPY?= objcopy
1.117 riz 106: OBJDUMP?= objdump
1.74 lukem 107: STRIP?= strip
1.109 matt 108:
109: AWK?= awk
1.89 lukem 110:
111: TOOL_ASN1_COMPILE?= asn1_compile
112: TOOL_CAP_MKDB?= cap_mkdb
113: TOOL_CAT?= cat
114: TOOL_CKSUM?= cksum
115: TOOL_COMPILE_ET?= compile_et
116: TOOL_CONFIG?= config
117: TOOL_CRUNCHGEN?= crunchgen
118: TOOL_CTAGS?= ctags
119: TOOL_DB?= db
120: TOOL_EQN?= eqn
121: TOOL_FGEN?= fgen
1.118 christos 122: TOOL_GENASSYM?= genassym
1.89 lukem 123: TOOL_GENCAT?= gencat
124: TOOL_GROFF?= groff
125: TOOL_HEXDUMP?= hexdump
126: TOOL_INDXBIB?= indxbib
127: TOOL_INSTALLBOOT?= installboot
128: TOOL_INSTALL_INFO?= install-info
129: TOOL_M4?= m4
130: TOOL_MAKEFS?= makefs
131: TOOL_MAKEINFO?= makeinfo
1.90 lukem 132: TOOL_MAKEWHATIS?= /usr/libexec/makewhatis
1.89 lukem 133: TOOL_MDSETIMAGE?= mdsetimage
134: TOOL_MENUC?= menuc
135: TOOL_MKCSMAPPER?= mkcsmapper
136: TOOL_MKESDB?= mkesdb
137: TOOL_MKLOCALE?= mklocale
138: TOOL_MKMAGIC?= file
139: TOOL_MKTEMP?= mktemp
140: TOOL_MSGC?= msgc
141: TOOL_MTREE?= mtree
142: TOOL_PAX?= pax
143: TOOL_PIC?= pic
144: TOOL_PREPMKBOOTIMAGE?= prep-mkbootimage
145: TOOL_PWD_MKDB?= pwd_mkdb
146: TOOL_REFER?= refer
147: TOOL_ROFF_ASCII?= nroff
148: TOOL_ROFF_DVI?= ${TOOL_GROFF} -Tdvi
1.91 lukem 149: TOOL_ROFF_HTML?= ${TOOL_GROFF} -Tlatin1 -mdoc2html
1.89 lukem 150: TOOL_ROFF_PS?= ${TOOL_GROFF} -Tps
151: TOOL_ROFF_RAW?= ${TOOL_GROFF} -Z
152: TOOL_RPCGEN?= rpcgen
153: TOOL_SOELIM?= soelim
1.92 lukem 154: TOOL_STAT?= stat
1.113 abs 155: TOOL_SPARKCRC?= sparkcrc
1.89 lukem 156: TOOL_SUNLABEL?= sunlabel
157: TOOL_TBL?= tbl
158: TOOL_UUDECODE?= uudecode
159: TOOL_VGRIND?= vgrind -f
160: TOOL_ZIC?= zic
1.13 lukem 161:
1.124 ! jwise 162: .SUFFIXES: .o .ln .lo .c .cc .cpp .cxx .C .m ${YHEADER:D.h}
1.93 lukem 163:
164: # C
165: .c.o:
1.104 lukem 166: ${_MKTARGET_COMPILE}
1.93 lukem 167: ${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
1.112 lukem 168:
1.93 lukem 169: .c.ln:
1.104 lukem 170: ${_MKTARGET_COMPILE}
1.111 lukem 171: ${LINT} ${LINTFLAGS} \
172: ${CPPFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
173: ${CPPFLAGS.${.IMPSRC:T}:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
174: -i ${.IMPSRC}
1.29 tv 175:
1.103 lukem 176: # C++
177: .cc.o .cpp.o .cxx.o .C.o:
1.104 lukem 178: ${_MKTARGET_COMPILE}
1.103 lukem 179: ${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
180:
1.13 lukem 181: # Objective C
182: # (Defined here rather than in <sys.mk> because `.m' is not just
183: # used for Objective C source)
184: .m.o:
1.104 lukem 185: ${_MKTARGET_COMPILE}
1.13 lukem 186: ${COMPILE.m} ${.IMPSRC}
1.29 tv 187:
188: # Host-compiled C objects
1.76 bjh21 189: # The intermediate step is necessary for Sun CC, which objects to calling
190: # object files anything but *.o
1.29 tv 191: .c.lo:
1.104 lukem 192: ${_MKTARGET_COMPILE}
1.110 lukem 193: ${HOST_COMPILE.c} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
1.76 bjh21 194: mv ${.TARGET}.o ${.TARGET}
1.98 lukem 195:
1.124 ! jwise 196: # C++
! 197: .cc.lo .cpp.lo .cxx.lo .C.lo:
! 198: ${_MKTARGET_COMPILE}
! 199: ${HOST_COMPILE.cc} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
! 200: mv ${.TARGET}.o ${.TARGET}
! 201:
1.98 lukem 202: # Assembly
203: .s.o:
1.104 lukem 204: ${_MKTARGET_COMPILE}
1.98 lukem 205: ${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
1.107 lukem 206:
1.98 lukem 207: .S.o:
1.104 lukem 208: ${_MKTARGET_COMPILE}
1.98 lukem 209: ${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
1.13 lukem 210:
1.52 tv 211: # Lex
212: LPREFIX?= yy
213: LFLAGS+= -P${LPREFIX}
1.1 christos 214:
215: .l.c:
1.104 lukem 216: ${_MKTARGET_LEX}
1.1 christos 217: ${LEX.l} -o${.TARGET} ${.IMPSRC}
218:
219: # Yacc
1.52 tv 220: YFLAGS+= ${YPREFIX:D-p${YPREFIX}} ${YHEADER:D-d}
221:
1.33 lukem 222: .y.c:
1.104 lukem 223: ${_MKTARGET_YACC}
1.33 lukem 224: ${YACC.y} -o ${.TARGET} ${.IMPSRC}
1.55 tv 225:
226: .ifdef YHEADER
227: .y.h: ${.TARGET:.h=.c}
228: .endif
1.64 thorpej 229:
1.94 lukem 230: .endif # !defined(_BSD_SYS_MK_)
CVSweb <webmaster@jp.NetBSD.org>