aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/mkbuiltins
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sh/mkbuiltins')
-rwxr-xr-xbin/sh/mkbuiltins16
1 files changed, 8 insertions, 8 deletions
diff --git a/bin/sh/mkbuiltins b/bin/sh/mkbuiltins
index 49af058461c1..1be7ff149089 100755
--- a/bin/sh/mkbuiltins
+++ b/bin/sh/mkbuiltins
@@ -35,17 +35,17 @@
# $FreeBSD$
temp=`/usr/bin/mktemp -t 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
-exec > ${objdir}/builtins.c
+srcdir=$1
+havejobs=0
+if grep '^#define[ ]*JOBS[ ]*1' $srcdir/shell.h > /dev/null
+then havejobs=1
+fi
+exec > builtins.c
cat <<\!
/*
* This file was generated by the mkbuiltins program.
@@ -57,7 +57,7 @@ cat <<\!
!
awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \
- print $0}' builtins.def | sed 's/-[hj]//' > $temp
+ print $0}' $srcdir/builtins.def | sed 's/-[hj]//' > $temp
echo 'int (*const builtinfunc[])(int, char **) = {'
awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp
echo '};
@@ -74,7 +74,7 @@ awk '{ for (i = 2 ; i <= NF ; i++) {
echo ' { NULL, 0, 0 }
};'
-exec > ${objdir}/builtins.h
+exec > builtins.h
cat <<\!
/*
* This file was generated by the mkbuiltins program.