X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=Makefile;h=bcaf30b706faf4cbca3c7c06a0881815dea84a30;hp=f3698329ef9e7d8751cd18d2527631d548be6756;hb=e07a3d79bad70ea132435c8a44737ac270b0f9e3;hpb=49fb51c6159db916f93c9439ef9b37ce6be90d02 diff --git a/Makefile b/Makefile index f3698329e..bcaf30b70 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ # 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 @@ -28,7 +28,6 @@ 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 @@ -51,8 +50,6 @@ PROGRAMS = \ udev \ udevd \ udevsend \ - udevrulescompile \ - udevinitsend \ udeveventrecorder \ udevcontrol \ udevmonitor \ @@ -126,9 +123,7 @@ udevdir = /dev 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} @@ -140,24 +135,26 @@ CROSS = 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 \ @@ -167,14 +164,10 @@ ifeq ($(strip $(USE_LOG)),true) 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) @@ -238,7 +231,9 @@ all: $(KLCC) $(PROGRAMS) $(MAN_PAGES) # "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): @@ -274,7 +269,6 @@ udev_version.h: @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 @@ -293,6 +287,7 @@ clean: - 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; \ @@ -303,8 +298,8 @@ clean: .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) @@ -379,7 +374,6 @@ uninstall-bin: - 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 @@ -412,7 +406,7 @@ buildtest: .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'"