2001-10-19 21:05:26 +04:00
|
|
|
# $NetBSD: bsd.sys.mk,v 1.54 2001/10/19 17:05:26 tv Exp $
|
1995-10-22 03:45:53 +03:00
|
|
|
#
|
1995-12-13 04:25:05 +03:00
|
|
|
# Overrides used for NetBSD source tree builds.
|
|
|
|
|
1999-07-08 05:55:38 +04:00
|
|
|
.if defined(WARNS)
|
|
|
|
.if ${WARNS} > 0
|
1997-10-12 05:37:50 +04:00
|
|
|
CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
|
2001-09-08 05:00:44 +04:00
|
|
|
#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.
|
|
|
|
CFLAGS+= -Wno-uninitialized
|
1997-07-02 01:42:55 +04:00
|
|
|
.endif
|
1999-07-08 05:55:38 +04:00
|
|
|
.if ${WARNS} > 1
|
|
|
|
CFLAGS+=-Wreturn-type -Wcast-qual -Wpointer-arith -Wwrite-strings
|
|
|
|
CFLAGS+=-Wswitch -Wshadow
|
|
|
|
.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
|
2000-10-11 00:41:20 +04:00
|
|
|
CFLAGS+=-Wnetbsd-format-audit -Wno-format-extra-args
|
2000-10-04 23:27:45 +04:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2001-10-19 20:28:54 +04:00
|
|
|
CPPFLAGS+= ${AUDIT:D-D__AUDIT__} \
|
|
|
|
${DESTDIR:D-nostdinc -idirafter ${DESTDIR}/usr/include}
|
1995-10-22 03:45:53 +03:00
|
|
|
|
2001-10-19 20:28:54 +04:00
|
|
|
CFLAGS+= ${NOGCCERROR:U-Werror} ${CWARNFLAGS}
|
1996-05-15 23:46:51 +04:00
|
|
|
|
2001-10-19 20:28:54 +04:00
|
|
|
LINTFLAGS+= ${DESTDIR:D-d ${DESTDIR}/usr/include}
|
1998-07-27 17:16:52 +04:00
|
|
|
|
2001-07-04 21:46:06 +04:00
|
|
|
.if defined(MKSOFTFLOAT) && (${MKSOFTFLOAT} != "no")
|
2001-06-18 21:04:44 +04:00
|
|
|
COPTS+= -msoft-float
|
|
|
|
FOPTS+= -msoft-float
|
|
|
|
.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?=
|
|
|
|
|
1999-08-21 18:17:07 +04:00
|
|
|
OBJCOPY?= objcopy
|
2000-02-01 09:00:35 +03:00
|
|
|
STRIP?= strip
|
1999-09-16 04:28:31 +04:00
|
|
|
CONFIG?= config
|
2000-07-25 10:29:44 +04:00
|
|
|
RPCGEN?= rpcgen
|
2000-12-24 01:47:28 +03:00
|
|
|
MKLOCALE?= mklocale
|
2001-10-09 09:19:03 +04:00
|
|
|
MTREE?= mtree
|
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
|
|
|
|
.c.lo:
|
|
|
|
${HOST_COMPILE.c} -o ${.TARGET} ${.IMPSRC}
|
|
|
|
|
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
|
2001-10-19 21:05:26 +04:00
|
|
|
.y.h: ${YHEADER:D${.TARGET:.h=.c}}
|
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}
|