NetBSD/share/mk/bsd.sys.mk

54 lines
1.2 KiB
Makefile

# $NetBSD: bsd.sys.mk,v 1.9 1997/07/01 21:42:55 christos Exp $
#
# Overrides used for NetBSD source tree builds.
CFLAGS+= -Werror
.if defined(WARNS)
CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes
.endif
.if defined(DESTDIR)
CFLAGS+= -nostdinc -idirafter ${DESTDIR}/usr/include
.endif
# 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?=
NM?= nm
.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
# Yacc
.y:
${YACC.y} -b ${.TARGET:R} ${.IMPSRC}
${LINK.c} -o ${.TARGET} ${.TARGET:R}.tab.c ${LDLIBS}
rm -f ${.TARGET:R}.tab.c
.y.c:
${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