2003-11-16 19:10:50 +03:00
|
|
|
# $NetBSD: bsd.sys.mk,v 1.110 2003/11/16 16:10:50 lukem Exp $
|
1995-10-22 03:45:53 +03:00
|
|
|
#
|
2001-11-12 00:41:00 +03:00
|
|
|
# Build definitions used for NetBSD source tree builds.
|
1995-12-13 04:25:05 +03:00
|
|
|
|
2003-07-28 06:38:33 +04:00
|
|
|
.if !defined(_BSD_SYS_MK_)
|
|
|
|
_BSD_SYS_MK_=1
|
2001-11-18 01:55:24 +03:00
|
|
|
|
1999-07-08 05:55:38 +04:00
|
|
|
.if defined(WARNS)
|
|
|
|
.if ${WARNS} > 0
|
2001-11-13 23:25:38 +03:00
|
|
|
CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
|
|
|
|
#CFLAGS+= -Wmissing-declarations -Wredundant-decls -Wnested-externs
|
2002-11-25 06:03:13 +03:00
|
|
|
# Add -Wno-sign-compare. -Wsign-compare is included in -Wall as of GCC 3.3,
|
2003-08-22 22:07:21 +04:00
|
|
|
# but our sources aren't up for it yet. Also, add -Wno-traditional because
|
|
|
|
# gcc includes #elif in the warnings, which is 'this code will not compile
|
|
|
|
# in a traditional environment' warning, as opposed to 'this code behaves
|
|
|
|
# differently in traditional and ansi environments' which is the warning
|
|
|
|
# we wanted, and now we don't get anymore.
|
|
|
|
CFLAGS+= -Wno-sign-compare -Wno-traditional
|
2000-05-09 04:15:55 +04:00
|
|
|
# XXX Delete -Wuninitialized by default for now -- the compiler doesn't
|
|
|
|
# XXX always get it right.
|
2001-11-13 23:25:38 +03:00
|
|
|
CFLAGS+= -Wno-uninitialized
|
1997-07-02 01:42:55 +04:00
|
|
|
.endif
|
1999-07-08 05:55:38 +04:00
|
|
|
.if ${WARNS} > 1
|
2002-05-31 01:44:07 +04:00
|
|
|
CFLAGS+= -Wreturn-type -Wswitch -Wshadow
|
2001-11-01 10:17:17 +03:00
|
|
|
.endif
|
|
|
|
.if ${WARNS} > 2
|
2001-11-13 23:25:38 +03:00
|
|
|
CFLAGS+= -Wcast-qual -Wwrite-strings
|
1999-07-08 05:55:38 +04:00
|
|
|
.endif
|
|
|
|
.endif
|
2000-10-04 23:27:45 +04:00
|
|
|
|
2000-10-11 09:45:50 +04:00
|
|
|
.if defined(WFORMAT) && defined(FORMAT_AUDIT)
|
|
|
|
.if ${WFORMAT} > 1
|
2001-11-13 23:25:38 +03:00
|
|
|
CFLAGS+= -Wnetbsd-format-audit -Wno-format-extra-args
|
2000-10-04 23:27:45 +04:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2001-11-15 00:49:53 +03:00
|
|
|
CPPFLAGS+= ${AUDIT:D-D__AUDIT__}
|
2001-11-28 23:12:47 +03:00
|
|
|
CFLAGS+= ${CWARNFLAGS} ${NOGCCERROR:D:U-Werror}
|
2001-10-19 20:28:54 +04:00
|
|
|
LINTFLAGS+= ${DESTDIR:D-d ${DESTDIR}/usr/include}
|
1998-07-27 17:16:52 +04:00
|
|
|
|
2001-11-15 15:15:09 +03:00
|
|
|
.if defined(MKSOFTFLOAT) && (${MKSOFTFLOAT} != "no")
|
2001-06-18 21:04:44 +04:00
|
|
|
COPTS+= -msoft-float
|
|
|
|
FOPTS+= -msoft-float
|
|
|
|
.endif
|
|
|
|
|
2002-01-28 02:33:51 +03:00
|
|
|
.if defined(MKIEEEFP) && (${MKIEEEFP} != "no")
|
|
|
|
.if ${MACHINE_ARCH} == "alpha"
|
|
|
|
CFLAGS+= -mieee
|
|
|
|
FFLAGS+= -mieee
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2002-07-20 15:43:34 +04:00
|
|
|
.if ${MACHINE} == "sparc64" && ${MACHINE_ARCH} == "sparc"
|
|
|
|
CFLAGS+= -Wa,-Av8plus
|
|
|
|
.endif
|
|
|
|
|
2003-05-30 22:43:23 +04:00
|
|
|
CFLAGS+= ${CPUFLAGS}
|
|
|
|
|
1997-04-17 10:43:32 +04:00
|
|
|
# Helpers for cross-compiling
|
|
|
|
HOST_CC?= cc
|
|
|
|
HOST_CFLAGS?= -O
|
|
|
|
HOST_COMPILE.c?=${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} -c
|
|
|
|
HOST_LINK.c?= ${HOST_CC} ${HOST_CFLAGS} ${HOST_CPPFLAGS} ${HOST_LDFLAGS}
|
|
|
|
|
2001-08-14 15:55:04 +04:00
|
|
|
HOST_CXX?= c++
|
|
|
|
HOST_CXXFLAGS?= -O
|
|
|
|
|
1997-04-17 10:43:32 +04:00
|
|
|
HOST_CPP?= cpp
|
|
|
|
HOST_CPPFLAGS?=
|
|
|
|
|
|
|
|
HOST_LD?= ld
|
|
|
|
HOST_LDFLAGS?=
|
|
|
|
|
2001-11-13 23:25:38 +03:00
|
|
|
HOST_AR?= ar
|
|
|
|
HOST_RANLIB?= ranlib
|
|
|
|
|
2003-11-13 08:54:44 +03:00
|
|
|
HOST_LN?= ln
|
|
|
|
|
2003-05-09 00:39:00 +04:00
|
|
|
.if !empty(HOST_CYGWIN)
|
2003-05-08 17:02:09 +04:00
|
|
|
HOST_SH?= /usr/bin/bash
|
|
|
|
.else
|
|
|
|
HOST_SH?= sh
|
|
|
|
.endif
|
|
|
|
|
2002-05-02 17:13:53 +04:00
|
|
|
ELF2ECOFF?= elf2ecoff
|
2001-11-18 01:48:48 +03:00
|
|
|
MKDEP?= mkdep
|
2002-04-03 09:32:58 +04:00
|
|
|
OBJCOPY?= objcopy
|
|
|
|
STRIP?= strip
|
2003-07-10 14:33:58 +04:00
|
|
|
|
2003-11-14 08:22:02 +03:00
|
|
|
AWK?= awk
|
|
|
|
|
2003-07-10 14:33:58 +04:00
|
|
|
TOOL_ASN1_COMPILE?= asn1_compile
|
|
|
|
TOOL_CAP_MKDB?= cap_mkdb
|
|
|
|
TOOL_CAT?= cat
|
|
|
|
TOOL_CKSUM?= cksum
|
|
|
|
TOOL_COMPILE_ET?= compile_et
|
|
|
|
TOOL_CONFIG?= config
|
|
|
|
TOOL_CRUNCHGEN?= crunchgen
|
|
|
|
TOOL_CTAGS?= ctags
|
|
|
|
TOOL_DB?= db
|
|
|
|
TOOL_EQN?= eqn
|
|
|
|
TOOL_FGEN?= fgen
|
|
|
|
TOOL_GENCAT?= gencat
|
|
|
|
TOOL_GROFF?= groff
|
|
|
|
TOOL_HEXDUMP?= hexdump
|
|
|
|
TOOL_INDXBIB?= indxbib
|
|
|
|
TOOL_INSTALLBOOT?= installboot
|
|
|
|
TOOL_INSTALL_INFO?= install-info
|
|
|
|
TOOL_M4?= m4
|
|
|
|
TOOL_MAKEFS?= makefs
|
|
|
|
TOOL_MAKEINFO?= makeinfo
|
2003-07-14 04:41:17 +04:00
|
|
|
TOOL_MAKEWHATIS?= /usr/libexec/makewhatis
|
2003-07-10 14:33:58 +04:00
|
|
|
TOOL_MDSETIMAGE?= mdsetimage
|
|
|
|
TOOL_MENUC?= menuc
|
|
|
|
TOOL_MKCSMAPPER?= mkcsmapper
|
|
|
|
TOOL_MKESDB?= mkesdb
|
|
|
|
TOOL_MKLOCALE?= mklocale
|
|
|
|
TOOL_MKMAGIC?= file
|
|
|
|
TOOL_MKTEMP?= mktemp
|
|
|
|
TOOL_MSGC?= msgc
|
|
|
|
TOOL_MTREE?= mtree
|
|
|
|
TOOL_PAX?= pax
|
|
|
|
TOOL_PIC?= pic
|
|
|
|
TOOL_PREPMKBOOTIMAGE?= prep-mkbootimage
|
|
|
|
TOOL_PWD_MKDB?= pwd_mkdb
|
|
|
|
TOOL_REFER?= refer
|
|
|
|
TOOL_ROFF_ASCII?= nroff
|
|
|
|
TOOL_ROFF_DVI?= ${TOOL_GROFF} -Tdvi
|
2003-07-18 06:52:51 +04:00
|
|
|
TOOL_ROFF_HTML?= ${TOOL_GROFF} -Tlatin1 -mdoc2html
|
2003-07-10 14:33:58 +04:00
|
|
|
TOOL_ROFF_PS?= ${TOOL_GROFF} -Tps
|
|
|
|
TOOL_ROFF_RAW?= ${TOOL_GROFF} -Z
|
|
|
|
TOOL_RPCGEN?= rpcgen
|
|
|
|
TOOL_SOELIM?= soelim
|
2003-07-20 18:36:12 +04:00
|
|
|
TOOL_STAT?= stat
|
2003-07-10 14:33:58 +04:00
|
|
|
TOOL_SUNLABEL?= sunlabel
|
|
|
|
TOOL_TBL?= tbl
|
|
|
|
TOOL_UUDECODE?= uudecode
|
|
|
|
TOOL_VGRIND?= vgrind -f
|
|
|
|
TOOL_ZIC?= zic
|
1998-08-28 03:26:37 +04:00
|
|
|
|
2003-11-08 09:06:50 +03:00
|
|
|
.SUFFIXES: .o .ln .lo .c ${YHEADER:D.h}
|
2003-07-22 10:53:21 +04:00
|
|
|
|
|
|
|
# C
|
|
|
|
.c.o:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
2003-07-22 10:53:21 +04:00
|
|
|
${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
|
|
|
.c.ln:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
2003-07-22 10:53:21 +04:00
|
|
|
${LINT} ${LINTFLAGS} ${CPPFLAGS:M-[IDU]*} ${CPPFLAGS.${.IMPSRC:T}:M-[IDU]*} -i ${.IMPSRC}
|
1998-09-14 00:56:38 +04:00
|
|
|
|
2003-10-20 04:24:22 +04:00
|
|
|
# C++
|
|
|
|
.cc.o .cpp.o .cxx.o .C.o:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
2003-10-20 04:24:22 +04:00
|
|
|
${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
|
|
|
|
1997-10-28 15:40:16 +03:00
|
|
|
# Objective C
|
|
|
|
# (Defined here rather than in <sys.mk> because `.m' is not just
|
|
|
|
# used for Objective C source)
|
|
|
|
.m.o:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
1997-10-28 15:40:16 +03:00
|
|
|
${COMPILE.m} ${.IMPSRC}
|
|
|
|
|
1998-09-14 00:56:38 +04:00
|
|
|
# Host-compiled C objects
|
2002-04-23 04:15:45 +04:00
|
|
|
# The intermediate step is necessary for Sun CC, which objects to calling
|
|
|
|
# object files anything but *.o
|
1998-09-14 00:56:38 +04:00
|
|
|
.c.lo:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
2003-11-16 19:10:50 +03:00
|
|
|
${HOST_COMPILE.c} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
2002-04-23 04:15:45 +04:00
|
|
|
mv ${.TARGET}.o ${.TARGET}
|
1998-09-14 00:56:38 +04:00
|
|
|
|
2003-10-19 06:11:29 +04:00
|
|
|
# Assembly
|
|
|
|
.s.o:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
2003-10-19 06:11:29 +04:00
|
|
|
${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
2003-11-08 09:06:50 +03:00
|
|
|
|
2003-10-19 06:11:29 +04:00
|
|
|
.S.o:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
2003-10-19 06:11:29 +04:00
|
|
|
${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
|
|
|
|
1995-10-22 03:45:53 +03:00
|
|
|
# Lex
|
2001-10-19 20:15:40 +04:00
|
|
|
LPREFIX?= yy
|
|
|
|
LFLAGS+= -P${LPREFIX}
|
|
|
|
|
1995-10-22 03:45:53 +03:00
|
|
|
.l.c:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_LEX}
|
1995-10-22 03:45:53 +03:00
|
|
|
${LEX.l} -o${.TARGET} ${.IMPSRC}
|
|
|
|
|
|
|
|
# Yacc
|
2001-10-19 20:15:40 +04:00
|
|
|
YFLAGS+= ${YPREFIX:D-p${YPREFIX}} ${YHEADER:D-d}
|
|
|
|
|
1998-04-01 20:58:33 +04:00
|
|
|
.y.c:
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_YACC}
|
1998-11-01 06:46:28 +03:00
|
|
|
${YACC.y} -o ${.TARGET} ${.IMPSRC}
|
2001-10-19 23:07:48 +04:00
|
|
|
|
|
|
|
.ifdef YHEADER
|
|
|
|
.y.h: ${.TARGET:.h=.c}
|
|
|
|
.endif
|
2001-11-18 01:55:24 +03:00
|
|
|
|
2003-07-28 06:38:33 +04:00
|
|
|
.endif # !defined(_BSD_SYS_MK_)
|