chiark / gitweb /
make: do not delete autotools generated file with distclean
authorKay Sievers <kay.sievers@vrfy.org>
Sat, 6 Dec 2008 03:03:08 +0000 (04:03 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Sat, 6 Dec 2008 03:03:08 +0000 (04:03 +0100)
                                        [...] running the command
`make maintainer-clean' should not delete `configure' even if
`configure' can be remade using a rule in the Makefile.  More
generally, `make maintainer-clean' should not delete anything that
needs to exist in order to run `configure' and then begin to build
the program.  This is the only exception; `maintainer-clean' should
delete everything else that can be rebuilt.

18 files changed:
Makefile.am
autogen.sh
extras/Makefile.am
extras/ata_id/Makefile.am
extras/cdrom_id/Makefile.am
extras/collect/Makefile.am
extras/edd_id/Makefile.am
extras/firmware/Makefile.am
extras/floppy/Makefile.am
extras/fstab_import/Makefile.am
extras/path_id/Makefile.am
extras/rule_generator/Makefile.am
extras/scsi_id/Makefile.am
extras/usb_id/Makefile.am
extras/volume_id/Makefile.am
extras/volume_id/lib/Makefile.am
rules/Makefile.am
udev/Makefile.am

index 1d87bfd..55df27e 100644 (file)
@@ -14,15 +14,16 @@ EXTRA_DIST = \
        docs \
        autogen.sh
 
-PREVIOUS_VERSION = `expr $(VERSION) - 1`
+CLEANFILES = \
+       udev-$(VERSION).tar.gz udev-$(VERSION).tar.bz2
+
+clean-local:
+       rm -rf udev-test-install
 
 distclean-local:
-       rm -f *~
        rm -rf autom4te.cache
-       rm -f depcomp aclocal.m4 config.h.in configure install-sh
-       rm -f Makefile.in missing config.guess config.sub ltmain.sh
-       rm -rf udev-test-install
-       rm -f udev-$(VERSION).tar.gz udev-$(VERSION).tar.bz2
+
+PREVIOUS_VERSION = `expr $(VERSION) - 1`
 
 changelog:
        @ head -1 ChangeLog | grep -q "to v$(PREVIOUS_VERSION)"
index ef3f579..926ca7e 100755 (executable)
@@ -47,18 +47,34 @@ CFLAGS="-g -Wall \
 -Wpointer-arith -Wsign-compare -Wchar-subscripts \
 -Wstrict-prototypes -Wshadow"
 
-if test -z "$1" -o "$1" = "install"; then
-       args="--prefix=/usr --exec-prefix= --sysconfdir=/etc --with-selinux"
-       args="$args --with-libdir-name=lib/$(gcc -print-multi-os-directory)"
-       CFLAGS="$CFLAGS -O2"
-elif test "$1" = "devel" ; then
-       args="--prefix=/usr --exec-prefix= --sysconfdir=/etc --with-selinux --enable-debug"
-       args="$args --with-libdir-name=lib/$(gcc -print-multi-os-directory)"
-       CFLAGS="$CFLAGS -O0"
-else
-       args=$@
-fi
-echo "   configure:  $args"
-echo
-export CFLAGS
-./configure $args
+args="--prefix=/usr --exec-prefix= --sysconfdir=/etc --with-selinux"
+libdir=$(basename $(cd /lib/$(gcc -print-multi-os-directory); pwd))
+
+case "$1" in
+       *install|"")
+               args="$args --with-libdir-name=$libdir"
+               export CFLAGS="$CFLAGS -O2"
+               echo "   configure:  $args"
+               echo
+               ./configure $args
+               ;;
+       *devel)
+               args="$args --enable-debug --with-libdir-name=$libdir"
+               export CFLAGS="$CFLAGS -O0"
+               echo "   configure:  $args"
+               echo
+               ./configure $args
+               ;;
+       *clean)
+               ./configure
+               make maintainer-clean
+               find . -name Makefile.in | xargs -r rm
+               rm -f depcomp aclocal.m4 config.h.in configure install-sh
+               rm -f missing config.guess config.sub ltmain.sh
+               exit 0
+               ;;
+       *)
+               echo "Usage: $0 [--install|--devel|--clean]"
+               exit 1
+               ;;
+esac
index 30e6e95..fc46668 100644 (file)
@@ -13,6 +13,3 @@ SUBDIRS = \
        scsi_id \
        usb_id \
        volume_id
