2000-07-25 10:29:44 +04:00
|
|
|
# $NetBSD: bsd.sys.mk,v 1.40 2000/07/25 06:29:44 cgd 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
|
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
|
1999-01-31 12:17:20 +03:00
|
|
|
.if !defined(NOGCCERROR)
|
|
|
|
CFLAGS+= -Werror
|
|
|
|
.endif
|
|
|
|
CFLAGS+= ${CWARNFLAGS}
|
1995-10-22 03:45:53 +03:00
|
|
|
|
1997-06-01 01:21:13 +04:00
|
|
|
.if defined(DESTDIR)
|
1997-10-08 17:17:00 +04:00
|
|
|
CPPFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
|
1998-05-12 02:12:59 +04:00
|
|
|
LINTFLAGS+= -d ${DESTDIR}/usr/include
|
1996-05-15 23:46:51 +04:00
|
|
|
.endif
|
|
|
|
|
1998-07-27 17:16:52 +04:00
|
|
|
.if defined(AUDIT)
|
|
|
|
CPPFLAGS+= -D__AUDIT__
|
|
|
|
.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}
|
|
|
|
|
|
|
|
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
|
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}
|
|
|
|
|
1997-10-28 15:40:16 +03:00
|
|
|
|
1998-11-01 06:46:28 +03:00
|
|
|
.if defined(PARALLEL) || defined(LPREFIX)
|
|
|
|
LPREFIX?=yy
|
|
|
|
LFLAGS+=-P${LPREFIX}
|
1995-10-22 03:45:53 +03:00
|
|
|
# Lex
|
|
|
|
.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}
|
|
|
|
.l.o:
|
1998-11-01 06:46:28 +03:00
|
|
|
${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
|
|
|
|
${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c
|
|
|
|
rm -f ${.TARGET:R}.${LPREFIX}.c
|
1998-08-17 03:55:04 +04:00
|
|
|
.l.lo:
|
1998-11-01 06:46:28 +03:00
|
|
|
${LEX.l} -o${.TARGET:R}.${LPREFIX}.c ${.IMPSRC}
|
|
|
|
${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.${LPREFIX}.c
|
|
|
|
rm -f ${.TARGET:R}.${LPREFIX}.c
|
1998-04-09 04:32:31 +04:00
|
|
|
.endif
|
1995-10-22 03:45:53 +03:00
|
|
|
|
|
|
|
# Yacc
|
1998-11-01 06:46:28 +03:00
|
|
|
.if defined(YHEADER) || defined(YPREFIX)
|
|
|
|
.if defined(YPREFIX)
|
|
|
|
YFLAGS+=-p${YPREFIX}
|
|
|
|
.endif
|
1998-10-31 20:17:56 +03:00
|
|
|
.if defined(YHEADER)
|
|
|
|
YFLAGS+=-d
|
1998-11-01 06:46:28 +03:00
|
|
|
.endif
|
1998-04-09 04:32:31 +04:00
|
|
|
.y:
|
|
|
|
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
|
|
|
|
${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
|
|
|
|
rm -f ${.TARGET:R}.tab.c ${.TARGET:R}.tab.h
|
1998-11-01 06:46:28 +03:00
|
|
|
.y.h: ${.TARGET:R}.c
|
|
|
|
.y.c:
|
|
|
|
${YACC.y} -o ${.TARGET} ${.IMPSRC}
|
1998-04-09 04:32:31 +04:00
|
|
|
.y.o:
|
|
|
|
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
|
|
|
|
${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
|
|
|
|
rm -f ${.TARGET:R}.tab.c ${TARGET:R}.tab.h
|
1998-08-17 03:55:04 +04:00
|
|
|
.y.lo:
|
|
|
|
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
|
|
|
|
${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
|
|
|
|
rm -f ${.TARGET:R}.tab.c ${TARGET:R}.tab.h
|
1998-04-09 04:32:31 +04:00
|
|
|
.elif defined(PARALLEL)
|
1995-10-22 03:45:53 +03:00
|
|
|
.y:
|
|
|
|
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
|
|
|
|
${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
|
|
|
|
rm -f ${.TARGET:R}.tab.c
|
1998-04-01 20:58:33 +04:00
|
|
|
.y.c:
|
1998-11-01 06:46:28 +03:00
|
|
|
${YACC.y} -o ${.TARGET} ${.IMPSRC}
|
1995-10-22 03:45:53 +03:00
|
|
|
.y.o:
|
|
|
|
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
|
|
|
|
${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
|
|
|
|
rm -f ${.TARGET:R}.tab.c
|
1998-08-17 03:55:04 +04:00
|
|
|
.y.lo:
|
|
|
|
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
|
|
|
|
${HOST_COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
|
|
|
|
rm -f ${.TARGET:R}.tab.c
|
1995-10-22 03:45:53 +03:00
|
|
|
.endif
|