-export LIBAPT_MAJOR:=$(shell egrep '^MAJOR=' apt-pkg/makefile |cut -d '=' -f 2)
-debian/shlibs.local: apt-pkg/makefile
- rm -f $@
- echo "libapt-pkg $(LIBAPT_MAJOR) libapt-pkg$(LIBAPT_MAJOR)" >> $@
- echo "libapt-pkg $(LIBAPT_MAJOR) apt $(APT_DEBVER)" >> $@
-
-build: build-stamp
-build-stamp: configure
+include buildlib/libversion.mak
+
+# Determine which library package names to use
+LIBAPT_PKG=libapt-pkg$(LIBAPTPKG_MAJOR)
+LIBAPT_INST=libapt-inst$(LIBAPTINST_MAJOR)
+
+# do not fail as we are just experimenting with symbol files for now
+export DPKG_GENSYMBOLS_CHECK_LEVEL=0
+
+build: build/build-stamp
+build-doc: build/build-doc-stamp
+
+# Note that this is unconditionally done first as part of loading environment.mak
+# The true is needed to force make to reload environment.mak after running
+# configure-stamp. Otherwise we can get stale or invalid, or missing config data.
+build/environment.mak: build/configure-stamp
+ @true
+
+configure: configure.in
+build/configure-stamp: configure