From 6c323bc1bb27a79f687f5f3f3ed6b105aad24caa Mon Sep 17 00:00:00 2001
From: John Mandereau <john.mandereau@gmail.com>
Date: Thu, 2 Aug 2012 23:25:54 +0200
Subject: [PATCH] Remove StepMake as a separate package

Rationale:
* there are no publicly-known current usage cases of StepMake outside
LilyPond,
* StepMake installation has been disabled for a decade,
* generic templates (stepmake/stepmake) have been so heavily
customized lately for our heavy documentation that they can no longer
be qualifed as "generic",
* only a few build scripts have remained in stepmake/bin, whereas
most of them now live in scripts/build.

This commit removes everything in stepmake/ except included makefiles;
scripts that are still used are moved to config/ (Autoconf helpers) or
scripts/build (build and install scripts).

Remove config make target to avoid potential conflict with new
config/ directory.

For clarity, a merge of all stepmake templates, from stepmake/stepmake
and make/ into stepmake/ (or similar), will be done in another commit.
---
 .gitignore                                    |   1 -
 Documentation/GNUmakefile                     |   2 +-
 Documentation/misc/GNUmakefile                |   2 +-
 GNUmakefile.in                                |   2 +-
 ROADMAP                                       |   1 +
 stepmake/aclocal.m4 => aclocal.m4             |   0
 autogen.sh                                    |  11 -
 {stepmake/bin => config}/config.guess         |   0
 {stepmake/bin => config}/config.sub           |   0
 {stepmake/bin => config}/install-sh           |   0
 configure.in                                  |   7 +-
 {stepmake/bin => scripts/build}/install.py    |   0
 .../bin => scripts/build}/make-version.py     |   2 +-
 {stepmake/bin => scripts/build}/text2html.py  |   2 +-
 stepmake/GNUmakefile                          |  31 ---
 stepmake/INSTALL.texi                         | 240 ------------------
 stepmake/README                               |  19 --
 stepmake/autogen.sh                           |  52 ----
 stepmake/bin/GNUmakefile                      |  11 -
 stepmake/bin/fake-msgfmt.sh                   |  33 ---
 stepmake/bin/ntpwd.py                         |  29 ---
 stepmake/bin/stepmakeise.sh                   | 105 --------
 stepmake/config.hh.in                         |  14 -
 stepmake/configure.in                         |  45 ----
 stepmake/stepmake/GNUmakefile                 |  25 --
 stepmake/stepmake/generic-targets.make        |  16 +-
 stepmake/stepmake/generic-vars.make           |   3 +-
 stepmake/stepmake/toplevel-targets.make       |  10 -
 28 files changed, 14 insertions(+), 649 deletions(-)
 rename stepmake/aclocal.m4 => aclocal.m4 (100%)
 rename {stepmake/bin => config}/config.guess (100%)
 rename {stepmake/bin => config}/config.sub (100%)
 rename {stepmake/bin => config}/install-sh (100%)
 rename {stepmake/bin => scripts/build}/install.py (100%)
 rename {stepmake/bin => scripts/build}/make-version.py (98%)
 rename {stepmake/bin => scripts/build}/text2html.py (98%)
 delete mode 100644 stepmake/GNUmakefile
 delete mode 100644 stepmake/INSTALL.texi
 delete mode 100644 stepmake/README
 delete mode 100755 stepmake/autogen.sh
 delete mode 100644 stepmake/bin/GNUmakefile
 delete mode 100644 stepmake/bin/fake-msgfmt.sh
 delete mode 100644 stepmake/bin/ntpwd.py
 delete mode 100755 stepmake/bin/stepmakeise.sh
 delete mode 100644 stepmake/config.hh.in
 delete mode 100644 stepmake/configure.in
 delete mode 100644 stepmake/stepmake/GNUmakefile

diff --git a/.gitignore b/.gitignore
index 4ee4e5154a..3097acfe26 100644
--- a/.gitignore
+++ b/.gitignore
@@ -53,7 +53,6 @@ TAGS
 \#*
 \#.*
 a.out
-aclocal.m4
 autom4te.cache
 config-*.hh
 config-*.make
diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile
index ab788379a8..fff37aa6ad 100644
--- a/Documentation/GNUmakefile
+++ b/Documentation/GNUmakefile
@@ -199,7 +199,7 @@ $(OUT_TXT_FILES): $(outdir)/%.txt: $(top-src-dir)/%
 	cp -f $< $@
 
 $(OUT_TXT_FILES:%.txt=%.html): $(outdir)/%.html: $(outdir)/%.txt
-	$(PYTHON) $(step-bindir)/text2html.py $<
+	$(buildscript-dir)/text2html $<
 
 # Explicitly list the dependencies on generated content
 $(outdir)/web.texi: $(outdir)/we-wrote.itexi $(outdir)/others-did.itexi $(outdir)/weblinks.itexi
diff --git a/Documentation/misc/GNUmakefile b/Documentation/misc/GNUmakefile
index 00fe5ae826..efc4dd9e69 100644
--- a/Documentation/misc/GNUmakefile
+++ b/Documentation/misc/GNUmakefile
@@ -22,5 +22,5 @@ $(outdir)/%.txt: %
 	cp $< $@
 
 txt-to-html:
-	$(PYTHON) $(step-bindir)/text2html.py $(OUT_TXT_FILES)
+	$(buildscript-dir)/text2html $(OUT_TXT_FILES)
 	$(footify) $(addprefix $(outdir)/, $(addsuffix .html, $(TEXTS)))
diff --git a/GNUmakefile.in b/GNUmakefile.in
index 6f0e4f4a7b..9347dcb9a8 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -9,7 +9,7 @@ SUBDIRS = python scripts \
 	po \
 	elisp vim \
 	input \
-	stepmake $(documentation-dir)
+	$(documentation-dir)
 
 
 ## this convoluted construction is necessary, since we don't know the
diff --git a/ROADMAP b/ROADMAP
index 99ad6b7fb6..2616c11c16 100644
--- a/ROADMAP
+++ b/ROADMAP
@@ -78,6 +78,7 @@ LilyPond's source files.
 |
 |   SCRIPTS:
 |
