# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-VERSION = 071
+VERSION = 073
# set this to make use of syslog
USE_LOG = true
DEBUG = false
# compile with gcc's code coverage option
-# (use it with DEBUG, works only with glibc)
USE_GCOV = false
# include Security-Enhanced Linux support
udev \
udevd \
udevsend \
- udevrulescompile \
- udevinitsend \
udeveventrecorder \
udevcontrol \
udevmonitor \
udevdb = ${udevdir}/.udevdb
LOCAL_CFG_DIR = etc/udev
KERNEL_DIR = /lib/modules/${shell uname -r}/build
-srcdir = .
DESTDIR =
-RELEASE_NAME = udev-$(VERSION)
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
CC = $(CROSS)gcc
LD = $(CROSS)gcc
AR = $(CROSS)ar
-STRIP = $(CROSS)strip
RANLIB = $(CROSS)ranlib
HOSTCC = gcc
+STRIP = $(CROSS)strip
+STRIPCMD = $(STRIP) -s
# check if compiler option is supported
cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;}
-CFLAGS += -g -Wall -pipe -fno-builtin -Wstrict-prototypes -Wsign-compare \
- -Wchar-subscripts -Wmissing-declarations -Wnested-externs \
- -Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes \
- -Wshadow
-CFLAGS += $(call cc-supports, -Wdeclaration-after-statement, )
-CFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
+CFLAGS = -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
+WARNINGS = -Wstrict-prototypes -Wsign-compare -Wshadow \
+ -Wchar-subscripts -Wmissing-declarations -Wnested-externs \
+ -Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes
+WARNINGS += $(call cc-supports, -Wdeclaration-after-statement, )
+CFLAGS += $(WARNINGS)
LDFLAGS = -Wl,-warn-common
-# use '-Os' optimization if available, else use -O2
+# use -Os optimization if available, else use -O2
OPTFLAGS := $(call cc-supports, -Os, -O2)
+CFLAGS += $(OPTFLAGS)
# include our local copy of libsysfs
CFLAGS += -I$(PWD)/libsysfs/sysfs \
CFLAGS += -DUSE_LOG
endif
-# if DEBUG is enabled, then we do not strip or optimize
+# if DEBUG is enabled, then we do not strip
ifeq ($(strip $(DEBUG)),true)
CFLAGS += -DDEBUG
- STRIPCMD = /bin/true -Since_we_are_debugging
-else
- CFLAGS += $(OPTFLAGS) -fomit-frame-pointer
- LDFLAGS += -s -Wl
- STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
+ STRIPCMD =
endif
ifeq ($(strip $(USE_GCOV)),true)
# "Static Pattern Rule" to build all programs
$(PROGRAMS): %: $(HOST_PROGS) $(KLCC) $(HEADERS) $(GEN_HEADERS) $(LIBSYSFS) $(LIBUDEV) %.o
$(QUIET) $(LD) $(LDFLAGS) $@.o -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS)
+ifneq ($(STRIPCMD),)
$(QUIET) $(STRIPCMD) $@
+endif
# our own copy of klibc, it is not used if KLCC is given
$(KLCC):
@echo \#define UDEV_CONFIG_DIR \"$(configdir)\" >> $@
@echo \#define UDEV_CONFIG_FILE \"$(configdir)/udev.conf\" >> $@
@echo \#define UDEV_RULES_FILE \"$(configdir)/rules.d\" >> $@
- @echo \#define UDEV_BIN \"$(sbindir)/udev\" >> $@
@echo \#define UDEVD_BIN \"$(sbindir)/udevd\" >> $@
# man pages
- find -name "*.gcov" -print0 | xargs -0rt rm -f
- rm -f udev_gcov.txt
- rm -f core $(PROGRAMS) $(GEN_HEADERS) $(GEN_CONFIGS)
+ - rm -f udev-$(VERSION).tar.gz
$(MAKE) -C klibc SUBDIRS=klibc clean
@extras="$(EXTRAS)"; for target in $$extras; do \
echo $$target; \
.PHONY: clean
release:
- git-tar-tree HEAD $(RELEASE_NAME) | gzip -9v > $(RELEASE_NAME).tar.gz
- @echo "$(RELEASE_NAME).tar.gz created"
+ git-tar-tree HEAD udev-$(VERSION) | gzip -9v > udev-$(VERSION).tar.gz
+ @echo "udev-$(VERSION).tar.gz created"
.PHONY: release
install-config: $(GEN_CONFIGS)
- rm -f $(DESTDIR)$(sbindir)/udev
- rm -f $(DESTDIR)$(sbindir)/udevd
- rm -f $(DESTDIR)$(sbindir)/udevsend
- - rm -f $(DESTDIR)$(sbindir)/udevinitsend
- rm -f $(DESTDIR)$(sbindir)/udeveventrecoreder
- rm -f $(DESTDIR)$(sbindir)/udevcontrol
- rm -f $(DESTDIR)$(sbindir)/udevstart
.PHONY: buildtest
gcov-all:
- $(MAKE) clean all DEBUG=true USE_GCOV=true
+ $(MAKE) clean all STRIPCMD= USE_GCOV=true
@echo
@echo "binaries built with gcov support."
@echo "run the tests and analyze with 'make udev_gcov.txt'"