# 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
# add -Wredundant-decls when libsysfs gets cleaned up
WARNINGS := -Wall
-# Some nice architecture specific optimizations
-ifeq ($(strip $(TARGET_ARCH)),arm)
- OPTIMIZATION+=-fstrict-aliasing
-endif
-ifeq ($(strip $(TARGET_ARCH)),i386)
- OPTIMIZATION+=-march=i386
- OPTIMIZATION += ${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc \
- /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi}
- OPTIMIZATION += ${shell if $(CC) -malign-functions=0 -malign-jumps=0 -S -o /dev/null -xc \
- /dev/null >/dev/null 2>&1; then echo "-malign-functions=0 -malign-jumps=0"; fi}
- CFLAGS+=-pipe -Dasmlinkage=__attribute__((regparm(0)))
-else
- CFLAGS+=-pipe -Dasmlinkage=
+CFLAGS := -pipe -Dasmlinkage=
+
+# set up the proper tdb spinlock code if we can
+ifeq ($(strip $(ARCH)),i386)
+ CFLAGS += -DUSE_SPINLOCKS -DINTEL_SPINLOCKS
endif
ifeq ($(strip $(USE_LOG)),true)
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) \
udevdb.h \
klibc_fixups.h \
logging.h \
+ selinux.h \
list.h
ifeq ($(strip $(USE_KLIBC)),true)
@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
$(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 \
$(INSTALL_PROGRAM) -D $(WAIT) $(DESTDIR)$(sbindir)/$(WAIT)
- ln -f -s $(sbindir)/udev $(DESTDIR)$(sbindir)/$(STARTER)
- ln -f -s $(sbindir)/$(SENDER) $(DESTDIR)$(hotplugdir)/10-udev.hotplug
- - ln -f -s $(sbindir)/$(WAIT) $(DESTDIR)$(hotplugdir)/00-wait_for_sysfs.hotplug
+ - ln -f -s $(sbindir)/$(WAIT) $(DESTDIR)$(hotplugdir)/05-wait_for_sysfs.hotplug
ifndef DESTDIR
- killall udevd
- rm -f $(udevdir)/.udev.tdb
uninstall: uninstall-man uninstall-dev.d
- rm $(hotplugdir)/10-udev.hotplug
- - rm $(hotplugdir)/00-wait_for_sysfs.hotplug
+ - rm $(hotplugdir)/05-wait_for_sysfs.hotplug
- rm $(configdir)/rules.d/50-udev.rules
- rm $(configdir)/permissions.d/50-udev.permissions
- rm $(configdir)/udev.conf