2004-01-17 02:24:38 +03:00
|
|
|
# $NetBSD: Makefile,v 1.74 2004/01/16 23:24:38 dsl Exp $
|
1995-05-12 01:28:33 +04:00
|
|
|
# @(#)Makefile 8.4 (Berkeley) 5/5/95
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2001-04-18 21:35:36 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
1999-02-05 10:52:51 +03:00
|
|
|
YHEADER=1
|
1993-03-21 12:45:37 +03:00
|
|
|
PROG= sh
|
1996-10-16 18:23:51 +04:00
|
|
|
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 \
|
2000-04-10 03:27:03 +04:00
|
|
|
mystring.c options.c parser.c redir.c show.c trap.c output.c var.c \
|
2002-11-25 01:35:38 +03:00
|
|
|
test.c printf.c kill.c
|
2003-10-19 04:35:26 +04:00
|
|
|
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
|
1997-05-09 11:50:03 +04:00
|
|
|
SRCS= ${SHSRCS} ${GENSRCS}
|
1996-10-16 18:23:51 +04:00
|
|
|
|
2003-10-19 04:35:26 +04:00
|
|
|
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}
|
1996-10-16 18:23:51 +04:00
|
|
|
|
2003-03-10 20:58:21 +03:00
|
|
|
LFLAGS= -8 # 8-bit lex scanner for arithmetic
|
1998-04-09 04:32:31 +04:00
|
|
|
YFLAGS= -d
|
1996-10-16 18:23:51 +04:00
|
|
|
|
2003-03-10 20:58:21 +03:00
|
|
|
.ifdef CRUNCHEDPROG
|
|
|
|
LFLAGS+=-L
|
|
|
|
YFLAGS+=-l
|
|
|
|
.endif
|
|
|
|
|
2002-02-12 09:39:10 +03:00
|
|
|
CPPFLAGS+=-DSHELL -I. -I${.CURDIR}
|
2003-01-09 16:57:26 +03:00
|
|
|
#XXX: For testing only.
|
2003-01-22 23:36:03 +03:00
|
|
|
#CPPFLAGS+=-DDEBUG=1
|
2003-01-09 16:57:26 +03:00
|
|
|
#CFLAGS+=-funsigned-char
|
|
|
|
#TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char" -funsigned-char
|
1996-10-16 18:23:51 +04:00
|
|
|
|
2002-02-07 09:25:07 +03:00
|
|
|
.ifdef SMALLPROG
|
|
|
|
CPPFLAGS+=-DSMALL
|
|
|
|
.endif
|
|
|
|
|
2002-11-25 01:35:38 +03:00
|
|
|
.PATH: ${.CURDIR}/bltin ${NETBSDSRCDIR}/bin/test \
|
|
|
|
${NETBSDSRCDIR}/usr.bin/printf \
|
|
|
|
${NETBSDSRCDIR}/bin/kill
|
1993-03-21 12:45:37 +03:00
|
|
|
|
2004-01-17 02:24:38 +03:00
|
|
|
CLEANFILES+= mkinit mkinit.lo mksyntax mksyntax.lo
|
2003-10-19 04:35:26 +04:00
|
|
|
CLEANFILES+= ${GENSRCS} ${GENHDRS} y.tab.h
|
2003-09-14 16:11:10 +04:00
|
|
|
CLEANFILES+= trace
|
1996-10-16 18:23:51 +04:00
|
|
|
|
|
|
|
token.h: mktokens
|
2003-10-21 14:01:19 +04:00
|
|
|
${_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
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2003-05-15 14:13:36 +04:00
|
|
|
|
|
|
|
builtins.c: mkbuiltins shell.h builtins.def
|
2003-10-21 14:01:19 +04:00
|
|
|
${_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
|
|
|
|
1996-10-16 18:23:51 +04:00
|
|
|
init.c: mkinit ${SHSRCS}
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
1998-03-30 14:07:16 +04:00
|
|
|
./${.ALLSRC}
|
1994-05-11 21:09:42 +04:00
|
|
|
|
2003-05-15 14:13:36 +04:00
|
|
|
nodes.h: nodes.c
|
|
|
|
|
2004-01-17 02:24:38 +03:00
|
|
|
nodes.c: mknodes.sh nodetypes nodes.c.pat
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
2004-01-17 02:24:38 +03:00
|
|
|
${HOST_SH} ${.ALLSRC} ${.OBJDIR}
|
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
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_CREATE}
|
1998-03-30 16:06:48 +04:00
|
|
|
./${.ALLSRC}
|
2003-05-15 14:13:36 +04:00
|
|
|
[ -f syntax.h ]
|
1993-11-14 18:35:34 +03:00
|
|
|
|
2003-10-18 11:58:35 +04:00
|
|
|
.if ${USETOOLS} == "yes"
|
|
|
|
COMPATOBJDIR!= cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
|
|
|
|
NBCOMPATLIB= -L${COMPATOBJDIR} -lnbcompat
|
|
|
|
.endif
|
|
|
|
|
2003-11-16 17:14:18 +03:00
|
|
|
mkinit: mkinit.lo
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_LINK}
|
2003-11-16 17:14:18 +03:00
|
|
|
${HOST_LINK.c} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB}
|
1998-09-12 22:55:07 +04:00
|
|
|
|
2003-11-16 17:14:18 +03:00
|
|
|
mknodes: mknodes.lo
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_LINK}
|
2003-11-16 17:14:18 +03:00
|
|
|
${HOST_LINK.c} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB}
|
1998-09-12 22:55:07 +04:00
|
|
|
|
|
|
|
.if (${MACHINE_ARCH} == "powerpc") || \
|
2001-04-18 21:35:36 +04:00
|
|
|
(${MACHINE_CPU} == "arm")
|
2003-01-09 16:57:26 +03:00
|
|
|
TARGET_CHARFLAG?= -DTARGET_CHAR="unsigned char"
|
1998-09-12 22:55:07 +04:00
|
|
|
.else
|
2003-01-09 16:57:26 +03:00
|
|
|
TARGET_CHARFLAG?= -DTARGET_CHAR="signed char"
|
1998-09-12 22:55:07 +04:00
|
|
|
.endif
|
|
|
|
|
2003-11-16 17:14:18 +03:00
|
|
|
mksyntax: mksyntax.lo
|
2003-10-21 14:01:19 +04:00
|
|
|
${_MKTARGET_LINK}
|
2003-11-16 17:14:18 +03:00
|
|
|
${HOST_LINK.c} ${TARGET_CHARFLAG} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB}
|
1998-09-12 22:55:07 +04:00
|
|
|
|
1998-04-13 16:06:48 +04:00
|
|
|
.include <bsd.prog.mk>
|