1. Install the testscripts with LTP again.
2. Setup the initial piece for installing in the build tree, as requested by KD and a few others.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
diff --git a/Makefile b/Makefile
index 75e38dd..f298d23 100644
--- a/Makefile
+++ b/Makefile
@@ -87,8 +87,8 @@
 endef
 
 COMMON_TARGETS		+= testcases tools
-INSTALL_TARGETS		+= $(COMMON_TARGETS) runtest
-CLEAN_TARGETS		+= $(COMMON_TARGETS) lib include runtest
+INSTALL_TARGETS		+= $(COMMON_TARGETS) runtest testscripts
+CLEAN_TARGETS		+= $(COMMON_TARGETS) lib include runtest testscripts
 BOOTSTRAP_TARGETS	:= $(sort $(COMMON_TARGETS) $(CLEAN_TARGETS)\
 				  $(INSTALL_TARGETS))
 
@@ -109,7 +109,7 @@
 INSTALL_DIR		:= $(DESTDIR)/$(prefix)
 
 # build tree bootstrap targets and $(INSTALL_DIR) target.
-$(addprefix $(abs_top_builddir)/,$(BOOTSTRAP_TARGETS)) $(INSTALL_DIR) $(DESTDIR)/$(bindir):
+$(sort $(addprefix $(abs_top_builddir)/,$(BOOTSTRAP_TARGETS)) $(INSTALL_DIR) $(DESTDIR)/$(bindir)):
 	mkdir -m 00755 -p "$@"
 
 ## Pattern based subtarget rules.
@@ -154,7 +154,9 @@
 # the $(INSTALL_DIR).
 clean:: $(CLEAN_TARGETS)
 	$(RM) -f Version
-	$(if $(DESTDIR)$(prefix),-$(RM) -Rf "$(INSTALL_DIR)")
+ifneq ($(INSTALL_IN_BUILD_TREE),1)
+	-$(RM) -Rf "$(INSTALL_DIR)"
+endif
 
 $(foreach tgt,\
 	$(MAKE_TARGETS) include-all lib-all $(CLEAN_TARGETS) \
diff --git a/include/mk/env_pre.mk b/include/mk/env_pre.mk
index a7b3410..efb5f71 100644
--- a/include/mk/env_pre.mk
+++ b/include/mk/env_pre.mk
@@ -93,6 +93,12 @@
 
 ifneq ($(abs_builddir),$(abs_srcdir))
 OUT_OF_BUILD_TREE		:= 1
+else
+# Stub support for installing directly in the build tree; the support is not
+# there yet, but the variable itself has its own uses...
+ifeq ($(strip $(DESTDIR)$(prefix)),)
+INSTALL_IN_BUILD_TREE		:= 1
+endif
 endif
 
 # We can piece together where we're located in the source and object trees with
diff --git a/testscripts/Makefile b/testscripts/Makefile
new file mode 100644
index 0000000..cc25e24
--- /dev/null
+++ b/testscripts/Makefile
@@ -0,0 +1,35 @@
+#
+#    testscripts Makefile.
+#
+#    Copyright (C) 2009, Cisco Systems Inc.
+#
+#    This program is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License along
+#    with this program; if not, write to the Free Software Foundation, Inc.,
+#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Garrett Cooper, December 2009
+#
+
+top_srcdir		?= ..
+
+include $(top_srcdir)/include/mk/env_pre.mk
+
+INSTALL_DIR		:= testscripts
+
+INSTALL_MODE		:= 00644
+
+INSTALL_TARGETS		:= *.sh
+
+MAKE_TARGETS		:=
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk