Re: [preview-latex-devel] CVS-1.227; aclocal.m4 and lib/Makefile deleted by make distclean

Ralf Angeli <[email protected]> Sat, 12 Feb 2005 20:59:46 +0100
Newsgroups gmane.emacs.auc-tex,gmane.emacs.latex.preview.devel
Message-ID <[email protected]>
[Moving this discussion over to preview-latex-devel and auc-tex
mailing lists as this now is more a development question concerning
both packages.]

* David Kastrup (2005-02-12) writes:

> Ralf Angeli <[email protected]> writes:
>
>> * David Kastrup (2005-02-12) writes:
>>
>>> Ralf Angeli <[email protected]> writes:
>>>
>>>> ,----[ <URL:http://www.gnu.org/prep/standards/html_node/Standard-Targets.html> ]
[...]
>>>> That means deleting these files doesn't seem correct.
>>>
>>> It does not say so very explicitly.  distclean is, as it is worded
>>> intended to turn a fresh tarball into a fresh tarball.  So it would
>>> appear appropriate if it did not touch CVS-only files.  However, I
>>> think that it would be ok if it deleted backup files in general that
>>> strictly speaking would come about from editing sources, not
>>> compiling.
>>
>> I don't consider this a good idea.  For example with AUCTeX I often do
>> a `make distclean' when aclocal.m4 or configure.in was changed.  I
>> wouldn't wanna let this delete my backup files.  Besides, it would
>> violate the guideline cited above as the files are not generated by
>> configuring or building.
>>
>> Out of curiosity I looked at the Makefiles of autoconf and Emacs.  The
>> former does nothing about them and the latter has an extra target
>> `extraclean' for that purpose.
>
> Ok, do what you consider correct.  I actually almost never make clean,
> anyhow...

Attached is a proposal for AUCTeX's Makefile.in.  Maybe something like
this would be feasible for preview-latex as well.  I still have to
figure out what to do with files like INSTALL, TODO etc. but the
scheme should be visible already.

-- 
Ralf
(unnamed) (text/x-patch, 1.6 KB)
Index: Makefile.in
===================================================================
RCS file: /cvsroot/auctex/auctex/Makefile.in,v
retrieving revision 1.79
diff -u -r1.79 Makefile.in
--- Makefile.in	10 Feb 2005 23:51:16 -0000	1.79
+++ Makefile.in	12 Feb 2005 19:53:10 -0000
@@ -44,11 +44,7 @@
 	texmathp.el multi-prompt.el tex-mik.el font-latex.el tex-font.el \
 	context.el context-en.el context-nl.el tex-fold.el \
 	toolbar-x.el tex-bar.el
-AUCELC = tex.elc tex-buf.elc latex.elc tex-info.elc \
-	texmathp.elc multi-prompt.elc tex-mik.elc font-latex.elc tex-font.elc \
-	context.elc context-en.elc context-nl.elc tex-fold.elc \
-	toolbar-x.elc tex-bar.elc
-# Why not $(AUCSRC:.el=.elc) ?
+AUCELC = $(AUCSRC:.el=.elc)
 
 STYLESRC = style/prosper.el \
 	   style/slides.el    style/foils.el     style/amstex.el \
@@ -86,6 +82,10 @@
 	configure install-sh $(MKINSTALLDIRS) Makefile.in \
 	tex-site.el.in lpath.el $(CONTRIB) $(CONTRIB_MULE)
 
+CLEANFILES = $(AUCSRC:.el=.elc) $(STYLESRC:.el=.elc)
+
+DISTCLEANFILES = Makefile tex-site.el config.*
+
 NOSEARCH = style/.nosearch
 
 all:	lisp
@@ -172,11 +172,18 @@
 	$(ELCC) -f batch-byte-compile $<
 
 clean:
-	rm -rf *~ \#*\# *.elc style/*.elc
+	rm -f $(CLEANFILES)
 	(cd doc; $(MAKE) clean)
 
-distclean: clean
-	rm -rf Makefile tex-site.el config.* autom4te.cache
+distclean:
+	rm -f $(CLEANFILES) $(DISTCLEANFILES)
+	(cd doc; $(MAKE) distclean)
+
+maintainer-clean: distclean
+	rm -rf autom4te.cache
+
+extraclean: maintainer-clean
+	rm -f *~ \#*\#
 
 tar-ball-clean:
 	@if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi