chiark / gitweb /
allow C99 statements
[elogind.git] / Makefile
index 4968df42616b6cdffe8b416d4f8dfe0f7f4a9f8f..774d5e154a9cdf2a11268c2dca8f9655de3c4cd1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
 
-VERSION = 075
+VERSION = 077
 
 # set this to make use of syslog
 USE_LOG = true
@@ -106,13 +106,12 @@ GEN_CONFIGS = \
 GEN_HEADERS = \
        udev_version.h
 
-# override this to make udev look in a different location for it's config files
 prefix =
-exec_prefix =  ${prefix}
 etcdir =       ${prefix}/etc
-sbindir =      ${exec_prefix}/sbin
-usrbindir =    ${exec_prefix}/usr/bin
-usrsbindir =   ${exec_prefix}/usr/sbin
+sbindir =      ${prefix}/sbin
+usrbindir =    ${prefix}/usr/bin
+usrsbindir =   ${prefix}/usr/sbin
+libudevdir =   ${prefix}/lib/udev
 mandir =       ${prefix}/usr/share/man
 configdir =    ${etcdir}/udev
 udevdir =      /dev
@@ -134,20 +133,15 @@ 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 -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
-OPTFLAGS := $(call cc-supports, -Os, -O2)
+OPTFLAGS = -Os
 CFLAGS += $(OPTFLAGS)
 
 # include our local copy of libsysfs
@@ -208,7 +202,7 @@ all: $(PROGRAMS) $(MAN_PAGES)
                        LIBUDEV="$(PWD)/$(LIBUDEV)" \
                        LIBSYSFS="$(PWD)/$(LIBSYSFS)" \
                        QUIET="$(QUIET)" \
-                       -C $$target $@; \
+                       -C $$target $@ || exit 1; \
        done;
 .PHONY: all
 .DEFAULT: all
@@ -248,10 +242,8 @@ udev_version.h:
        @echo "Creating udev_version.h"
        @echo \#define UDEV_VERSION             \"$(VERSION)\" > $@
        @echo \#define UDEV_ROOT                \"$(udevdir)\" >> $@
-       @echo \#define UDEV_CONFIG_DIR          \"$(configdir)\" >> $@
        @echo \#define UDEV_CONFIG_FILE         \"$(configdir)/udev.conf\" >> $@
        @echo \#define UDEV_RULES_FILE          \"$(configdir)/rules.d\" >> $@
-       @echo \#define UDEVD_BIN                \"$(sbindir)/udevd\" >> $@
 
 # man pages
 %.8: docs/%.xml
@@ -272,7 +264,7 @@ clean:
        - rm -f udev-$(VERSION).tar.gz
        @extras="$(EXTRAS)"; for target in $$extras; do \
                echo $$target; \
-               $(MAKE) -C $$target $@; \
+               $(MAKE) -C $$target $@ || exit 1; \
        done;
 .PHONY: clean
 
@@ -294,7 +286,7 @@ install-config: $(GEN_CONFIGS)
        fi
        @extras="$(EXTRAS)"; for target in $$extras; do \
                echo $$target; \
-               $(MAKE) -C $$target $@; \
+               $(MAKE) -C $$target $@ || exit 1; \
        done;
 .PHONY: install-config
 
@@ -309,7 +301,7 @@ install-man:
        - ln -f -s udevd.8 $(DESTDIR)$(mandir)/man8/udevcontrol.8
        @extras="$(EXTRAS)"; for target in $$extras; do \
                echo $$target; \
-               $(MAKE) -C $$target $@; \
+               $(MAKE) -C $$target $@ || exit 1; \
        done;
 .PHONY: install-man
 
@@ -324,7 +316,7 @@ uninstall-man:
        - rm -f $(DESTDIR)$(mandir)/man8/udevcontrol.8
        @extras="$(EXTRAS)"; for target in $$extras; do \
                echo $$target; \
-               $(MAKE) -C $$target $@; \
+               $(MAKE) -C $$target $@ || exit 1; \
        done;
 .PHONY: uninstall-man
 
@@ -340,7 +332,7 @@ install-bin:
        $(INSTALL_PROGRAM) -D udevstart $(DESTDIR)$(sbindir)/udevstart
        @extras="$(EXTRAS)"; for target in $$extras; do \
                echo $$target; \
-               $(MAKE) -C $$target $@; \
+               $(MAKE) -C $$target $@ || exit 1; \
        done;
 ifndef DESTDIR
        - killall udevd
@@ -364,7 +356,7 @@ ifndef DESTDIR
 endif
        @extras="$(EXTRAS)"; for target in $$extras; do \
                echo $$target; \
-               $(MAKE) -C $$target $@; \
+               $(MAKE) -C $$target $@ || exit 1; \
        done;
 .PHONY: uninstall-bin
 
@@ -380,9 +372,20 @@ test tests: all
 .PHONY: test tests
 
 buildtest:
-       ./test/simple-build-check.sh
+       test/simple-build-check.sh
 .PHONY: buildtest
 
+ChangeLog: Makefile
+       @ mv $@ $@.tmp
+       @ echo "Summary of changes from v$(shell printf '%03i' $$(expr $(VERSION) - 1)) to v$(VERSION)" >> $@
+       @ echo "============================================" >> $@
+       @ echo >> $@
+       @ git log --pretty=short $(shell printf '%03i' $$(expr $(VERSION) - 1))..HEAD | git shortlog  >> $@
+       @ echo >> $@
+       @ cat $@
+       @ cat $@.tmp >> $@
+       @ rm $@.tmp
+
 gcov-all:
        $(MAKE) clean all STRIPCMD= USE_GCOV=true
        @echo