Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern rules with multiple targets not shown #29

Open
dacodas opened this issue Sep 19, 2020 · 2 comments
Open

Pattern rules with multiple targets not shown #29

dacodas opened this issue Sep 19, 2020 · 2 comments

Comments

@dacodas
Copy link

dacodas commented Sep 19, 2020

Consider the following Makefile

all: hello.b hello.c

hello.a:
    touch $@

%.b %.c: %.a
    touch $*.b $*.c

Instead of properly connecting the two pattern rule targets, only one of
them is connected the in the dot output

wrong

should-be

I believe this is because the make -d output just says that the second
has "already been considered"

# make -rRBndC example
GNU Make 4.2.1
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2016 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.
Reading makefiles...
Reading makefile 'Makefile'...
Updating makefiles....
 Considering target file 'Makefile'.
  Looking for an implicit rule for 'Makefile'.
  No implicit rule found for 'Makefile'.
  Finished prerequisites of target file 'Makefile'.
 No need to remake target 'Makefile'.
Updating goal targets....
Considering target file 'all'.
 File 'all' does not exist.
 Looking for an implicit rule for 'all'.
 No implicit rule found for 'all'.
  Considering target file 'hello.b'.
   Looking for an implicit rule for 'hello.b'.
   Trying pattern rule with stem 'hello'.
   Trying implicit prerequisite 'hello.a'.
   Found an implicit rule for 'hello.b'.
    Considering target file 'hello.a'.
     Finished prerequisites of target file 'hello.a'.
    Making 'hello.a' due to always-make flag.
    Must remake target 'hello.a'.
make[1]: Entering directory '/home/dacoda/projects/tea-dragon-society/src/third-party/makefile2graph/test/example'
touch hello.a
    Successfully remade target file 'hello.a'.
   Finished prerequisites of target file 'hello.b'.
   Prerequisite 'hello.a' is newer than target 'hello.b'.
  Must remake target 'hello.b'.
touch hello.b hello.c
  Successfully remade target file 'hello.b'.
  Considering target file 'hello.c'.
  File 'hello.c' was considered already.
 Finished prerequisites of target file 'all'.
Must remake target 'all'.
Successfully remade target file 'all'.
make[1]: Leaving directory '/home/dacoda/projects/tea-dragon-society/src/third-party/makefile2graph/test/example'

With a different flag, however, it seems possible to have make let us
know that it is building more than one file with a single recipe

# make -rRpBC example | grep -C5 'Also makes'
    touch $@

hello.b: hello.a
#  Implicit rule search has been done.
#  Implicit/static pattern stem: 'hello'
#  Also makes: hello.c
#  Last modified 2020-09-18 17:55:32.792450404
#  File has been updated.
#  Successfully updated.
# automatic
# @ := hello.b
@lindenb
Copy link
Owner

lindenb commented Sep 19, 2020

Thank you for this report ! I'm afraid I won't have the time to fix this soon.

@dacodas
Copy link
Author

dacodas commented Sep 19, 2020

No worries! I'll give it a shot over the next while and make a pull request. This issue helps keep it fresh in my mind.

Thanks for the tool and for your quick response 😄😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants