summaryrefslogtreecommitdiff
path: root/tools/regression/usr.bin/make/shell/path
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2005-05-19 11:23:01 +0000
committerHartmut Brandt <harti@FreeBSD.org>2005-05-19 11:23:01 +0000
commit56f5aba2ca38d7452d1cf5ac3dc1ce4a80052afa (patch)
treeff115f1ab9e55fe67334f2dd06af3fbadd5f474f /tools/regression/usr.bin/make/shell/path
parentb4b4c815225f23d64eb0a2bbbd9cb254a2c4ff0f (diff)
Notes
Diffstat (limited to 'tools/regression/usr.bin/make/shell/path')
-rw-r--r--tools/regression/usr.bin/make/shell/path/Makefile48
-rw-r--r--tools/regression/usr.bin/make/shell/path/expected.status1
-rw-r--r--tools/regression/usr.bin/make/shell/path/expected.stderr1
-rw-r--r--tools/regression/usr.bin/make/shell/path/expected.stdout0
-rw-r--r--tools/regression/usr.bin/make/shell/path/sh.sh6
-rw-r--r--tools/regression/usr.bin/make/shell/path/test.t13
6 files changed, 69 insertions, 0 deletions
diff --git a/tools/regression/usr.bin/make/shell/path/Makefile b/tools/regression/usr.bin/make/shell/path/Makefile
new file mode 100644
index 000000000000..8b1ce1b0c531
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/path/Makefile
@@ -0,0 +1,48 @@
+#
+# Change the path for builtin shells. There are two methods to do this.
+# This is the first of them when the basename of the path is equal to
+# one of the builtin shells so that the .SHELL target automatically
+# also selectes the shell without specifying the name.
+#
+# Be sure to include a meta-character into the command line, so that
+# really our shell is executed.
+#
+# $FreeBSD$
+#
+
+all: sh csh ksh
+ @${MAKE} sh_test
+ @${MAKE} csh_test
+ @if [ -x /bin/ksh ] ; then ${MAKE} ksh_test ; fi
+
+sh: sh.sh
+ @cp ${.CURDIR}/sh.sh ${.OBJDIR}/sh
+ @chmod +x ${.OBJDIR}/sh
+
+csh: sh.sh
+ @cp ${.CURDIR}/sh.sh ${.OBJDIR}/csh
+ @chmod +x ${.OBJDIR}/csh
+
+ksh: sh.sh
+ @cp ${.CURDIR}/sh.sh ${.OBJDIR}/ksh
+ @chmod +x ${.OBJDIR}/ksh
+
+.ifmake sh_test
+
+.SHELL: path=${.OBJDIR}/sh
+sh_test:
+ @: This is the shell.
+
+.elifmake csh_test
+
+.SHELL: path=${.OBJDIR}/csh
+csh_test:
+ @: This is the C-shell.
+
+.elifmake ksh_test
+
+.SHELL: path=${.OBJDIR}/ksh
+ksh_test:
+ @: This is the Korn-shell.
+
+.endif
diff --git a/tools/regression/usr.bin/make/shell/path/expected.status b/tools/regression/usr.bin/make/shell/path/expected.status
new file mode 100644
index 000000000000..0cfbf08886fc
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/path/expected.status
@@ -0,0 +1 @@
+2
diff --git a/tools/regression/usr.bin/make/shell/path/expected.stderr b/tools/regression/usr.bin/make/shell/path/expected.stderr
new file mode 100644
index 000000000000..628ea8fef6c7
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/path/expected.stderr
@@ -0,0 +1 @@
+make: don't know how to make sh.sh. Stop
diff --git a/tools/regression/usr.bin/make/shell/path/expected.stdout b/tools/regression/usr.bin/make/shell/path/expected.stdout
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/path/expected.stdout
diff --git a/tools/regression/usr.bin/make/shell/path/sh.sh b/tools/regression/usr.bin/make/shell/path/sh.sh
new file mode 100644
index 000000000000..46169eb6efc2
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/path/sh.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# $FreeBSD$
+echo $@
+if ! test -t 0 ; then
+ cat
+fi
diff --git a/tools/regression/usr.bin/make/shell/path/test.t b/tools/regression/usr.bin/make/shell/path/test.t
new file mode 100644
index 000000000000..890fb4517aa0
--- /dev/null
+++ b/tools/regression/usr.bin/make/shell/path/test.t
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+cd `dirname $0`
+. ../../common.sh
+
+desc_test()
+{
+ echo "New path for builtin shells."
+}
+
+eval_cmd $1