chiark / gitweb /
[PATCH] sync klibc with release 0.95
[elogind.git] / Makefile
index cdee7ac81288721b22a08366f32a821ca159f0b7..3653595b06c111157ca229a2cb5ee0c945418870 100644 (file)
--- 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.
 
 # 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
 
 
 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/
 hotplugdir =   ${etcdir}/hotplug.d/default
 dbusdir =      ${etcdir}/dbus-1/system.d
 configdir =    ${etcdir}/udev/
+initdir =      ${etcdir}/init.d/
 srcdir = .
 
 INSTALL = /usr/bin/install -c
 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
 
 # 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
 
 # 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.
 
 # 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
        KLIBC_BASE      = $(PWD)/klibc
        KLIBC_DIR       = $(KLIBC_BASE)/klibc
        INCLUDE_DIR     := $(KLIBC_DIR)/include
@@ -179,11 +180,11 @@ OBJS =    udev.o          \
        $(SYSFS)        \
        $(TDB)
 
        $(SYSFS)        \
        $(TDB)
 
-ifeq ($(strip $(KLIBC)),true)
+ifeq ($(strip $(USE_KLIBC)),true)
        OBJS += klibc_fixups.o
 endif
 
        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)
        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\" >> $@
 
        @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)
 $(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 
 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 ; \
        $(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"
 
 
        @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)
 install-dbus-policy:
        $(INSTALL) -d $(DESTDIR)$(dbusdir)
        $(INSTALL_DATA) udev_sysbus_policy.conf $(DESTDIR)$(dbusdir)
@@ -265,13 +274,13 @@ uninstall-dbus-policy:
        -
 endif
 
        -
 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) -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) -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)
        $(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 $(configdir)/udev.permissions
        - rm $(configdir)/udev.rules
        - rm $(configdir)/udev.conf
+       - rm $(initdir)/udev
        - rm $(mandir)/man8/udev.8
        - rm $(sbindir)/$(ROOT)
        - rmdir $(hotplugdir)
        - rm $(mandir)/man8/udev.8
        - rm $(sbindir)/$(ROOT)
        - rmdir $(hotplugdir)