2002-07-20 15:43:34 +04:00
|
|
|
# $NetBSD: bsd.sys.mk,v 1.81 2002/07/20 11:43:34 mrg 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
|
|
|
|
2001-11-18 01:55:24 +03:00
|
|
|
.if !target(__bsd_sys_mk__)
|
|
|
|
__bsd_sys_mk__:
|
|
|
|
|
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
|
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
|
|
|
|
|
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
|
|
|
|
|
2002-04-01 17:30:24 +04:00
|
|
|
CAP_MKDB?= cap_mkdb
|
2002-06-11 20:25:11 +04:00
|
|
|
CAT?= cat
|
2002-03-31 19:01:39 +04:00
|
|
|
CKSUM?= cksum
|
1999-09-16 04:28:31 +04:00
|
|
|
CONFIG?= config
|
2001-11-12 00:41:00 +03:00
|
|
|
CRUNCHGEN?= crunchgen
|
2002-05-02 17:13:53 +04:00
|
|
|
ELF2ECOFF?= elf2ecoff
|
2002-05-29 01:56:05 +04:00
|
|
|
FGEN?= fgen
|
2001-11-13 02:16:17 +03:00
|
|
|
GROFF?= groff
|
2002-04-03 09:32:58 +04:00
|
|
|
INSTALLBOOT?= installboot
|
2002-01-25 08:21:40 +03:00
|
|
|
MAKEFS?= makefs
|
2001-11-12 00:41:00 +03:00
|
|
|
MDSETIMAGE?= mdsetimage
|
2001-11-18 01:48:48 +03:00
|
|
|
MKDEP?= mkdep
|
2002-04-03 09:32:58 +04:00
|
|
|
MKLOCALE?= mklocale
|
2001-10-09 09:19:03 +04:00
|
|
|
MTREE?= mtree
|
2002-04-03 09:32:58 +04:00
|
|
|
OBJCOPY?= objcopy
|
2002-01-25 08:21:40 +03:00
|
|
|
PAX?= pax
|
2002-03-31 15:48:45 +04:00
|
|
|
PWD_MKDB?= pwd_mkdb
|
2002-04-03 09:32:58 +04:00
|
|
|
RPCGEN?= rpcgen
|
|
|
|
STRIP?= strip
|
1998-08-28 03:26:37 +04:00
|
|
|
|
1998-09-14 00:56:38 +04:00
|
|
|
.SUFFIXES: .m .o .ln .lo
|
|
|
|
|
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:
|
|
|
|
${LINK.m} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
|
|
|
.m.o:
|
|
|
|
${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:
|
2002-04-23 04:15:45 +04:00
|
|
|
${HOST_COMPILE.c} -o ${.TARGET}.o ${.IMPSRC}
|
|
|
|
mv ${.TARGET}.o ${.TARGET}
|
1998-09-14 00:56:38 +04:00
|
|
|
|
1995-10-22 03:45:53 +03:00
|
|
|
# Lex
|
2001-10-19 20:15:40 +04:00
|
|
|
LPREFIX?= yy
|
|
|
|
LFLAGS+= -P${LPREFIX}
|
|
|
|
|
|
|
|
.l.o: # remove to force use of .l.c->.c.o transforms
|
1995-10-22 03:45:53 +03:00
|
|
|
.l:
|
1998-11-01 06:46:28 +03:00
|
|
|
${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
|
|
|
|
${LINK.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c ${LDLIBS} -ll
|
|
|
|
rm -f ${.TARGET:R}.${LPREFIX}.c
|
1995-10-22 03:45:53 +03:00
|
|
|
.l.c:
|
|
|
|
${LEX.l} -o${.TARGET} ${.IMPSRC}
|
|
|
|
|
|
|
|
# Yacc
|
2001-10-19 20:15:40 +04:00
|
|
|
YFLAGS+= ${YPREFIX:D-p${YPREFIX}} ${YHEADER:D-d}
|
|
|
|
|
|
|
|
.y.o: # remove to force use of .y.c->.c.o transforms
|
1995-10-22 03:45:53 +03:00
|
|
|
.y:
|
|
|
|
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
|
|
|
|
${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
|
2001-10-19 20:15:40 +04:00
|
|
|
rm -f ${.TARGET:R}.tab.[ch]
|
1998-04-01 20:58:33 +04:00
|
|
|
.y.c:
|
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
|
|
|
|
|
|
|
.endif # __bsd_sys_mk__
|