build: Rename clean targets.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 12 Jul 2016 19:56:13 +0000 (21:56 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 8 Jan 2017 12:52:54 +0000 (13:52 +0100)
The documentation of gnu make recommends to have targets called
mostlyclean, clean, distclean and maintainer-clean while we have clean,
clean2, distclean and maintainer clean.

This patch adds mostlyclean and removes clean2. The former target
removes the executables and all object files, clean additionally
removes the whole build directory and distclean removes, on top of
that, all files created by autoconf. Finally, maintainer-clean removes
the tarball and the files created by doxygen and global.

Makefile.real
autogen.sh

index 8ededf6aff8300608a5939429779ecd7b1753626..c4539860a36eb5004c2f471e5bbca0c76bed2674 100644 (file)
@@ -63,7 +63,7 @@ tarball_pfx := $(PACKAGE_TARNAME)-$(GIT_VERSION)
 tarball_delete := $(addprefix $(tarball_pfx)/, web .gitignore)
 tarball := $(tarball_pfx).tar.bz2
 
 tarball_delete := $(addprefix $(tarball_pfx)/, web .gitignore)
 tarball := $(tarball_pfx).tar.bz2
 
-.PHONY: all clean clean2 distclean maintainer-clean install man tarball
+.PHONY: all mostlyclean clean distclean maintainer-clean install man tarball
 all: $(prefixed_executables) $(man_pages)
 man: $(man_pages)
 tarball: $(tarball)
 all: $(prefixed_executables) $(man_pages)
 man: $(man_pages)
 tarball: $(tarball)
@@ -337,22 +337,21 @@ $(prefixed_executables):
        @[ -z "$(Q)" ] || echo 'LD $@'
        $(Q) $(CC) $^ -o $@ $(LDFLAGS)
 
        @[ -z "$(Q)" ] || echo 'LD $@'
        $(Q) $(CC) $^ -o $@ $(LDFLAGS)
 
-clean:
-       @[ -z "$(Q)" ] || echo 'CLEAN'
+mostlyclean:
+       @[ -z "$(Q)" ] || echo 'MOSTLYCLEAN'
        $(Q) rm -f para_*
        $(Q) rm -rf $(object_dir)
        $(Q) rm -f para_*
        $(Q) rm -rf $(object_dir)
-
-clean2: clean
-       @[ -z "$(Q)" ] || echo 'CLEAN2'
+clean: mostlyclean
+       @[ -z "$(Q)" ] || echo 'CLEAN'
        $(Q) rm -rf $(build_dir)
        $(Q) rm -rf $(build_dir)
-distclean: clean2 test-clean
+distclean: clean
        @[ -z "$(Q)" ] || echo 'DISTCLEAN'
        $(Q) rm -f Makefile autoscan.log config.status config.log
        @[ -z "$(Q)" ] || echo 'DISTCLEAN'
        $(Q) rm -f Makefile autoscan.log config.status config.log
-       $(Q) rm -f GPATH GRTAGS GSYMS GTAGS
-
+       $(Q) rm -f config.h configure config.h.in
 maintainer-clean: distclean
        @[ -z "$(Q)" ] || echo 'MAINTAINER-CLEAN'
 maintainer-clean: distclean
        @[ -z "$(Q)" ] || echo 'MAINTAINER-CLEAN'
-       $(Q) rm -f *.tar.bz2 config.h configure config.h.in
+       $(Q) rm -f *.tar.bz2
+       $(Q) rm -f GPATH GRTAGS GSYMS GTAGS
 
 install: all man
        $(MKDIR_P) $(bindir) $(mandir)
 
 install: all man
        $(MKDIR_P) $(bindir) $(mandir)
index d432adbb64aa08a74e4dab7bd21360ebb2ef4227..708602e7e04c073ff510be8584235fe198ac128e 100755 (executable)
@@ -24,5 +24,5 @@ autoheader
 echo configuring...
 ./configure $@ > /dev/null
 echo compiling...
 echo configuring...
 ./configure $@ > /dev/null
 echo compiling...
-make clean2 > /dev/null 2>&1
+make clean > /dev/null 2>&1
 make -j $n > /dev/null
 make -j $n > /dev/null