+|-- config/              Autoconf helpers for configure script
 |-- python/              Python modules, MIDI module
 |   `-- auxiliar/        Python modules for build/maintenance
 |-- scripts/             End-user scripts (--> lilypond/usr/bin/)
diff --git a/stepmake/aclocal.m4 b/aclocal.m4
similarity index 100%
rename from stepmake/aclocal.m4
rename to aclocal.m4
diff --git a/autogen.sh b/autogen.sh
index 34c022e082..9d21f79936 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -7,17 +7,6 @@ case $1 in
     --noconf*) NOCONFIGURE=true;;
 esac
 
-if [ ! -f aclocal.m4 -o stepmake/aclocal.m4 -nt aclocal.m4 ]; then
-    echo "stepmake/aclocal.m4 is newer.  Copying file." 
-    cp -f stepmake/aclocal.m4 aclocal.m4
-fi
-
-if [ ! -f autogen.sh -o stepmake/autogen.sh -nt autogen.sh ]; then
-    echo "stepmake/autogen.sh is newer.  Copying file." 
-    cp -f stepmake/autogen.sh autogen.sh
-    exec ./autogen.sh "$@"
-fi
-
 for i in $srcdir/configure.in #`find $srcdir -name configure.in -print`
 do 
   dir=`dirname $i`
diff --git a/stepmake/bin/config.guess b/config/config.guess
similarity index 100%
rename from stepmake/bin/config.guess
rename to config/config.guess
diff --git a/stepmake/bin/config.sub b/config/config.sub
similarity index 100%
rename from stepmake/bin/config.sub
rename to config/config.sub
diff --git a/stepmake/bin/install-sh b/config/install-sh
similarity index 100%
rename from stepmake/bin/install-sh
rename to config/install-sh
diff --git a/configure.in b/configure.in
index 66799abd3b..3a9eec9628 100644
--- a/configure.in
+++ b/configure.in
@@ -7,12 +7,7 @@ AC_PREREQ(2.60)
 AC_INIT
 
 # Bootstrap StepMake configure
-# For user package:
-AC_CONFIG_AUX_DIR([stepmake/bin])
-
-# For stepmake package:
-# AC_CONFIG_AUX_DIR(bin)
-
+AC_CONFIG_AUX_DIR([config])
 
 STEPMAKE_INIT
 
diff --git a/stepmake/bin/install.py b/scripts/build/install.py
similarity index 100%
rename from stepmake/bin/install.py
rename to scripts/build/install.py
diff --git a/stepmake/bin/make-version.py b/scripts/build/make-version.py
similarity index 98%
rename from stepmake/bin/make-version.py
rename to scripts/build/make-version.py
index 61247fb8aa..4b6a0aa56e 100644
--- a/stepmake/bin/make-version.py
+++ b/scripts/build/make-version.py
@@ -1,4 +1,4 @@
-
+#!@PYTHON@
 import re
 import sys
 
diff --git a/stepmake/bin/text2html.py b/scripts/build/text2html.py
similarity index 98%
rename from stepmake/bin/text2html.py
rename to scripts/build/text2html.py
index 51f3948ef4..2456202778 100644
--- a/stepmake/bin/text2html.py
+++ b/scripts/build/text2html.py
@@ -1,4 +1,4 @@
-#@PYTHON@
+#!@PYTHON@
 import os
 import re
 import string
diff --git a/stepmake/GNUmakefile b/stepmake/GNUmakefile
deleted file mode 100644
index 8a3eb0159a..0000000000
--- a/stepmake/GNUmakefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*-Makefile-*-
-# title	 specific top level makefile for StepMake
-
-# subdir level:
-#
-depth = ..
-
-# descent order into subdirectories:
-#
-SUBDIRS = bin stepmake
-
-# list of distribution files:
-#
-SCRIPTS =  aclocal.m4 autogen.sh
-README_FILES = README
-README_TXT_FILES =
-EXTRA_DIST_FILES = $(README_FILES)  $(SCRIPTS)
-NON_ESSENTIAL_DIST_FILES = $(README_TXT_FILES)
-#
-
-# bootstrap stepmake:
-#
-STEPMAKE_TEMPLATES= texinfo
-include $(depth)/make/stepmake.make
-
-# don't install stepmake
-install: local-install
-	@echo Not installing stepmake
-
-localclean:
-	rm -f bin/*.pyc
diff --git a/stepmake/INSTALL.texi b/stepmake/INSTALL.texi
deleted file mode 100644
index bfc62cf766..0000000000
--- a/stepmake/INSTALL.texi
+++ /dev/null
@@ -1,240 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@setfilename INSTALL.info
-@settitle INSTALL
-
-@node Top, , , (dir)
-@top
-
-
-@unnumberedsec Name
-    
-
-INSTALL - installing StepMake
-
-@unnumberedsec Description
-    
-
-This page documents installation and usage of StepMake
-
-@unnumberedsec Abstract
-    
-
-StepMake is a drop-in package that takes care of generic Makefile and
-packaging/distribution issues.  It enables you to write only the simplest of
-Makefile snippets, while providing a series powerful make targets.  Features
-include speed, wildcarding, out/ dir build, stateless Makefiles and package
-clustering.  It includes some handy scripts for making (package-)diffs and
-patches, making binary distributions etc.
-
-To use StepMake with your package, you do something remotely like:
-@example 
-
-    tar xzf releases/stepmake-0.1.23
-    cd package-x.x.x/		       # package to be StepMake-ised
-    ./../stepmake-0.1.23/bin/stepmakeise.sh
- 
-@end example 
-
-You'll have to customize at least the files:
-@example 
-
-    ./VERSION .
-    ./configure.in 
- 
-@end example 
-
-to your package's needs.  You might want to take a look at:
-@example 
-
-    ./make/Toplevel.make.in
-    ./config.hh.in
-    ./config.make.in
- 
-@end example 
-
-Also, you should put a Makefile in every subdirectory of your
-package.  These makefiles generally are quite simple, e.g. this 
-is a the makefile for an include directory of LilyPond:
-@example 
-
-    # lily/include/Makefile
-
-    depth = ../..
-    include $(depth)/make/Stepmake.make
- 
-@end example 
-
-it will identify all @code{.h, .hh, ...} files and take care of distributing 
-them.
-
-There's a @file{make/Template.make} that you can use as an example.
-See also the Makefiles in the LilyPond or Yodl package.
-
-Once included in your package, StepMake (or in fact, any 
-StepMake-ised package) behaves as a normal subdirectory;
-make commands such as 'make dist' recurse into the stepmake tree
-(For a list of available targets, type @code{make help} after
-configuring).
-Stepmake (and any changes made) will be distributed with the main
-pacakage.  However, StepMake doesn't lose its independency, change
-to the stepmake directory, and it'll behave as a main package.
-You shouldn't version directory names of subpackages, otherwise
-you'll see that package twice in each patch when you upgrade.
-
-@unnumberedsec Prerequisites
-    
-
-To use StepMake with a package you need:
-
-@itemize @bullet
-@item A GNU system: StepMake is known to work on these GNU systems: Linux
-    (PPC, intel), FreeBSD, AIX, NeXTStep, IRIX, Digital Unix and Solaris.
-    If you have the Cygnus WINDOWS32 port of the GNU utils, it will even
-    work in Windows NT/95, but we don't promise to support it.
-@item GNU make 
-@item GNU autoconf
-@end itemize
-
-@unnumberedsec Recommended
-    
-
-Although not strictly necessary, these are recommended to have.
-
-@itemize @bullet
-@item Python
-@item Yodl.  All documentation will be in Yodl. (1.22.jcn3)
-@item GNU find
-@end itemize
-
-@unnumberedsec Internals
-    
-
-Over time, we put a lot of effort in the configure, make, distribute
-system (CMDS) for LilyPond.  Some months ago, we realised it was not
-standard GNU --- we require GNU make for building, and Python for extra
-scripting.  In an effort to be more GNU, we tried automake, but after two
-weeks we realised the costs were too high for us and we reverted to our
-own system (see @file{automake.urgh}).  Not long after that i was confronted
-with two other packages that lacked a decent CMDS.  I realised that Lily's
-would be perfect, it's modular and easy.  The only problem was to make a
-clean cut between generic and Lily specific stuff.  The result was
-StepMake: a bunch of generic makefiles, found in:
-@example 
-
-    stepmake/stepmake/*.make
- 
-@end example 
-
-eneric helper scripts:
-@example 
-
-    stepmake/bin/*.sh
-    stepmake/bin/*.py
- 
-@end example 
-
-and modular configure functions:
-@example 
-
-    stepmake/configure.in
-    stepmake/aclocal.m4
-    stepmake/config.hh.in
-    stepmake/config.make.in
- 
-@end example 
-
-Of course, every package has its own configure- and make peculiarities.
-The best way to create the configure scripts is to copy them from
-stepmake@footnote{Actually, stepmake/bin/stepmakeise.sh will do
-that for you.} into you package's toplevel directory.  For most
-packages, you'll only have to comment in/out some functions in
-@file{configure.in}.
-
-Package specific makefiles go in:
-@example 
-
-    make/Targets.make
-    make/Rulese.make
-    make/Substitute.make
- 
-@end example 
-
-and are included by the generic StepMake makefiles.
-
-@unnumberedsec Maintaining
-    
-
-If you want to make and manage (binary) distributions, create and apply
-patches, you'll need some framework that's outside of the package's
-sourcetree.
-For a number of simple  maintenance tasks, StepMake will therefore assume
-the following directory structure:
-
-Check and update the layout with the command:
-@example 
-
-    ./stepmake/bin/stepdirs.sh
- 
-@end example 
-
-@unnumberedsec See also
-    
-
-@code{../PATCHES.txt}
-
-@unnumberedsec Configuring
-    
-
-Stepmake comes with a number of precooked configure functions for
-general needs, such as AC_STEPMAKE_COMPILE for simple C development
-and AC_STEPMAKE_CXX for C++.
-
-See configure.in and comment in/out the functions that your package
-needs.  For specific needs, you can write your own autoconf code,
-see @code{info autoconf}.
-
-@example 
-
-    doos/                        # gnu/windows32 build and binary releases
-    harmonia -> harmonia-x.y.z 
-    harmonia-x.y.z/
-    lilypond -> lilypond-x.y.z   # symlink to development directory
-    lilypond-x.y.z/              # current development
-    patches/ 		         # patches between different releases
-    RedHat/BUILD                 # RedHat build and binary releases
-    RedHat/RPMS
-    RedHat/SPECS
-    releases/                    # .tar.gz releases
-    test/                        # tarballs and diffs from current version
-    yodl -> yodl-1.30.17
-    yodl-1.30.17
- 
-@end example 
-
-with prefix @file{$HOME/usr/src}
-and (for building rpms only) in @file{$HOME/.rpmrc}:
-@example 
-
-    topdir: /home/fred/usr/src/RedHat
- 
-@end example 
-
-
-@unnumberedsec Authors
-
-@itemize @bullet
-@item @email{hanwen@@cs.uu.nl, Han-Wen Nienhuys}, 
-    @uref{http://www.cs.uu.nl/people/hanwen}
-    @* 
-    Main author.
-
-@item @email{janneke@@gnu.org, Jan Nieuwenhuizen},
-    @uref{http://www.xs4all.nl/~jantien}
-    @* 
-    Main author.
-@item @email{daboys@@austin.rr.com, Jeffrey B. Reed},
-    Windows-nt fixes.
-@end itemize
-
-
-@bye
diff --git a/stepmake/README b/stepmake/README
deleted file mode 100644
index a29e0e50e5..0000000000
--- a/stepmake/README
+++ /dev/null
@@ -1,19 +0,0 @@
-StepMake
-
-This is a simple generic make package.
-It is being used by LilyPond and Harmonia
-(and StepMake itself, of course)
-
-You're looking at her embryonal state -- things are *supposed* 
-to be broken.
-
-Fixes/patches/suggestions appreciated.
-
-StepMake 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 3 of the License, or
-(at your option) any later version.
-
-Jan Nieuwenhuizen <janneke@gnu.org>
-ftp://pcnov095.win.tue.nl/pub/lilypond/development
-
diff --git a/stepmake/autogen.sh b/stepmake/autogen.sh
deleted file mode 100755
index 34c022e082..0000000000
--- a/stepmake/autogen.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-# Run this to generate configure and initial GNUmakefiles
-
-srcdir=`dirname $0`
-
-case $1 in
-    --noconf*) NOCONFIGURE=true;;
-esac
-
-if [ ! -f aclocal.m4 -o stepmake/aclocal.m4 -nt aclocal.m4 ]; then
-    echo "stepmake/aclocal.m4 is newer.  Copying file." 
-    cp -f stepmake/aclocal.m4 aclocal.m4
-fi
-
-if [ ! -f autogen.sh -o stepmake/autogen.sh -nt autogen.sh ]; then
-    echo "stepmake/autogen.sh is newer.  Copying file." 
-    cp -f stepmake/autogen.sh autogen.sh
-    exec ./autogen.sh "$@"
-fi
-
-for i in $srcdir/configure.in #`find $srcdir -name configure.in -print`
-do 
-  dir=`dirname $i`
-  echo processing $dir
-  (
-      cd $dir
-      echo "Running autoconf ..."
-      autoconf || exit 1
-  )
-  # Autoconf automatically checks its own minimum required
-  # version, and it aborts when the check fails.
-  test "$?" -eq 1 && exit 1
-done
-
-#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
-if test -n "$NOCONFIGURE"; then
-    echo Skipping configure process.
-    exit 0
-fi
-
-if test -z "$*"; then
-    cat <<EOF
-    Warning: about to run \`configure' without arguments.
-    arguments on the \`$0' command line
-    will be passed to \`configure'.
-
-    Invoke with --noconfigure to skip configure step.
-EOF
-fi
-
-echo Running $srcdir/configure $conf_flags "$@" ...
-$srcdir/configure $conf_flags "$@"
diff --git a/stepmake/bin/GNUmakefile b/stepmake/bin/GNUmakefile
deleted file mode 100644
index 13b4d2ad37..0000000000
--- a/stepmake/bin/GNUmakefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# bin/Makefile
-
-depth = ../..
-EXTRA_DIST_FILES = install-sh config.sub config.guess
-STEPMAKE_TEMPLATES=script install
-
-include $(depth)/make/stepmake.make
-
-POST_INSTALL=chmod 755 $(datadir)/bin/*
-INSTALLATION_DIR=$(datadir)/bin
-INSTALLATION_FILES=$(DIST_FILES)
diff --git a/stepmake/bin/fake-msgfmt.sh b/stepmake/bin/fake-msgfmt.sh
deleted file mode 100644
index 1a97f8d510..0000000000
--- a/stepmake/bin/fake-msgfmt.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-IDENTIFICATION=fake-msgfmt.sh
-
-OUTPUT='/dev/null'
-
-while getopts ':d:o:' OPT;
-do
-case $OPT in
-o)
-    OUTPUT=$OPTARG
-    ;;
-*)
-    ;;
-    esac
-done
-
-
-
-shift `expr $OPTIND - 1`
-#
-# Input file name
-#
-if [ "$1" = "" ]
-then
-  echo "$IDENTIFICATION: No input file name given"
-  exit 1
-fi
-
-echo Faking msgfmt: copying $1 to $OUTPUT
-
-
-cp $1 $OUTPUT
diff --git a/stepmake/bin/ntpwd.py b/stepmake/bin/ntpwd.py
deleted file mode 100644
index a4838b36b8..0000000000
--- a/stepmake/bin/ntpwd.py
+++ /dev/null
@@ -1,29 +0,0 @@
-"""Winnt access into /etc/passwd via account name"""
-
-import sys
-import string
-
-def getpwname( name, pwfile='/etc/passwd' ):
-  "Get password record that matches the specified name"
-  try:
-    _fd = open( pwfile, 'r' )
-  except:
-    sys.stderr.write("Error unable to locate" + pwfile + "\n")
-    sys.stderr.write("Consult gnu-win32 command mkpasswd\n")
-    sys.exit(1)
-
-  _data = _fd.read()
-  _fd.close()
-    
-  for _line in string.split(_data, '\n'):
-    _record=string.split( _line, ':' );
-    if _record[0] == name:
-      return _record
-  return ()
-
-def _test():
-  pw = getpwname( 'jeff' )
-  print pw[4]
-
-if __name__ == '__main__':
-    _test()
diff --git a/stepmake/bin/stepmakeise.sh b/stepmake/bin/stepmakeise.sh
deleted file mode 100755
index e2ae7cfe8b..0000000000
--- a/stepmake/bin/stepmakeise.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/sh
-# stepmakeise.sh
-
-help () {
-	cat <<EOF
-Usage: ../stepmake-x.x.x/bin/stepmakeise.sh
-Include or update package's StepMake.
-EOF
-}
-
-name=`basename $0`
-reldir=../releases
-stepbin=`dirname $0`
-
-if [ $# -ne 0 ]; then
-	help
-	exit 2
-fi
-
-value ()
-{
-    expression=`echo $1 | sed 's/\./ \\\\\* 100 + /g'`
-    # urg?  $1=`expr $expression`
-    urg=/tmp/stepmakeise.$$
-    echo expr $expression > $urg
-    echo `. $urg`
-    rm -f $urg
-}
-
-if [ -r stepmake ]; then
-	. ./stepmake/VERSION
-	if [ "x$PACKAGE_NAME" != "xStepMake" ]; then
-		echo "$name: huh 1?"
-		exit 1
-	fi
-	echo "Stepmake found"
-	printf "Checking version..."
-	VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_LEVEL
-	# urg
-	version=$VERSION
-	if [ "$MY_PATCH_LEVEL" != "" ]; then
-		VERSION=$VERSION.$MY_PATCH_LEVEL
-	fi
-	echo " $version"
-else
-	VERSION="0.0.0"
-	version=$VERSION
-fi
-
-if [ true ]; then
-	# urg
-	printf "Checking latest..."
-	if [ ! -r $reldir ]; then
-		echo "$name: huh 2?"
-		exit 1
-	fi
-	LATEST=`cd $reldir; ls -t1 stepmake-*.tar.gz | head -n 1 | sed 's!stepmake-!!' | sed 's!.tar.gz!!'`
-	# urg
-	latest=`echo $LATEST | sed 's/\.[a-zA-Z][a-zA-Z]*[0-9]*$//'`
-	latest_val=`value $latest`
-	echo " $latest"
-	version_val=`value $version`
-	if [ $latest_val -le $version_val ]; then
-	    echo "relax, StepMake is up to date"
-	    exit 0
-	fi
-	printf "Updating StepMake..."
-	(set +x; rm -rf stepmake; tar xzf $reldir/stepmake-$LATEST.tar.gz; mv stepmake-$LATEST stepmake)
-	echo "ok"
-fi
-
-if [ -r VERSION ]; then
-	echo "$name: warning: VERSION found: not stepmakeising"
-	echo "You should rerun configure"
-	rm -f Makefile
-	exit 0
-fi
-
-files="VERSION make aclocal.in configure.in config.hh.in config.make.in"
-for i in $files; do
-	if [ -r $i ]; then
-		echo "$name: can't stepmakise: $i already present"
-		exit 1
-	fi
-done
-
-printf "Stepmakeising..."
-for i in $files; do
-	cp -prv stepmake/$i .
-done
-
-cat <<EOF
-ok
-Please edit the folowing files to your package's needs:
-
-    VERSION
-    configure.in 
-
-and look at:
-
-    make/Toplevel.make.in
-    config.hh.in
-    config.make.in
-EOF
-
diff --git a/stepmake/config.hh.in b/stepmake/config.hh.in
deleted file mode 100644
index 58f6d8b230..0000000000
--- a/stepmake/config.hh.in
+++ /dev/null
@@ -1,14 +0,0 @@
-/* @configure_input@ */
-
-/* Hmm */
-#define PACKAGE "@package@"
-
-/* Toplevel version */
-#define  TOPLEVEL_VERSION "@TOPLEVEL_VERSION@"
-
-/* default init and input dir */
-#define DATADIR "@DATADIR@"
-
-/* default locale dir */
-#define LOCALEDIR "@LOCALEDIR@"
-
diff --git a/stepmake/configure.in b/stepmake/configure.in
deleted file mode 100644
index 3900ffd9fd..0000000000
--- a/stepmake/configure.in
+++ /dev/null
@@ -1,45 +0,0 @@
-dnl configure.in   -*-shell-script-*-
-dnl Process this file with autoconf to produce a configure script. 
-
-# Bootstrap the init proces.
-AC_INIT
-
-# Bootstrap StepMake configure
-# For user package:
-# AC_CONFIG_AUX_DIR(stepmake/bin)
-# For stepmake package:
-AC_CONFIG_AUX_DIR(bin)
-STEPMAKE_INIT
-
-# List a file that identifies your package.
-AC_CONFIG_SRCDIR([make/stepmake.lsm.in])
-# Move to aclocal.m4?
-AC_CONFIG_HEADER([$CONFIGFILE.h:config.hh.in])
-
-# For all packages except the StepMake package itself
-# AC_CONFIG_SUBDIRS(stepmake)
-
-CC=echo
-AC_SUBST(CC)
-# Uncomment the configuration options your package needs.
-# STEPMAKE_COMPILE
-# AC_CHECK_HEADERS([limits.h malloc.h string.h unistd.h values.h])
-# STEPMAKE_CXX
-# STEPMAKE_GXX
-# STEPMAKE_CXXTEMPLATE
-# STEPMAKE_LEXYACC
-# STEPMAKE_LIB
-# STEPMAKE_LIBTOOL
-STEPMAKE_LOCALE
-# STEPMAKE_GETTEXT
-# STEPMAKE_MAN
-# STEPMAKE_MSGFMT
-# STEPMAKE_TEXMF
-# STEPMAKE_TEXMF_DIRS
-
-# AM_PATH_GTK(1.0.0,,AC_MSG_ERROR([please install proper version of gtk]))
-# AM_PATH_GTK__(0.9.4,,AC_MSG_ERROR([please install proper version of gtk--]))
-
-AC_CHECK_PROGS(MAKEINFO, makeinfo, error)
-
-STEPMAKE_END
diff --git a/stepmake/stepmake/GNUmakefile b/stepmake/stepmake/GNUmakefile
deleted file mode 100644
index f2c693ba22..0000000000
--- a/stepmake/stepmake/GNUmakefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# title	   makefile for stepmake
-
-# subdir level:
-#
-depth = ../..
-#
-
-# descent order into subdirectories:
-#
-SUBDIRS =
-#
-
-STEPMAKE_TEMPLATES=makedir install
-
-# bootstrap stepmake:
-#
--include $(depth)/make/stepmake.make
-
-ifeq ($(PACKAGE),STEPMAKE)
-INSTALLATION_DIR=$(datadir)/stepmake
-else
-INSTALLATION_DIR=$(dir $(patsubst %/, %, $(dir $(datadir))))$(package)/stepmake/stepmake
-endif
-INSTALLATION_FILES=GNUmakefile $(MAKE_FILES)
-
diff --git a/stepmake/stepmake/generic-targets.make b/stepmake/stepmake/generic-targets.make
index 45e9e8bfc7..1fc60ba8c4 100644
--- a/stepmake/stepmake/generic-targets.make
+++ b/stepmake/stepmake/generic-targets.make
@@ -1,4 +1,4 @@
-.PHONY : all clean bin-clean config default dist exe help html lib TAGS\
+.PHONY : all clean bin-clean default dist exe help html lib TAGS\
 	 po doc doc-stage-1 WWW-1 WWW-2 WWW-post local-WWW-1 local-WWW-2\
 	 log-clean
 
@@ -40,19 +40,13 @@ cvs-clean:
 	$(MAKE) local-distclean
 	rm -rf out
 	rm -rf out-www
-	rm -f aclocal.m4 configure
+	rm -f configure
 
 maintainerclean:
 	$(LOOP)
 	$(MAKE)	local-maintainerclean
 	$(MAKE) local-distclean
 
-
-# This doesn't allow command-line options, is it really useful? -jm
-config:
-	./$(src-depth)/configure
-
-
 generic-help:
 	@echo "Makefile for $(PACKAGE_NAME) $(TOPLEVEL_VERSION)"
 	@echo "Usage: make ["VARIABLE=value"]... [TARGET]"
@@ -109,8 +103,10 @@ local-tags:
 			$(ERROR_LOG) ; \
 	fi
 
-$(outdir)/version.hh: $(depth)/VERSION $(config_make) $(step-bindir)/make-version.py
-	$(PYTHON) $(step-bindir)/make-version.py $< > $@
+# Don't use $(buildscript-dir)/make-version, because it is not known whether
+# build process has visited scripts/build
+$(outdir)/version.hh: $(depth)/VERSION $(config_make) $(top-src-dir)/scripts/build/make-version.py
+	$(PYTHON) $(top-src-dir)/scripts/build/make-version.py $< > $@
 
 $(outdir)/config.hh: $(config_h)
 	cp -p $< $@
diff --git a/stepmake/stepmake/generic-vars.make b/stepmake/stepmake/generic-vars.make
index da7d704756..b0fc521e93 100644
--- a/stepmake/stepmake/generic-vars.make
+++ b/stepmake/stepmake/generic-vars.make
@@ -39,12 +39,11 @@ distname = $(package)-$(TOPLEVEL_VERSION)
 doc-dir = $(src-depth)/Documentation
 po-srcdir = $(src-depth)/po
 po-outdir = $(depth)/po/$(outdir)
-step-bindir = $(stepmake)/bin
 
 # stepmake package support.
 DEPTH = $(depth)/$(package-depth)
 
-INSTALLPY=$(PYTHON) $(step-bindir)/install.py -c
+INSTALLPY=$(buildscript-dir)/install -c
 INSTALL=$(INSTALLPY)
 
 group-dir = $(shell cd $(DEPTH);pwd)/..
diff --git a/stepmake/stepmake/toplevel-targets.make b/stepmake/stepmake/toplevel-targets.make
index b1a05f0d0b..bdabb19477 100644
--- a/stepmake/stepmake/toplevel-targets.make
+++ b/stepmake/stepmake/toplevel-targets.make
@@ -14,16 +14,6 @@ local-maintainerclean:
 GNUmakefile: GNUmakefile.in
 	$(MAKE) INFILE=$< OUTFILE=$@ -f $(stepdir)/automatically-generated.sub.make
 
-ifneq ($(PACKAGE),STEPMAKE)
-aclocal.m4: $(stepmake)/aclocal.m4
-	$(MAKE) INFILE=$< OUTFILE=$@ LINECOMMENT=dnl -f $(stepdir)/automatically-generated.sub.make
-
-autogen.sh: $(stepmake)/autogen.sh
-	$(MAKE) INFILE=$< OUTFILE=$@ LINECOMMENT=\# -f $(stepdir)/automatically-generated.sub.make
-	chmod +x autogen.sh
-endif
-
-
 $(package-icon):
 	$(MAKE) -C Documentation/logo icon
 
-- 
2.39.5