-PACKAGE = preload-hacks
-VERSION := $(shell ./auto-version)
-
-prefix = /usr/local
-exec_prefix = ${prefix}
-bindir = ${exec_prefix}/bin
-libdir = ${exec_prefix}/lib
-mandir = ${prefix}/man
-man1dir = ${mandir}/man1
-
-CC = gcc
-LD = gcc
-CFLAGS = -O2 -g -Wall
-LDFLAGS =
-REAL_CFLAGS = $(CFLAGS) -fPIC
-REAL_LDFLAGS = $(LDFLAGS) -shared
-LDLIBS = -ldl
-INST_BIN = install -c -m755
-INST_LIB = install -c -m644
-INST_MAN = install -c -m644
-INST_BIN = install -c -m755
-MKDIRS = install -d -m755
-DESTDIR =
-
-LIBS = noip.so uopen.so
-MAN1 = $(patsubst %.so, %.1, $(LIBS))
-SCRIPTS = $(patsubst %.so, %, $(LIBS))
-TARGETS = $(LIBS) $(SCRIPTS)
-SOURCES = noip.c uopen.c withlib.in
+### -*-makefile-*-
+###
+### Makefile for preload-hacks
+###
+### (c) 2008 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 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 mLib; if not, write to the Free Software Foundation, Inc., 59 Temple
+### Place - Suite 330, Boston, MA 02111-1307, USA.
+
+PACKAGE = preload-hacks
+VERSION := $(shell ./auto-version)
+
+###--------------------------------------------------------------------------
+### Configuration.
+
+## Where to install things.
+prefix = /usr/local
+exec_prefix = ${prefix}
+bindir = ${exec_prefix}/bin
+libdir = ${exec_prefix}/lib
+datadir = ${prefix}/share
+mandir = ${datadir}/man
+man1dir = ${mandir}/man1
+
+## Private installation tree for packagers.
+DESTDIR =
+
+###--------------------------------------------------------------------------
+### Build parameters.
+
+## Mess with these if you like.
+CC = gcc
+LD = gcc
+CFLAGS = -O2 -g -Wall
+LDFLAGS =
+LDLIBS = -ldl
+INSTALL = install
+INST_BIN = $(INSTALL) -c -m755
+INST_LIB = $(INSTALL) -c -m644
+INST_MAN = $(INSTALL) -c -m644
+INST_BIN = $(INSTALL) -c -m755
+MKDIRS = $(INSTALL) -d -m755
+
+## Probably best if you leave these alone.
+REAL_CFLAGS = $(CFLAGS) -fPIC
+REAL_LDFLAGS = $(LDFLAGS) -shared
+
+###--------------------------------------------------------------------------
+### Main targets.
+
+## noip
+HACKS += noip
+NOIP_SOURCES = noip.c
+DISTFILES += $(NOIP_SOURCES)
+
+## uopen
+HACKS += uopen
+UOPEN_SOURCES = uopen.c
+DISTFILES += $(UOPEN_SOURCES)
+
+## Libraries.
+LIBS += $(addsuffix .so, $(HACKS))
+TARGETS += $(LIBS)
+
+## Scripts.
+SCRIPTS = $(HACKS)
+TARGETS += $(SCRIPTS)
+DISTFILES += withlib.in
+
+## Manual pages.
+MAN1 += $(addsuffix .1, $(HACKS))
+DISTFILES += $(MAN1)
+
+###--------------------------------------------------------------------------
+### Distribution arrangements.
+
+## Names.
+distdir = $(PACKAGE)-$(VERSION)
+DISTTAR = $(distdir).tar.gz
+
+## Distribute the build utilities.
+DISTFILES += Makefile
+DISTFILES += auto-version
+
+## Documentation.
+DISTFILES += README
+
+## Licensing.
+DISTFILES += COPYING
+
+## Debian.
+debpkg = noip uopen
+DISTFILES += debian/changelog debian/copyright
+DISTFILES += debian/control debian/rules
+DISTFILES += $(patsubst %, debian/%.install, $(debpkg))
+DISTFILES += $(patsubst %, debian/%.lintian-overrides, \
+ $(debpkg))
+
+###--------------------------------------------------------------------------
+### Building.
+