1998-04-09 04:32:31 +04:00
|
|
|
# $NetBSD: bsd.sys.mk,v 1.19 1998/04/09 00:32:36 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.
|
|
|
|
|
|
|
|
CFLAGS+= -Werror
|
1997-09-26 17:24:03 +04:00
|
|
|
.if defined(WARNS) && ${WARNS} == 1
|
1997-10-12 05:37:50 +04:00
|
|
|
CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
|
1997-07-02 01:42:55 +04:00
|
|
|
.endif
|
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
|
1996-05-15 23:46:51 +04:00
|
|
|
.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?=
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
.SUFFIXES: .m .o .ln
|
|
|
|
|
|
|
|
.m:
|
|
|
|
${LINK.m} -o ${.TARGET} ${.IMPSRC} ${LDLIBS}
|
|
|
|
|
|
|
|
.m.o:
|
|
|
|
${COMPILE.m} ${.IMPSRC}
|
|
|
|
|
|
|
|
|
1995-10-22 03:45:53 +03:00
|
|
|
.if defined(PARALLEL)
|
|
|
|
# Lex
|
|
|
|
.l:
|
|
|
|
${LEX.l} -o${.TARGET:R}.yy.c ${.IMPSRC}
|
|
|
|
${LINK.c} -o ${.TARGET} ${.TARGET:R}.yy.c ${LDLIBS} -ll
|
|
|
|
rm -f ${.TARGET:R}.yy.c
|
|
|
|
.l.c:
|
|
|
|
${LEX.l} -o${.TARGET} ${.IMPSRC}
|
|
|
|
.l.o:
|
|
|
|
${LEX.l} -o${.TARGET:R}.yy.c ${.IMPSRC}
|
|
|
|
${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.yy.c
|
|
|
|
rm -f ${.TARGET:R}.yy.c
|
1998-04-09 04:32:31 +04:00
|
|
|
.endif
|
1995-10-22 03:45:53 +03:00
|
|
|
|
|
|
|
# Yacc
|
1998-04-09 04:32:31 +04:00
|
|
|
.if defined(YHEADER)
|
|
|
|
YFLAGS+=-d
|
|
|
|
.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
|
|
|
|
.y.h .y.c:
|
|
|
|
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
|
|
|
|
mv ${.TARGET:R}.tab.c ${.TARGET:R}.c
|
|
|
|
mv ${.TARGET:R}.tab.h ${.TARGET:R}.h
|
|
|
|
.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
|
|
|
|
.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:
|
1995-10-22 03:45:53 +03:00
|
|
|
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
|
|
|
|
mv ${.TARGET:R}.tab.c ${.TARGET}
|
|
|
|
.y.o:
|
|
|
|
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
|
|
|
|
${COMPILE.c} -o ${.TARGET} ${.TARGET:R}.tab.c
|
|
|
|
rm -f ${.TARGET:R}.tab.c
|
|
|
|
.endif
|