--- a
+++ b/include/mk/automake.mk
@@ -0,0 +1,105 @@
+#
+#    Autotools include 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, July 2009
+#
+
+# Override these variables to use non-system available tools.
+ACLOCAL		?= aclocal
+AUTOCONF	?= autoconf
+AUTOHEADER	?= autoheader
+AUTOMAKE	?= automake
+
+.PHONY: autotools
+autotools: aclocal autoconf autoheader automake
+
+.PHONY: aclocal
+aclocal: aclocal.m4
+
+aclocal.m4: $(wildcard m4/*.m4) m4/ltp-version.m4
+	$(ACLOCAL) -I m4
+
+.PHONY: autoconf
+autoconf: configure
+
+configure: configure.ac aclocal.m4
+	$(AUTOCONF)
+
+.PHONY: autoheader
+autoheader: include/config.h.in
+
+include:
+	mkdir -p "$@"
+
+include/config.h.in: configure.ac $(wildcard m4/*.m4) m4/ltp-version.m4
+	$(AUTOHEADER)
+	touch $@
+
+include/config.h: include/config.h.default | include
+	cp $^ $@
+
+m4/ltp-version.m4: ChangeLog
+	sed -n '1{s:LTP-:AC_DEFUN([LTP_VERSION],[:;s:$$:]):;p;q}' $< > $@
+
+.PHONY: automake
+AUTOMAKE_FILES := config.guess config.sub install-sh missing stamp-h1
+automake: aclocal $(AUTOMAKE_FILES)
+$(AUTOMAKE_FILES): m4/Makefile.in
+m4/Makefile.in: m4/Makefile.am
+	$(AUTOMAKE) -c -a
+
+.PHONY: ac-clean ac-distclean ac-maintainer-clean
+ac-clean::
+	$(RM) -rf autom4te.cache
+	$(RM) -f aclocal.m4 config.log config.status
+	$(RM) -f include/config.h* include/stamp-h1 m4/Makefile m4/ltp-version.m4
+	-for d in $(AUTOCONFED_SUBDIRS); do \
+	    $(MAKE) -C "$(top_srcdir)/$$d" $@; \
+	done
+
+ac-distclean:: ac-clean
+ac-maintainer-clean:: ac-distclean
+	$(RM) -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in
+
+AUTOCONFED_SUBDIRS	= \
+			testcases/kernel/syscalls/pcllib
+
+# Don't include config.h, or make will (rightfully) whine about overriding
+# rules.
+AUTOGENERATED_FILES	= \
+			include/mk/config.mk	\
+			lib/ltp.pc		\
+			m4/Makefile		\
+			ltp-devel.spec		\
+			README.ltp-devel
+
+distclean:: %: clean ac-distclean include-clean
+	-for d in $(AUTOCONFED_SUBDIRS); do \
+	    $(MAKE) -C "$(top_srcdir)/$$d" $@; \
+	done
+	$(RM) -f $(AUTOGENERATED_FILES)
+
+maintainer-clean:: distclean ac-maintainer-clean
+
+$(AUTOGENERATED_FILES): $(top_builddir)/config.status
+	$(SHELL) $^
+
+$(top_builddir)/config.status:
+	$(MAKE) -C $(top_srcdir) help; \
+	exit 1