2001-11-30 02:55:33 +03:00
|
|
|
# $NetBSD: bsd.sys.mk,v 1.68 2001/11/29 23:55:33 thorpej 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
|
2001-11-13 23:25:38 +03:00
|
|
|
CFLAGS+= -Wreturn-type -Wpointer-arith -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
|
|
|
|
|
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
|
|
|
|
|
1999-09-16 04:28:31 +04:00
|
|
|
CONFIG?= config
|
2001-11-12 00:41:00 +03:00
|
|
|
CRUNCHGEN?= crunchgen
|
2001-11-13 02:16:17 +03:00
|
|
|
GROFF?= groff
|
2001-11-12 00:41:00 +03:00
|
|
|
OBJCOPY?= objcopy
|
2000-07-25 10:29:44 +04:00
|
|
|
RPCGEN?= rpcgen
|
2001-11-12 00:41:00 +03:00
|
|
|
STRIP?= strip
|
|
|
|
MDSETIMAGE?= mdsetimage
|
2000-12-24 01:47:28 +03:00
|
|
|
MKLOCALE?= mklocale
|
2001-11-18 01:48:48 +03:00
|
|
|
MKDEP?= mkdep
|
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
|
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__
|