X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=Makefile;h=3653595b06c111157ca229a2cb5ee0c945418870;hb=470e365d5338fbdcc8019d790c97ed1229de0196;hp=c50bd04824880e8a429fb591594dbca681e4520b;hpb=5aebfbcb62614fc2bf2b1579d62e3fe272c6751a;p=elogind.git diff --git a/Makefile b/Makefile index c50bd0482..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. -USE_DBUS = true +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 @@ -52,11 +53,11 @@ INSTALL_SCRIPT = ${INSTALL_PROGRAM} EXTRAS= # place to put our device nodes -udevdir = ${prefix}/udev/ +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 @@ -143,13 +144,6 @@ endif CFLAGS += -I$(PWD)/libsysfs -ifeq ($(USE_DBUS), true) - CFLAGS += -DUSE_DBUS - CFLAGS += $(shell pkg-config --cflags dbus-1) - LIB_OBJS += $(shell pkg-config --libs-only-l dbus-1) -endif - - all: $(ROOT) @for target in $(EXTRAS) ; do \ echo $$target ; \ @@ -186,23 +180,38 @@ OBJS = udev.o \ $(SYSFS) \ $(TDB) -ifeq ($(strip $(KLIBC)),true) +ifeq ($(strip $(USE_KLIBC)),true) OBJS += klibc_fixups.o endif +ifeq ($(USE_DBUS), true) + CFLAGS += -DUSE_DBUS + CFLAGS += $(shell pkg-config --cflags dbus-1) + LDFLAGS += $(shell pkg-config --libs dbus-1) + OBJS += udev_dbus.o +endif + # header files automatically generated GEN_HEADERS = udev_version.h # Rules on how to create the generated header files udev_version.h: @echo \#define UDEV_VERSION \"$(VERSION)\" > $@ - @echo \#define UDEV_ROOT \"$(udevdir)\" >> $@ - @echo \#define UDEV_DB \"$(udevdir)\.udev.tdb\" >> $@ + @echo \#define UDEV_ROOT \"$(udevdir)/\" >> $@ + @echo \#define UDEV_DB \"$(udevdir)/\.udev.tdb\" >> $@ @echo \#define UDEV_CONFIG_DIR \"$(configdir)\" >> $@ @echo \#define UDEV_CONFIG_FILE \"$(configdir)\udev.conf\" >> $@ @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) + -rm -f core $(ROOT) $(GEN_HEADERS) $(GEN_CONFIGS) $(MAKE) -C klibc clean @for target in $(EXTRAS) ; do \ echo $$target ; \ @@ -265,11 +274,12 @@ 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 $(INSTALL_DATA) udev.conf $(DESTDIR)$(configdir) $(INSTALL_DATA) udev.rules $(DESTDIR)$(configdir) @@ -287,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)