### with preload-hacks; if not, write to the Free Software Foundation, Inc.,
### 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-srcdir = .
+srcdir ?= .
PACKAGE = preload-hacks
VERSION := $(shell cd $(srcdir) && ./auto-version)
DISTTAR = $(distdir).tar.gz
## Distribute the build utilities.
-DISTFILES += Makefile
+DISTFILES += Make.rules
+DISTFILES += configure
DISTFILES += auto-version
## Documentation.
+cd _distcheck && \
tar xvfz ../$(DISTTAR) && \
mkdir _build && cd _build && \
- make -f../$(distdir)/Makefile srcdir=../$(distdir) && \
- make -f../$(distdir)/Makefile srcdir=../$(distdir) \
- install DESTDIR=../_install && \
- make -f../$(distdir)/Makefile srcdir=../$(distdir) dist
+ ../$(distdir)/configure && \
+ make && \
+ make install DESTDIR=../_install && \
+ make dist
rm -rf _distcheck
###----- That's all, folks --------------------------------------------------
--- /dev/null
+#! /bin/sh -e
+###
+### Cheesy configuration script.
+###
+### (c) 2018 Straylight/Edgeware
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This file is part of the preload-hacks package.
+###
+### Preload-hacks are free software; you can redistribute it and/or modify
+### them 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.
+###
+### Preload-hacks are 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 preload-hacks; if not, write to the Free Software Foundation, Inc.,
+### 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+## Check for a `help' option.
+case $1,$# in
+ ,0) ;;
+ -h,* | --help,*)
+ echo "usage: $0 [--VAR=VAL ...] -- [VAR=VAL ...]"
+ exit 0
+ ;;
+esac
+
+## Find a relative path to the source directory.
+case $0 in */*) ;; *) echo >&2 "$0: invoke as PATH/configure"; exit 2 ;; esac
+srcdir=${0%/*}
+
+## Build the actual makefile.
+rm -f Makefile.new
+cat >Makefile.new <<EOF
+### -*-makefile-*-
+srcdir = $srcdir
+include \$(srcdir)/Make.rules
+EOF
+
+## Build a configuration fragment.
+rm -f config.mk.new
+exec 3>config.mk.new
+cat >&3 <<EOF
+### -*-makefile-*-
+
+## Settings from \`configure'.
+EOF
+
+## Parse the options.
+while :; do
+ case $1,$# in
+ ,0) break ;;
+ --,*) shift; break ;;
+ --*=*) o=${1#--}; k=${o%%=*} v=${o#*=}; echo >&3 "$k = $v" ;;
+ --*,*) k=${1#--}; echo >&3 "$k = t" ;;
+ *) break ;;
+ esac
+ shift
+done
+
+## Parse any remaining assignments.
+while :; do
+ case $1,$# in
+ ,0) break ;;
+ *=*) k=${1%%=*} v=${1#*=}; echo >&3 "$k = $v" ;;
+ *) echo >&2 "$0: unexpected argument $1"; exit 2 ;;
+ esac
+ shift
+done
+
+## All over.
+exec 3>&-
+mv config.mk.new config.mk
+mv Makefile.new Makefile
#! /usr/bin/make -f
-arch = $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
+DH_OPTIONS = --parallel -Bdebian/build
-%:; dh $@ --parallel
+%:; dh $@ $(DH_OPTIONS)
-override_dh_auto_install:
- dh_auto_install --parallel -- \
- prefix=/usr mandir=/usr/share/man \
- libdir=/usr/lib/$(arch) \
- DESTDIR=debian/tmp
+override_dh_auto_configure:
+ dh_auto_configure $(DH_OPTIONS) -- \
+ $(shell dpkg-buildflags --export=cmdline)