help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

directory order-only dependencies with trailing slash


From: J.T. Conklin
Subject: directory order-only dependencies with trailing slash
Date: Wed, 15 Jun 2016 14:55:33 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

One of my developers reported that our product's build fails with GNU
make >= 3.82. 

I discovered the root cause of the issue was that we had order only
prerequisites of directories with trailing slashes, but the targets
used to create those directories did not. 

In our framework, these differences result from a twisted maze of $(call
...)  and $(eval ...) expansions; but this simple Makefile demonstrates
the issue:

     foo/bar: | foo/
             touch $@

     foo:
             mkdir $@

With GNU make 3.81 (as distributed by Ubuntu 14.04):

     $ make --version
     GNU Make 3.81
     Copyright (C) 2006  Free Software Foundation, Inc.
     This is free software; see the source for copying conditions.
     There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
     PARTICULAR PURPOSE.

     This program built for x86_64-pc-linux-gnu

     $ make
     mkdir foo
     touch foo/bar

With GNU make 3.82 (built from source on the same system):

     $ make --version
     GNU Make 3.82
     Built for x86_64-unknown-linux-gnu
     Copyright (C) 2010  Free Software Foundation, Inc.
     License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
     This is free software: you are free to change and redistribute it.
     There is NO WARRANTY, to the extent permitted by law.

     $ make
     make: *** No rule to make target 'foo/', needed by 'foo/bar'.  Stop.


I've checked the NEWS file and did not see this listed among the
backwards-incompatible changes.

Was this change intentional?  To some extent, it doesn't matter, as I'll
need change our makefile framework to strip trailing slashes for current
GNU make versions regardless.

Thanks,

    --jtc



reply via email to

[Prev in Thread] Current Thread [Next in Thread]