-
-distclean-local:
-       rm -f Makefile.in
index 47ab0d6..d31fd2c 100644 (file)
@@ -13,6 +13,3 @@ ata_id_SOURCES = \
 
 dist_man_MANS = \
        ata_id.8
-
-distclean-local:
-       rm -f Makefile.in
index bb97d96..51b6a20 100644 (file)
@@ -17,6 +17,3 @@ cdrom_id_SOURCES = \
 
 dist_man_MANS = \
        cdrom_id.8
-
-distclean-local:
-       rm -f Makefile.in
index 895f1b7..d9792b8 100644 (file)
@@ -10,7 +10,3 @@ collect_SOURCES = \
        ../../udev/lib/libudev.c \
        ../../udev/lib/libudev-util.c \
        ../../udev/lib/libudev-list.c
-
-distclean-local:
-       rm -f Makefile.in
-
index 28ff8aa..9bfe432 100644 (file)
@@ -17,6 +17,3 @@ edd_id_SOURCES = \
 
 dist_man_MANS = \
        edd_id.8
-
-distclean-local:
-       rm -f Makefile.in
index 78b28f6..4d1b195 100644 (file)
@@ -4,6 +4,3 @@ udevhomedir = $(udev_prefix)/lib/udev
 dist_udevhome_SCRIPTS = \
        firmware.sh
 
-distclean-local:
-       rm -f Makefile.in
-
index 8dadefa..8cb9cbd 100644 (file)
@@ -23,6 +23,3 @@ endif
 
 dist_man_MANS = \
        create_floppy_devices.8
-
-distclean-local:
-       rm -f Makefile.in
index d16c681..c63dc7c 100644 (file)
@@ -15,6 +15,3 @@ fstab_import_SOURCES = \
        ../../udev/lib/libudev-list.c \
        ../../udev/lib/libudev-util.c
 
-distclean-local:
-       rm -f Makefile.in
-
index b85b747..f489290 100644 (file)
@@ -6,7 +6,3 @@ dist_udevhome_SCRIPTS = \
 
 dist_man_MANS = \
        path_id.8
-
-distclean-local:
-       rm -f Makefile.in
-
index 8981912..e8a8f17 100644 (file)
@@ -13,6 +13,3 @@ dist_udevrules_DATA = \
        75-cd-aliases-generator.rules \
        75-persistent-net-generator.rules
 
-distclean-local:
-       rm -f Makefile.in
-
index 08da1c9..29d5fe7 100644 (file)
@@ -21,6 +21,3 @@ dist_sysconf_DATA = \
 dist_man_MANS = \
        scsi_id.8
 
-distclean-local:
-       rm -f Makefile.in
-
index c54d83e..dfb52f1 100644 (file)
@@ -12,6 +12,3 @@ usb_id_SOURCES = \
        ../../udev/lib/libudev-util.c \
        ../../udev/lib/libudev-device.c \
        ../../udev/lib/libudev-enumerate.c
-
-distclean-local:
-       rm -f Makefile.in
index c58f1a8..4a8ba94 100644 (file)
@@ -26,7 +26,6 @@ EXTRA_DIST = \
 %.7 %.8 : %.xml
        $(XSLTPROC) -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
 
-distclean-local:
-       rm -f Makefile.in
-       rm -f $(dist_man_MANS)
+MAINTAINERCLEANFILES= \
+       $(dist_man_MANS)
 
index 678e44e..d5fd656 100644 (file)
@@ -72,6 +72,3 @@ EXTRA_DIST = \
 
 pkgconfigdir = $(prefix)/$(libdir_name)/pkgconfig
 pkgconfig_DATA = libvolume_id.pc
-
-distclean-local:
-       rm -f Makefile.in
index d6cefe3..7f3cd59 100644 (file)
@@ -19,7 +19,3 @@ EXTRA_DIST = \
        redhat \
        suse \
        gentoo
-
-
-distclean-local:
-       rm -f Makefile.in
index c374942..2d185f4 100644 (file)
@@ -81,6 +81,8 @@ EXTRA_DIST = \
 %.7 %.8 : %.xml
        $(XSLTPROC) -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
 
-distclean-local:
+MAINTAINERCLEANFILES = \
+       $(dist_man_MANS)
+
+git-clean:
        rm -f Makefile.in
-       rm -f $(dist_man_MANS)