NetBSD/bin/sh/Makefile

102 lines
2.2 KiB
Makefile
Raw Normal View History

# $NetBSD: Makefile,v 1.72 2003/10/21 10:01:19 lukem Exp $
# @(#)Makefile 8.4 (Berkeley) 5/5/95
1993-03-21 12:45:37 +03:00
.include <bsd.own.mk>
YHEADER=1
1993-03-21 12:45:37 +03:00
PROG= sh
SHSRCS= alias.c cd.c echo.c error.c eval.c exec.c expand.c \
1994-05-11 21:09:42 +04:00
histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
mystring.c options.c parser.c redir.c show.c trap.c output.c var.c \
test.c printf.c kill.c
GENSRCS=arith.c arith_lex.c builtins.c init.c nodes.c syntax.c
GENHDRS=arith.h builtins.h nodes.h syntax.h token.h
SRCS= ${SHSRCS} ${GENSRCS}
DPSRCS+=${GENHDRS}
1994-05-13 03:55:56 +04:00
LDADD+= -ll -ledit -ltermcap
1995-06-11 00:19:40 +04:00
DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
LFLAGS= -8 # 8-bit lex scanner for arithmetic
YFLAGS= -d
.ifdef CRUNCHEDPROG
LFLAGS+=-L
YFLAGS+=-l
.endif
CPPFLAGS+=-DSHELL -I. -I${.CURDIR}
#XXX: For testing only.
#CPPFLAGS+=-DDEBUG=1
#CFLAGS+=-funsigned-char
#TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char" -funsigned-char
2002-02-07 09:25:07 +03:00
.ifdef SMALLPROG
CPPFLAGS+=-DSMALL
.endif
.PATH: ${.CURDIR}/bltin ${NETBSDSRCDIR}/bin/test \
${NETBSDSRCDIR}/usr.bin/printf \
${NETBSDSRCDIR}/bin/kill
1993-03-21 12:45:37 +03:00
CLEANFILES+= mkinit mknodes mksyntax
CLEANFILES+= ${GENSRCS} ${GENHDRS} y.tab.h
CLEANFILES+= trace
token.h: mktokens
${_MKTARGET_CREATE}
2003-05-08 17:03:19 +04:00
${HOST_SH} ${.ALLSRC}
1993-03-21 12:45:37 +03:00
2003-05-15 14:13:36 +04:00
builtins.h: builtins.c
${_MKTARGET_CREATE}
2003-05-15 14:13:36 +04:00
builtins.c: mkbuiltins shell.h builtins.def
${_MKTARGET_CREATE}
2003-05-08 17:03:19 +04:00
${HOST_SH} ${.ALLSRC} ${.OBJDIR}
2003-05-15 14:13:36 +04:00
[ -f builtins.h ]
1993-03-21 12:45:37 +03:00
init.c: mkinit ${SHSRCS}
${_MKTARGET_CREATE}
./${.ALLSRC}
1994-05-11 21:09:42 +04:00
2003-05-15 14:13:36 +04:00
nodes.h: nodes.c
nodes.c: mknodes nodetypes nodes.c.pat
${_MKTARGET_CREATE}
./${.ALLSRC}
2003-05-15 14:13:36 +04:00
[ -f nodes.h ]
syntax.h: syntax.c
1993-03-21 12:45:37 +03:00
2003-05-15 14:13:36 +04:00
syntax.c: mksyntax
${_MKTARGET_CREATE}
./${.ALLSRC}
2003-05-15 14:13:36 +04:00
[ -f syntax.h ]
.if ${USETOOLS} == "yes"
COMPATOBJDIR!= cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
NBCOMPATLIB= -L${COMPATOBJDIR} -lnbcompat
.endif
mkinit: mkinit.c
${_MKTARGET_LINK}
${HOST_LINK.c} -o mkinit ${.IMPSRC} ${NBCOMPATLIB}
mknodes: mknodes.c
${_MKTARGET_LINK}
${HOST_LINK.c} -o mknodes ${.IMPSRC} ${NBCOMPATLIB}
.if (${MACHINE_ARCH} == "powerpc") || \
(${MACHINE_CPU} == "arm")
TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char"
.else
TARGET_CHARFLAG?= -DTARGET_CHAR="signed char"
.endif
mksyntax: mksyntax.c
${_MKTARGET_LINK}
${HOST_LINK.c} ${TARGET_CHARFLAG} -o mksyntax ${.IMPSRC} ${NBCOMPATLIB}
.include <bsd.prog.mk>