Project

General

Profile

Feature #1007

(makefile) New "clean" target which does not clean documentation

Added by John Abbott about 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Portability
Target version:
Start date:
02 Feb 2017
Due date:
% Done:

100%

Estimated time:
7.70 h
Spent time:

Description

Since the problem with external dependencies seem to be mostly associated with the documentation, it would be helpful to have a "clean" target which leaves "compiled" documentation in tact, and removes only compiled code.


Related issues

Related to CoCoA-5 - Support #1006: External dependencies for buildingIn Progress2017-02-02

Related to CoCoALib - Bug #149: Makefile dependenciesNew2012-05-02

History

#1 Updated by John Abbott about 7 years ago

  • Related to Support #1006: External dependencies for building added

#2 Updated by John Abbott about 7 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

What should such a target be called? It should delete those files which depend on the platform (i.e. compiled code) but not the others. Maybe codeclean?

Strictly there should be two different targets (one for CoCoA-5 and one for CoCoALib).

#3 Updated by John Abbott about 7 years ago

  • Assignee set to John Abbott
  • % Done changed from 10 to 30

I found that the targets for building the CoCoA-5 documentation always rebuild it even when it's not necessary. I have now split off the part of the Makefile in src/CoCoA-5/ and moved it into a new src/CoCoA-5/CoCoAManual/Makefile. It now does not rebuild unless necessary... hopefully it still does the right thing when it actually has to do some work.

Here's hoping that the CoCoALib documentation is built properly (i.e. rebuilt only when needed).
[I'm not daring to look at it now...]

#4 Updated by John Abbott about 7 years ago

What purpose does the file wordlist.txt serve? Is it used just by the Emacs interface? If so, shouldn't it be in the directory with the other Emacs bits?

#5 Updated by John Abbott about 7 years ago

Another candidate for the name: halfclean

#6 Updated by John Abbott about 7 years ago

What does make clean do? And what should it do?

It seems that it does exactly what I want... (now that I have fixed the Makefile mess in src/CoCoA-5)

#7 Updated by John Abbott about 7 years ago

There are some (GNU) guidelines here:

https://www.gnu.org/prep/standards/html_node/Standard-Targets.html

#8 Updated by John Abbott about 7 years ago

I have a first implementation, but will refrain from checking in until I have done some more tests (over the weekend?).
[I used the target name halfclean]

What about this name for the target: clean-for-distrib? Or perhaps some other clean-for-XYZ?

A first check on my netbook looks promising :-)

#9 Updated by John Abbott about 7 years ago

If we regard the "compiled" documentation files as part of the standard distribution (which is probably a very reasonable point of view)...

As far as I can tell from the GNU guidelines distclean is probably the name of the target which deletes all "platform dependent code" (incl. any files created by "configuration scripts").

The target clean should keep the configuration files but otherwise do the same.

The target veryclean can delete also the compiled documentation files (leaving just enough that we can rebuild everything). So the result of make veryclean should correspond closely to what we keep in CVS.

Comments? Other ideas?

#10 Updated by John Abbott about 7 years ago

  • Related to Bug #149: Makefile dependencies added

#11 Updated by John Abbott about 7 years ago

  • % Done changed from 30 to 50
I have read through the GNU guidelines. Following them all would be quite hard work.
The "cleaning" targets which would be useful to use are:
  • maintainer-clean delete everything that could be rebuilt (given all the right tools)
  • distclean delete all files created by configuring and compiling
  • clean delete all files created by compiling (but not configuration files)

In particular distclean should restore the subtree to essentially what is contained in the distributed tar file (plus possibly some empty directories).

The crucial point is that a standard distribution of CoCoALib should contain all "compiled" documentation (since to "compile" it requires unusual tools, e.g. txt2tags). Thus "compiled" documentation would be deleted only by maintainer-clean.

I'm still undecided where the dependency files should fit into this scheme; internal dependencies (if specified via relative paths) ought to be part of the standard distribution. Rebuilding the dependency files presumes that the compiler accepts the appropriate flags (-MM if I recall correctly). Dealing with external dependencies could be tricky (see issue #149) .

#12 Updated by Anna Maria Bigatti about 7 years ago

John Abbott wrote:

I'm still undecided where the dependency files should fit into this scheme; internal dependencies (if specified via relative paths) ought to be part of the standard distribution.

I think it would be handy to have the dependencies in the distribution.
(but I think they are regenerated after configure, aren't they?)

#13 Updated by John Abbott about 7 years ago

It seems that the dependencies (in src/AlgebraicCore/) are rebuilt whenever include/CoCoA/library.H changes, and that appear to be the only condition. I thought changing autoconf.mk would have triggered it; maybe it did once.

If the dependencies are only the internal ones (and with relative paths) then there should be few occasions when rebuilding is necessary. I wonder if/how we can make just internal dependencies?

So it seems that include/CoCoA/library.H ought to be included in the standard distribution. (probably it is)

#14 Updated by John Abbott about 7 years ago

Should the file examples/index.html be included in the distribution?
In other words, should make distclean delete it or not?
make maintainer-clean will surely delete it.

#15 Updated by Anna Maria Bigatti about 7 years ago

John Abbott wrote:

Should the file examples/index.html be included in the distribution?
In other words, should make distclean delete it or not?

Better not: it was thought of as documentation

#16 Updated by John Abbott about 7 years ago

  • % Done changed from 50 to 60

Checked-in an update to all Makefiles. Hope it works -- I did mess some things up :-(

#17 Updated by Redmine Admin over 6 years ago

  • Target version changed from CoCoA-5.?.? to CoCoA-5.2.4

#18 Updated by John Abbott over 5 years ago

  • Subject changed from New "clean" target which does not clean documentation to (makefile) New "clean" target which does not clean documentation
  • Status changed from In Progress to Feedback
  • % Done changed from 60 to 90

Our makefile targets do not yet follow the GNU conventions, but they seem to work well enough at the moment.

Close this issue?

#19 Updated by John Abbott over 5 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100
  • Estimated time set to 7.70 h

Closing this issue. Maybe a similar one will be reopened later if some problems arise.

Also available in: Atom PDF