cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/11/09:11:03

Date: Sun, 11 Apr 1999 14:15:10 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Creating directories from a makefile
In-Reply-To: <KgQmuHA4LpD3EwP4@talula.demon.co.uk>
Message-ID: <Pine.SUN.3.91.990411141452.28502Z-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 10 Apr 1999, Shawn Hargreaves wrote:

> ---- makefile ----
> 
> testdir/file.h: file.h testdir
>         copy file.h testdir
> 
> testdir:
>         md testdir
> 
> ---- end makefile ----
> 
> This will correctly create the testdir and copy the header the first
> time it is run, but on subsequent runs it will always copy the header
> even though the current version is up to date, although it is smart
> enough not to try recreating the directory. If I remove testdir from the
> testdir/file.h dependencies, the copy works correctly and only takes
> place if file.h has changed.

I cannot reproduce this behavior.  Your Makefile works for me.  The
only way I could come close was to make file.h be an empty file: it is
a ``feature'' of COPY that it doesn't copy empty files (you should see
the telltale "0 file(s) copied" message coming from it).

So please dig deeper into this, since some other problem might be at
work here.  Perhaps the environment you tried this in was not clean
enough?

> Any ideas? It looks like making a file depend on its parent directory is
> confusing make

A directory is just a file.  Make doesn't treat it specially in
dependencies, as far as I could see.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019