X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=Makefile;h=3653595b06c111157ca229a2cb5ee0c945418870;hp=cdee7ac81288721b22a08366f32a821ca159f0b7;hb=3555a14bae9f372385e4bc01368027cdbc29384c;hpb=18a0d6522d06338c76d7706f4a246a37e232f31c diff --git a/Makefile b/Makefile index cdee7ac81..3653595b0 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ DEBUG = false # Set the following to `true' to make udev emit a D-BUS signal when a # new node is created. -DBUS = false +USE_DBUS = false ROOT = udev @@ -40,6 +40,7 @@ mandir = ${prefix}/usr/share/man hotplugdir = ${etcdir}/hotplug.d/default dbusdir = ${etcdir}/dbus-1/system.d configdir = ${etcdir}/udev/ +initdir = ${etcdir}/init.d/ srcdir = . INSTALL = /usr/bin/install -c @@ -56,7 +57,7 @@ udevdir = ${prefix}/udev # Comment out this line to build with something other # than the local version of klibc -#KLIBC = true +#USE_KLIBC = true # If you are running a cross compiler, you may want to set this # to something more interesting, like "arm-linux-". I you want @@ -115,7 +116,7 @@ endif # If we are using our version of klibc, then we need to build and link it. # Otherwise, use glibc and link statically. -ifeq ($(strip $(KLIBC)),true) +ifeq ($(strip $(USE_KLIBC)),true) KLIBC_BASE = $(PWD)/klibc KLIBC_DIR = $(KLIBC_BASE)/klibc INCLUDE_DIR := $(KLIBC_DIR)/include @@ -179,11 +180,11 @@ OBJS = udev.o \ $(SYSFS) \ $(TDB) -ifeq ($(strip $(KLIBC)),true) +ifeq ($(strip $(USE_KLIBC)),true) OBJS += klibc_fixups.o endif -ifeq ($(DBUS), true) +ifeq ($(USE_DBUS), true) CFLAGS += -DUSE_DBUS CFLAGS += $(shell pkg-config --cflags dbus-1) LDFLAGS += $(shell pkg-config --libs dbus-1) @@ -203,6 +204,14 @@ udev_version.h: @echo \#define UDEV_RULES_FILE \"$(configdir)\udev.rules\" >> $@ @echo \#define UDEV_PERMISSION_FILE \"$(configdir)\udev.permissions\" >> $@ +# config files automatically generated +GEN_CONFIGS = udev.conf + +# Rules on how to create the generated config files +udev.conf: + sed -e "s-@udevdir@-$(udevdir)-" < udev.conf.in > $@ + + $(OBJS): $(GEN_HEADERS) $(ROOT): $(OBJS) @@ -212,7 +221,7 @@ $(ROOT): $(OBJS) clean: -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \ | xargs rm -f - -rm -f core $(ROOT) $(GEN_HEADERS) udev.conf + -rm -f core $(ROOT) $(GEN_HEADERS) $(GEN_CONFIGS) $(MAKE) -C klibc clean @for target in $(EXTRAS) ; do \ echo $$target ; \ @@ -252,7 +261,7 @@ small_release: $(DISTFILES) clean @echo "Built $(RELEASE_NAME).tar.gz" -ifeq ($(DBUS), true) +ifeq ($(USE_DBUS), true) install-dbus-policy: $(INSTALL) -d $(DESTDIR)$(dbusdir) $(INSTALL_DATA) udev_sysbus_policy.conf $(DESTDIR)$(dbusdir) @@ -265,13 +274,13 @@ uninstall-dbus-policy: - endif -install: install-dbus-policy all +install: install-dbus-policy all $(GEN_CONFIGS) $(INSTALL) -d $(DESTDIR)$(udevdir) $(INSTALL) -d $(DESTDIR)$(configdir) $(INSTALL) -d $(DESTDIR)$(hotplugdir) $(INSTALL_PROGRAM) -D $(ROOT) $(DESTDIR)$(sbindir)/$(ROOT) + $(INSTALL_PROGRAM) -D etc/init.d/udev $(DESTDIR)$(initdir)/udev $(INSTALL_DATA) -D udev.8 $(DESTDIR)$(mandir)/man8/udev.8 - sed -e "s-@udevdir@-$(udevdir)-" < udev.conf.in > udev.conf $(INSTALL_DATA) udev.conf $(DESTDIR)$(configdir) $(INSTALL_DATA) udev.rules $(DESTDIR)$(configdir) $(INSTALL_DATA) udev.permissions $(DESTDIR)$(configdir) @@ -288,6 +297,7 @@ uninstall: uninstall-dbus-policy - rm $(configdir)/udev.permissions - rm $(configdir)/udev.rules - rm $(configdir)/udev.conf + - rm $(initdir)/udev - rm $(mandir)/man8/udev.8 - rm $(sbindir)/$(ROOT) - rmdir $(hotplugdir)