Re: Remove of .SECONDARY from SGML Makefile

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Remove of .SECONDARY from SGML Makefile
Date: 2007-01-11 17:44:21
Message-ID: 200701111744.l0BHiLb24550@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > To get the new html dependency to work properly, I removed the
> > .SECONDARY tag from the Makefile. SECONDARY prevents missing files
> > from being built.
>
> That is not what it does.

It does several things, but that is one of the things it does:

`.SECONDARY'
The targets which `.SECONDARY' depends on are treated as
intermediate files, except that they are never automatically
deleted. *Note Chains of Implicit Rules: Chained Rules.

`.SECONDARY' with no prerequisites marks all file targets mentioned
in the makefile as secondary.

and intermediate files are defined as:

Intermediate files are remade using their rules just like all other
files. But intermediate files are treated differently in two ways.

The first difference is what happens if the intermediate file does
not exist. If an ordinary file B does not exist, and `make' considers
---------
a target that depends on B, it invariably creates B and then updates
the target from B. But if B is an intermediate file, then `make' can
leave well enough alone. It won't bother updating B, or the ultimate
--------------------------
target, unless some prerequisite of B is newer than that target or
there is some other reason to update that target.

The second difference is that if `make' _does_ create B in order to
update something else, it deletes B later on after it is no longer
needed. Therefore, an intermediate file which did not exist before
`make' also does not exist after `make'. `make' reports the deletion
to you by printing a `rm -f' command showing which file it is deleting.

This is what caused the dependencies not to run. SECONDARY was added by
you in 2000. What I don't understand is what else we have lost by
removing it:

revision 1.27
date: 2000/12/14 22:30:56; author: petere; state: Exp; lines: +2 -1
Merge functions and operators chapters. Lots of updates.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-01-11 17:49:04 Re: wal buffers documentation -errata
Previous Message Bruce Momjian 2007-01-11 17:37:18 Re: [HACKERS] [PATCHES] Patch to log usage of temporary files