|
From: | David Boyce |
Subject: | Re: Feature request / patch: dependency-only prerequisites |
Date: | Tue, 9 Jul 2019 06:42:10 -0700 |
I quite like this idea because so many of us work on integrating things that we have no permission to modify and we need ways to make them work cleanly without messing them up. They are sort of "fix-up" or "patch" dependencies. I'm not sure the name makes this clear though.Regards,Tim_______________________________________________On Sat, 6 Jul 2019 at 09:28, Christof Warlich <address@hidden> wrote:_______________________________________________on 05.07.19 at 23:44 Martin Dorey wrote:
... Sadly, though, adding all these things to the dependency list won't really help me. We installed this system just three days ago, yet the mtime on stdio.h is months ago:
devadmin@ch-ep1-3:~$ ls -l /usr/include/stdio.h
-rw-r--r-- 1 root root 31494 Feb 6 21:17 /usr/include/stdio.hdevadmin@ch-ep1-3:~$
That dates from when upstream built the package that included it:
Yes, that's unfortunate, and the only generic fix would be checksum-based dependencies. Decent SCMs like git are also quite helpful in tackling this issue, see https://git.wiki.kernel.org/index.php/GitFaq#Why_isn.27t_Git_preserving_modification_time_on_files.3F
Yes, that's misleading: The "newly introduced" was meant to emphasize that a $(filter) function was added compared to the previous example, but you are right, it does more bad than good.
If you decide to press on, then I have three minor suggestions:
> the newly introduced GNU Make’s $(filter ) function
The revision history for make.texi shows that $(filter) was added some three decades ago:
address@hidden 9f8301ae1ac6d9076e38ec86f12d59ba40b851bd:Revision 1.2 1988/04/23 16:16:04 roland
...address@hidden 9f8301ae1ac6d9076e38ec86f12d59ba40b851bd:* Added the `filter', `filter-out', `strip' and `join' expansion functions.
https://www.gnu.org/software/make/manual/html_node/Features.html#Features suggests that this function was an innovation of GNU make, true, but I found "newly introduced" misleading. I'm a native English speaker.
> gcc -o $ $(filter %.o, $^)
You've put a space after the comma. I wouldn't do that in a Makefile, though I would in every other programming language. https://www.gnu.org/software/make/manual/html_node/Text-Functions.html#Text-Functions mostly wouldn't have that space either. $(filter) is one of those word-oriented functions where I don't think it would matter, but it's easier to have simple rules of thumb that keep you safe. One of the spaces after a comma here is important:
martind@swiftboat:~/tmp/warlich-2019-07-05$ cat Makefile
INPUT = a.o b.o
fn = $(1)
OUTPUT = $(call fn, $(filter-out %.o, $(INPUT)))
$(if $(OUTPUT),$(error :$(OUTPUT): is non-empty!))
martind@swiftboat:~/tmp/warlich-2019-07-05$ make
Makefile:4: *** : : is non-empty!. Stop.martind@swiftboat:~/tmp/warlich-2019-07-05$
> depenency> conviniently> reciepe
Spelling.Thanks for your suggestions, I'm happy to include them all (patch attached), together with some other doc fixes (hopefully) improving the grammer.
Bug-make mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-make
Bug-make mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-make
[Prev in Thread] | Current Thread | [Next in Thread] |