chiark / gitweb /
[PATCH] PATCH some cleanups and security fixes
[elogind.git] / Makefile
index 67a7d465255585dd6f1f5dea566ba32b41e4a11d..9405b25c5f336a77109c5d6403a4738255c77af2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,8 @@ USE_LOG = true
 # Leave this set to `false' for production use.
 DEBUG = false
 
+# Set this to compile with Security-Enhanced Linux support.
+USE_SELINUX = false
 
 ROOT =         udev
 DAEMON =       udevd
@@ -170,9 +172,17 @@ else
        LDFLAGS =
 endif
 
+ifeq ($(strip $(USE_SELINUX)),true)
+       CFLAGS += -DUSE_SELINUX
+       LIB_OBJS += -lselinux
+endif
+
 CFLAGS += -I$(PWD)/libsysfs
 
-all: $(ROOT) $(SENDER) $(DAEMON) $(INFO) $(TESTER) $(WAIT)
+# config files automatically generated
+GEN_CONFIGS =  $(LOCAL_CFG_DIR)/udev.conf
+
+all: $(ROOT) $(SENDER) $(DAEMON) $(INFO) $(TESTER) $(WAIT) $(GEN_CONFIGS)
        @extras="$(EXTRAS)" ; for target in $$extras ; do \
                echo $$target ; \
                $(MAKE) prefix=$(prefix) \
@@ -219,6 +229,7 @@ HEADERS =   udev.h          \
                udevdb.h        \
                klibc_fixups.h  \
                logging.h       \
+               selinux.h       \
                list.h
 
 ifeq ($(strip $(USE_KLIBC)),true)
@@ -242,12 +253,9 @@ udev_version.h:
        @echo \#define UDEV_BIN                 \"$(DESTDIR)$(sbindir)/udev\" >> $@
        @echo \#define UDEVD_BIN                \"$(DESTDIR)$(sbindir)/udevd\" >> $@
 
-# config files automatically generated
-GEN_CONFIGS =  $(LOCAL_CFG_DIR)/udev.conf
-
 # Rules on how to create the generated config files
 $(LOCAL_CFG_DIR)/udev.conf:
-       sed -e "s:@udevdir@:$(udevdir):" < $(LOCAL_CFG_DIR)/udev.conf.in > $@
+       sed -e "s:@udevdir@:$(udevdir):" -e "s:@configdir@:$(configdir):" < $(LOCAL_CFG_DIR)/udev.conf.in > $@
 
 GEN_MANPAGES   = udev.8
 GEN_MANPAGESIN = udev.8.in
@@ -346,7 +354,7 @@ install-initscript: etc/init.d/udev etc/init.d/udev.debian etc/init.d/udev.init.
                $(INSTALL_DATA) -D etc/init.d/udev.debian $(DESTDIR)$(initdir)/udev; \
        fi
 
-install-config: $(GEN_CONFIGS)
+install-config:
        $(INSTALL) -d $(DESTDIR)$(configdir)/rules.d
        $(INSTALL) -d $(DESTDIR)$(configdir)/permissions.d
        @if [ ! -r $(DESTDIR)$(configdir)/udev.conf ]; then \