Pr/5221: Jason Thorpe: Simplify sh Makefile, so that builts from other
directories work.
This commit is contained in:
parent
1820947a9f
commit
0328c41456
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.37 1998/01/21 10:47:37 christos Exp $
|
||||
# $NetBSD: Makefile,v 1.38 1998/03/29 09:27:40 christos Exp $
|
||||
# @(#)Makefile 8.4 (Berkeley) 5/5/95
|
||||
|
||||
PROG= sh
|
||||
@ -28,19 +28,19 @@ CLEANFILES+= mkinit.o mknodes.o mksyntax.o
|
||||
CLEANFILES+= ${GENSRCS} y.tab.h
|
||||
|
||||
token.h: mktokens
|
||||
sh ${.CURDIR}/mktokens
|
||||
sh ${.ALLSRC}
|
||||
|
||||
builtins.c builtins.h: mkbuiltins builtins.def
|
||||
cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
|
||||
builtins.c builtins.h: mkbuiltins shell.h builtins.def
|
||||
sh ${.ALLSRC} ${.OBJDIR}
|
||||
|
||||
init.c: mkinit ${SHSRCS}
|
||||
./mkinit ${.ALLSRC:S/^mkinit$//}
|
||||
${.ALLSRC}
|
||||
|
||||
nodes.c nodes.h: mknodes nodetypes nodes.c.pat
|
||||
./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
|
||||
${.ALLSRC}
|
||||
|
||||
syntax.c syntax.h: mksyntax
|
||||
./mksyntax
|
||||
${.ALLSRC}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh -
|
||||
# $NetBSD: mkbuiltins,v 1.13 1997/07/04 21:02:10 christos Exp $
|
||||
# $NetBSD: mkbuiltins,v 1.14 1998/03/29 09:27:41 christos Exp $
|
||||
#
|
||||
# Copyright (c) 1991, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
@ -38,16 +38,22 @@
|
||||
# @(#)mkbuiltins 8.2 (Berkeley) 5/4/95
|
||||
|
||||
temp=/tmp/ka$$
|
||||
havejobs=0
|
||||
if grep '^#define JOBS[ ]*1' shell.h > /dev/null
|
||||
then havejobs=1
|
||||
fi
|
||||
|
||||
havehist=1
|
||||
if [ "X$1" = "X-h" ]; then
|
||||
havehist=0
|
||||
shift
|
||||
fi
|
||||
objdir=$1
|
||||
shell=$1
|
||||
builtins=$2
|
||||
objdir=$3
|
||||
|
||||
havejobs=0
|
||||
if grep '^#define JOBS[ ]*1' ${shell} > /dev/null
|
||||
then
|
||||
havejobs=1
|
||||
fi
|
||||
|
||||
exec > ${objdir}/builtins.c
|
||||
cat <<\!
|
||||
/*
|
||||
@ -59,7 +65,7 @@ cat <<\!
|
||||
|
||||
!
|
||||
awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \
|
||||
print $0}' builtins.def | sed 's/-j//' > $temp
|
||||
print $0}' ${builtins} | sed 's/-j//' > $temp
|
||||
awk '{ printf "int %s __P((int, char **));\n", $1}' $temp
|
||||
echo '
|
||||
int (*const builtinfunc[]) __P((int, char **)) = {'
|
||||
|
Loading…
Reference in New Issue
Block a user