build: Mark print-% target as phony. #22234

pull dgoncharov wants to merge 1 commits into bitcoin:master from dgoncharov:mark_print_as_phony changing 3 files +4 −3
  1. dgoncharov commented at 3:47 pm on June 13, 2021: none

    .PHONY does not take patterns (such as print-%) as prerequisites. Have print-% depend on force and mark force as phony.

    This change ensures print-% rule works even when there is a file that matches the target.

     0$ # on master
     1$ make print-host
     2host=x86_64-pc-linux-gnu
     3$ touch print-host
     4$ make print-host
     5make: 'print-host' is up to date.
     6$
     7$ git co mark_print_as_phony
     8Switched to branch 'mark_print_as_phony'
     9$ make print-host
    10host=x86_64-pc-linux-gnu
    11$ touch force
    12$ make print-host
    13host=x86_64-pc-linux-gnu
    
  2. DrahtBot added the label Build system on Jun 13, 2021
  3. hebasto commented at 4:47 pm on June 13, 2021: member
    Also Makefile.am and src/Makefile.am?
  4. dgoncharov commented at 8:47 pm on June 13, 2021: none
    Sure.
  5. DrahtBot commented at 9:41 pm on June 13, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. dongcarl commented at 3:37 pm on June 16, 2021: member
    Nice! Wondering why there’s a difference in how you do it for Makefiles and Makefile.ams
  7. dgoncharov commented at 3:55 pm on June 16, 2021: none
    What is the difference?
  8. dongcarl commented at 3:57 pm on June 16, 2021: member

    What is the difference?

    1. It seems like you capitalize FORCE in Makefile.am and src/Makefile.am, whereas it is force in depends/Makefile
    2. You do .PHONY: force in depends/Makfile, but not in Makefile.am or src/Makefile.am
  9. dgoncharov commented at 4:06 pm on June 16, 2021: none
    Both of these differences are accidental. i initially planned to only modify depends/Makefile. So, i added target ‘force’. Then Hennadii pointed out that Makefile.am and src/Makefile.am have the same print-% rule. So, i modified Makefile.am and src/Makefile.am. Both Makefile.am and src/Makefile.am already had a phony target called ‘FORCE’. This eliminated the need for ‘force’ and i made print-% depend on ‘FORCE’ in Makefile.am and src/Makefile.am.
  10. dongcarl commented at 4:13 pm on June 16, 2021: member

    Ah right! Let’s just capitalize the one in depends/Makefile to make them consistent.

    Code Review ACK a27d4a3f357dde2a0f2b27794c716160846d78fe modulo FORCE capitalization in depends/Makefile

  11. fanquake added the label Waiting for author on Jun 17, 2021
  12. dongcarl commented at 6:04 pm on June 22, 2021: member

    Code Review ACK 020802c5b06489190f48bf544de761c72e2cce43


    We might need to squash the commits before merge, but everything else looks good

  13. dongcarl removed the label Waiting for author on Jun 22, 2021
  14. fanquake added the label Waiting for author on Jun 24, 2021
  15. fanquake commented at 2:59 am on June 24, 2021: member
    Yes this needs squashing.
  16. Mark print-% target as phony.
    .PHONY does not take patterns (such as print-%) as prerequisites.
    Have print-% depend on FORCE and mark FORCE as phony.
    
    $ # on master
    $ make print-host
    host=x86_64-pc-linux-gnu
    $ touch print-host
    $ make print-host
    make: 'print-host' is up to date.
    $
    $ git co mark_print_as_phony
    Switched to branch 'mark_print_as_phony'
    $ make print-host
    host=x86_64-pc-linux-gnu
    $ touch FORCE
    $ make print-host
    host=x86_64-pc-linux-gnu
    fb7be92b09
  17. dgoncharov force-pushed on Jun 25, 2021
  18. dongcarl removed the label Waiting for author on Jun 29, 2021
  19. hebasto approved
  20. hebasto commented at 8:20 pm on July 17, 2021: member
    ACK fb7be92b094477131140b58a4e3ae98366b93e76, tested on Linux Mint 20.2 (x86_64).
  21. fanquake merged this on Jul 18, 2021
  22. fanquake closed this on Jul 18, 2021

  23. dgoncharov deleted the branch on Jul 18, 2021
  24. sidhujag referenced this in commit f84bba73fe on Jul 23, 2021
  25. gwillen referenced this in commit 6bd2a816e9 on Jun 1, 2022
  26. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-06 19:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me