X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=Makefile;h=8e29f24e70252584ac073928b6941398a2665d47;hp=baecda66f32d933292d3cc8db5ed3cb7632133a4;hb=319112e295bbf1ed5d86389190abbe24ce251b14;hpb=57e1a2770c4d85edd377488906c437f6d1e9b369 diff --git a/Makefile b/Makefile index baecda66f..8e29f24e7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ # Makefile for udev # # Copyright (C) 2003,2004 Greg Kroah-Hartman +# Copyright (C) 2004-2005 Kay Sievers # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,18 +17,28 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Set the following to control the use of syslog -# Set it to `false' to remove all logging +# Set this to make use of syslog USE_LOG = true -# Set the following to `true' to log the debug -# and make a unstripped, unoptimized binary. -# Leave this set to `false' for production use. +# Set this to ad development debug messages DEBUG = false -# Set this to compile with Security-Enhanced Linux support. +# Set this to include Security-Enhanced Linux support. USE_SELINUX = false +# Set this to comile with the local version of klibc instead of glibc. +USE_KLIBC = false + +# Set this to create statically linked binaries. +USE_STATIC = false + +# To build any of the extras programs, run with: +# make EXTRAS="extras/a extras/b" +EXTRAS= + +# make the build silent. Set this to something else to make it noisy again. +V=false + ROOT = udev DAEMON = udevd SENDER = udevsend @@ -39,9 +50,7 @@ INSTALL_DIR = /usr/local/bin RELEASE_NAME = $(ROOT)-$(VERSION) LOCAL_CFG_DIR = etc/udev HOTPLUG_EXEC = $(ROOT) - DESTDIR = - KERNEL_DIR = /lib/modules/${shell uname -r}/build # override this to make udev look in a different location for it's config files @@ -62,22 +71,10 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} -# To build any of the extras programs, run with: -# make EXTRAS="extras/a extras/b" -EXTRAS= - # place to put our device nodes udevdir = ${prefix}/udev udevdb = ${udevdir}/.udevdb -# Comment out this line to build with something other -# than the local version of klibc -#USE_KLIBC = true - -# make the build silent (well, at least the udev part) Set this -# to something else to make it noisy again. -V=false - # set up PWD so that older versions of make will work with our build. PWD = $(shell pwd) @@ -142,7 +139,6 @@ UDEV_OBJS = \ udev_config.o \ udev_add.o \ udev_remove.o \ - udev_start.o \ udev_sysfs.o \ udev_db.o \ udev_multiplex.o \ @@ -160,7 +156,7 @@ CFLAGS += -I$(PWD)/libsysfs/sysfs \ -I$(PWD)/libsysfs ifeq ($(strip $(USE_LOG)),true) - CFLAGS += -DLOG + CFLAGS += -DUSE_LOG endif # if DEBUG is enabled, then we do not strip or optimize @@ -182,10 +178,7 @@ ifeq ($(strip $(USE_KLIBC)),true) INCLUDE_DIR := $(KLIBC_BASE)/include LINUX_INCLUDE_DIR := $(KERNEL_DIR)/include include $(KLIBC_DIR)/arch/$(ARCH)/MCONFIG - # arch specific objects ARCH_LIB_OBJS = $(KLIBC_DIR)/libc.a - - CRT0 = $(KLIBC_DIR)/crt0.o LIBC = $(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0) CFLAGS += $(WARNINGS) -nostdinc \ @@ -197,8 +190,7 @@ ifeq ($(strip $(USE_KLIBC)),true) -I$(GCCINCDIR) \ -I$(LINUX_INCLUDE_DIR) LIB_OBJS = - LDFLAGS = --static --nostdlib -nostartfiles -nodefaultlibs - + LDFLAGS = -static -nostdlib -nostartfiles -nodefaultlibs else WARNINGS += -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations CRT0 = @@ -213,6 +205,11 @@ ifeq ($(strip $(USE_SELINUX)),true) CFLAGS += -DUSE_SELINUX endif +ifeq ($(strip $(USE_STATIC)),true) + CFLAGS += -DUSE_STATIC + LDFLAGS += -static +endif + ifeq ($(strip $(V)),false) QUIET=@$(PWD)/ccdv HOST_PROGS=ccdv @@ -224,7 +221,7 @@ endif # config files automatically generated GEN_CONFIGS = $(LOCAL_CFG_DIR)/udev.conf -all: $(ROOT) $(SENDER) $(DAEMON) $(INFO) $(TESTER) $(GEN_CONFIGS) +all: $(ROOT) $(SENDER) $(DAEMON) $(INFO) $(TESTER) $(STARTER) $(GEN_CONFIGS) @extras="$(EXTRAS)" ; for target in $$extras ; do \ echo $$target ; \ $(MAKE) prefix=$(prefix) \ @@ -313,6 +310,10 @@ $(SENDER): $(LIBC) $(SENDER).o $(OBJS) udevd.h $(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) $(SENDER).o $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS) $(QUIET) $(STRIPCMD) $@ +$(STARTER): $(LIBC) $(STARTER).o $(OBJS) + $(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) $(STARTER).o $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS) + $(QUIET) $(STRIPCMD) $@ + .c.o: $(QUIET) $(CC) $(CFLAGS) -c -o $@ $< @@ -320,7 +321,8 @@ $(SENDER): $(LIBC) $(SENDER).o $(OBJS) udevd.h clean: -find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \ | xargs rm -f - -rm -f core $(ROOT) $(GEN_HEADERS) $(GEN_CONFIGS) $(GEN_MANPAGES) $(INFO) $(DAEMON) $(SENDER) $(TESTER) + -rm -f core $(ROOT) $(GEN_HEADERS) $(GEN_CONFIGS) $(GEN_MANPAGES) $(INFO) $(DAEMON) \ + $(SENDER) $(TESTER) $(STARTER) -rm -f ccdv $(MAKE) -C klibc SUBDIRS=klibc clean @extras="$(EXTRAS)" ; for target in $$extras ; do \ @@ -407,7 +409,7 @@ install: install-config install-man install-dev.d all $(INSTALL_PROGRAM) -D $(SENDER) $(DESTDIR)$(sbindir)/$(SENDER) $(INSTALL_PROGRAM) -D $(INFO) $(DESTDIR)$(usrbindir)/$(INFO) $(INSTALL_PROGRAM) -D $(TESTER) $(DESTDIR)$(usrbindir)/$(TESTER) - - ln -f -s $(sbindir)/udev $(DESTDIR)$(sbindir)/$(STARTER) + $(INSTALL_PROGRAM) -D $(STARTER) $(DESTDIR)$(sbindir)/$(STARTER) - ln -f -s $(sbindir)/$(SENDER) $(DESTDIR)$(hotplugdir)/10-udev.hotplug ifndef DESTDIR - killall $(DAEMON)