From 5d89ef7bf94d8a708a1159be22eb1cf458a1d101 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 6 Dec 2008 04:03:08 +0100 Subject: [PATCH] make: do not delete autotools generated file with distclean [...] 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. --- Makefile.am | 13 +++++---- autogen.sh | 46 +++++++++++++++++++++---------- extras/Makefile.am | 3 -- extras/ata_id/Makefile.am | 3 -- extras/cdrom_id/Makefile.am | 3 -- extras/collect/Makefile.am | 4 --- extras/edd_id/Makefile.am | 3 -- extras/firmware/Makefile.am | 3 -- extras/floppy/Makefile.am | 3 -- extras/fstab_import/Makefile.am | 3 -- extras/path_id/Makefile.am | 4 --- extras/rule_generator/Makefile.am | 3 -- extras/scsi_id/Makefile.am | 3 -- extras/usb_id/Makefile.am | 3 -- extras/volume_id/Makefile.am | 5 ++-- extras/volume_id/lib/Makefile.am | 3 -- rules/Makefile.am | 4 --- udev/Makefile.am | 6 ++-- 18 files changed, 44 insertions(+), 71 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1d87bfd1..55df27e2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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)" diff --git a/autogen.sh b/autogen.sh index ef3f579c..926ca7ec 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 diff --git a/extras/Makefile.am b/extras/Makefile.am index 30e6e95d..fc46668f 100644 --- a/extras/Makefile.am +++ b/extras/Makefile.am @@ -13,6 +13,3 @@ SUBDIRS = \ scsi_id \ usb_id \ volume_id - -distclean-local: - rm -f Makefile.in diff --git a/extras/ata_id/Makefile.am b/extras/ata_id/Makefile.am index 47ab0d66..d31fd2c9 100644 --- a/extras/ata_id/Makefile.am +++ b/extras/ata_id/Makefile.am @@ -13,6 +13,3 @@ ata_id_SOURCES = \ dist_man_MANS = \ ata_id.8 - -distclean-local: - rm -f Makefile.in diff --git a/extras/cdrom_id/Makefile.am b/extras/cdrom_id/Makefile.am index bb97d96d..51b6a20e 100644 --- a/extras/cdrom_id/Makefile.am +++ b/extras/cdrom_id/Makefile.am @@ -17,6 +17,3 @@ cdrom_id_SOURCES = \ dist_man_MANS = \ cdrom_id.8 - -distclean-local: - rm -f Makefile.in diff --git a/extras/collect/Makefile.am b/extras/collect/Makefile.am index 895f1b7f..d9792b89 100644 --- a/extras/collect/Makefile.am +++ b/extras/collect/Makefile.am @@ -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 - diff --git a/extras/edd_id/Makefile.am b/extras/edd_id/Makefile.am index 28ff8aa4..9bfe4323 100644 --- a/extras/edd_id/Makefile.am +++ b/extras/edd_id/Makefile.am @@ -17,6 +17,3 @@ edd_id_SOURCES = \ dist_man_MANS = \ edd_id.8 - -distclean-local: - rm -f Makefile.in diff --git a/extras/firmware/Makefile.am b/extras/firmware/Makefile.am index 78b28f61..4d1b1952 100644 --- a/extras/firmware/Makefile.am +++ b/extras/firmware/Makefile.am @@ -4,6 +4,3 @@ udevhomedir = $(udev_prefix)/lib/udev dist_udevhome_SCRIPTS = \ firmware.sh -distclean-local: - rm -f Makefile.in - diff --git a/extras/floppy/Makefile.am b/extras/floppy/Makefile.am index 8dadefa0..8cb9cbd4 100644 --- a/extras/floppy/Makefile.am +++ b/extras/floppy/Makefile.am @@ -23,6 +23,3 @@ endif dist_man_MANS = \ create_floppy_devices.8 - -distclean-local: - rm -f Makefile.in diff --git a/extras/fstab_import/Makefile.am b/extras/fstab_import/Makefile.am index d16c681a..c63dc7cf 100644 --- a/extras/fstab_import/Makefile.am +++ b/extras/fstab_import/Makefile.am @@ -15,6 +15,3 @@ fstab_import_SOURCES = \ ../../udev/lib/libudev-list.c \ ../../udev/lib/libudev-util.c -distclean-local: - rm -f Makefile.in - diff --git a/extras/path_id/Makefile.am b/extras/path_id/Makefile.am index b85b7473..f4892903 100644 --- a/extras/path_id/Makefile.am +++ b/extras/path_id/Makefile.am @@ -6,7 +6,3 @@ dist_udevhome_SCRIPTS = \ dist_man_MANS = \ path_id.8 - -distclean-local: - rm -f Makefile.in - diff --git a/extras/rule_generator/Makefile.am b/extras/rule_generator/Makefile.am index 89819128..e8a8f17e 100644 --- a/extras/rule_generator/Makefile.am +++ b/extras/rule_generator/Makefile.am @@ -13,6 +13,3 @@ dist_udevrules_DATA = \ 75-cd-aliases-generator.rules \ 75-persistent-net-generator.rules -distclean-local: - rm -f Makefile.in - diff --git a/extras/scsi_id/Makefile.am b/extras/scsi_id/Makefile.am index 08da1c9d..29d5fe73 100644 --- a/extras/scsi_id/Makefile.am +++ b/extras/scsi_id/Makefile.am @@ -21,6 +21,3 @@ dist_sysconf_DATA = \ dist_man_MANS = \ scsi_id.8 -distclean-local: - rm -f Makefile.in - diff --git a/extras/usb_id/Makefile.am b/extras/usb_id/Makefile.am index c54d83e0..dfb52f17 100644 --- a/extras/usb_id/Makefile.am +++ b/extras/usb_id/Makefile.am @@ -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 diff --git a/extras/volume_id/Makefile.am b/extras/volume_id/Makefile.am index c58f1a87..4a8ba946 100644 --- a/extras/volume_id/Makefile.am +++ b/extras/volume_id/Makefile.am @@ -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) diff --git a/extras/volume_id/lib/Makefile.am b/extras/volume_id/lib/Makefile.am index 678e44ec..d5fd6560 100644 --- a/extras/volume_id/lib/Makefile.am +++ b/extras/volume_id/lib/Makefile.am @@ -72,6 +72,3 @@ EXTRA_DIST = \ pkgconfigdir = $(prefix)/$(libdir_name)/pkgconfig pkgconfig_DATA = libvolume_id.pc - -distclean-local: - rm -f Makefile.in diff --git a/rules/Makefile.am b/rules/Makefile.am index d6cefe3c..7f3cd598 100644 --- a/rules/Makefile.am +++ b/rules/Makefile.am @@ -19,7 +19,3 @@ EXTRA_DIST = \ redhat \ suse \ gentoo - - -distclean-local: - rm -f Makefile.in diff --git a/udev/Makefile.am b/udev/Makefile.am index c374942c..2d185f47 100644 --- a/udev/Makefile.am +++ b/udev/Makefile.am @@ -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) -- 2.39.5