-CC=/usr/bin/cc
-CFLAGS=-Wall -Wextra -Werror -std=c89
-DEBUGF=-O0 -g
-
-LINKGN=bin/obj/hostnamed-gen.o bin/obj/localed-gen.o bin/obj/timedated-gen.o bin/obj/logind-gen.o
-LINKHN=bin/systemd-hostnamed bin/systemd-localed bin/systemd-timedated bin/systemd-logind
-
-GLIBEF=`pkg-config --cflags --libs glib-2.0 gobject-2.0 gio-2.0 gio-unix-2.0`
-GLIBOF=`pkg-config --cflags glib-2.0 gobject-2.0 gio-2.0 gio-unix-2.0`
-
-SANITY=-Wno-unused-variable -Wno-unused-parameter # -Wno-comment
-
-PREFIX=/usr/local
-SYSCONFDIR=/etc
-SRCDIR=src
-INTFDIR=$(SRCDIR)/interfaces
-
-DBUS_POLICYDIR=$(SYSCONFDIR)/dbus-1/system.d
-DBUS_CONFIGDIR=$(PREFIX)/share/dbus-1/system-services
-
-INVOKE_GENFILE_SCRIPT=./scripts/gen-gdbus-interfaces.sh
+CC?= /usr/bin/cc
+CFLAGS= -Wall -Wextra -Werror -std=c89
+
+DEBUG= 1
+.ifdef DEBUG
+CFLAGS+= -O0 -g
+.endif
+
+SANITY= 1
+.ifdef SANITY
+CFLAGS+= -Wno-unused-variable -Wno-unused-parameter # -Wno-comment
+.endif
+
+PREFIX?= /usr/local
+BINDIR= $(PREFIX)/libexec
+SYSCONFDIR?= /etc
+
+INSTALL_PROGRAM= install -c -s -o root -g bin -m 555
+INSTALL_PROGRAM_DIR= install -d -o root -g bin -m 755
+INSTALL_DATA= install -c -o root -g bin -m 444
+INSTALL_DATA_DIR= install -d -o root -g bin -m 755
+
+LINKGN= bin/obj/hostnamed-gen.o \
+ bin/obj/localed-gen.o \
+ bin/obj/timedated-gen.o \
+ bin/obj/logind-gen.o
+
+LINKHN= bin/systemd-hostnamed \
+ bin/systemd-localed \
+ bin/systemd-timedated \
+ bin/systemd-logind
+
+DBUS_SERVICES= org.freedesktop.hostname1.service \
+ org.freedesktop.locale1.service \
+ org.freedesktop.login1.service \
+ org.freedesktop.timedate1.service
+
+GLIBEF=`pkg-config --cflags --libs glib-2.0 gobject-2.0 gio-2.0 gio-unix-2.0 polkit-agent-1`
+GLIBOF=`pkg-config --cflags glib-2.0 gobject-2.0 gio-2.0 gio-unix-2.0 polkit-agent-1`
+
+SRCDIR= src
+CONFDIR= conf
+POLICYDIR= $(CONFDIR)/sysbus-policy
+ISPECTDIR= $(CONFDIR)/introspect-xml
+SERVICEFDIR= $(CONFDIR)/service-files
+POLKITDIR= $(CONFDIR)/polkit-policy
+
+INTFDIR= $(SRCDIR)/interfaces
+
+DBUS_POLICYDIR= $(SYSCONFDIR)/dbus-1/system.d
+DBUS_CONFIGDIR= $(PREFIX)/share/dbus-1/system-services
+POLKIT_POLICYDIR= $(PREFIX)/share/polkit-1/actions
+
+INVOKE_GENFILE_SCRIPT= \
+ ./scripts/gen-gdbus-interfaces.sh