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.

    $ # 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
    
  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 cross-referenced this on Jun 13, 2021 from issue build: Avoid remaking makefiles. by dgoncharov
  6. DrahtBot commented at 9:41 PM on June 13, 2021: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    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.

  7. dongcarl commented at 3:37 PM on June 16, 2021: contributor

    Nice! Wondering why there's a difference in how you do it for Makefiles and Makefile.ams

  8. dgoncharov commented at 3:55 PM on June 16, 2021: none

    What is the difference?

  9. dongcarl commented at 3:57 PM on June 16, 2021: contributor

    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
  10. 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.

  11. dongcarl commented at 4:13 PM on June 16, 2021: contributor

    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

  12. fanquake added the label Waiting for author on Jun 17, 2021
  13. DrahtBot cross-referenced this on Jun 20, 2021 from issue build: Replace $(AT) with .SILENT by dgoncharov
  14. dongcarl commented at 6:04 PM on June 22, 2021: contributor

    Code Review ACK 020802c5b06489190f48bf544de761c72e2cce43


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

  15. dongcarl removed the label Waiting for author on Jun 22, 2021
  16. fanquake added the label Waiting for author on Jun 24, 2021
  17. fanquake commented at 2:59 AM on June 24, 2021: member

    Yes this needs squashing.

  18. 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
  19. dgoncharov force-pushed on Jun 25, 2021
  20. dongcarl removed the label Waiting for author on Jun 29, 2021
  21. hebasto approved
  22. hebasto commented at 8:20 PM on July 17, 2021: member

    ACK fb7be92b094477131140b58a4e3ae98366b93e76, tested on Linux Mint 20.2 (x86_64).

  23. fanquake merged this on Jul 18, 2021
  24. fanquake closed this on Jul 18, 2021

  25. dgoncharov deleted the branch on Jul 18, 2021
  26. sidhujag referenced this in commit f84bba73fe on Jul 23, 2021
  27. gwillen referenced this in commit 6bd2a816e9 on Jun 1, 2022
  28. bitcoin 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: 2026-05-20 06:54 UTC