[commit: ghc] master: Declare some Makefile targets to be PHONY (a0ef626)

git at git.haskell.org git at git.haskell.org
Mon Feb 23 09:40:31 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a0ef626e8c51784cc0bf9b33e3c5b3e750b2786b/ghc

>---------------------------------------------------------------

commit a0ef626e8c51784cc0bf9b33e3c5b3e750b2786b
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Mon Feb 23 03:40:34 2015 -0600

    Declare some Makefile targets to be PHONY
    
    Summary:
    Given:
      a Makefile with a non-PHONY target called `target`
    If:
      after running `make target`, a file exists with the same name as `target`
      (it was either already there, or it was created by running `make target`)
    And:
      `target` has no dependencies, such as `clean`, that modify or delete that
      file
    Then:
      subsequent invocations of `make target` will not have any effect.
    
    Solution: make `target` PHONY.
    
    BAD:
      ```
      foo:
              ...
              ./foo
      ```
    
    BETTER:
      ```
      foo:
              ...
              ./foo
      .PHONY: foo
      ```
    
    Reviewers: austin
    
    Reviewed By: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D670


>---------------------------------------------------------------

a0ef626e8c51784cc0bf9b33e3c5b3e750b2786b
 testsuite/tests/driver/recomp014/Makefile             | 2 ++
 testsuite/tests/ghc-api/T7478/Makefile                | 1 +
 testsuite/tests/ghc-api/annotations-literals/Makefile | 2 +-
 testsuite/tests/ghc-api/annotations/Makefile          | 2 +-
 testsuite/tests/ghc-api/landmines/Makefile            | 2 +-
 testsuite/tests/ghc-api/show-srcspan/Makefile         | 2 +-
 6 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/testsuite/tests/driver/recomp014/Makefile b/testsuite/tests/driver/recomp014/Makefile
index 58c6f2a..8bd9735 100644
--- a/testsuite/tests/driver/recomp014/Makefile
+++ b/testsuite/tests/driver/recomp014/Makefile
@@ -25,3 +25,5 @@ recomp014: clean
 	'$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) -c C.hs
 	'$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) A1.o C.o -o recomp014
 	./recomp014
+
+.PHONY: clean recomp014
diff --git a/testsuite/tests/ghc-api/T7478/Makefile b/testsuite/tests/ghc-api/T7478/Makefile
index 1afb16d..6214051 100644
--- a/testsuite/tests/ghc-api/T7478/Makefile
+++ b/testsuite/tests/ghc-api/T7478/Makefile
@@ -9,3 +9,4 @@ T7478: clean
 	'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc T7478.hs
 	./T7478 "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
 
+.PHONY: clean T7478
diff --git a/testsuite/tests/ghc-api/annotations-literals/Makefile b/testsuite/tests/ghc-api/annotations-literals/Makefile
index 875d063..5b06030 100644
--- a/testsuite/tests/ghc-api/annotations-literals/Makefile
+++ b/testsuite/tests/ghc-api/annotations-literals/Makefile
@@ -15,4 +15,4 @@ parsed:
 	'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc parsed
 	./parsed "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
 
-.PHONY: clean
+.PHONY: clean literals parsed
diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile
index 61474e9..f5ef3b4 100644
--- a/testsuite/tests/ghc-api/annotations/Makefile
+++ b/testsuite/tests/ghc-api/annotations/Makefile
@@ -26,4 +26,4 @@ exampleTest:
 	'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc exampleTest
 	./exampleTest "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
 
-.PHONY: clean
+.PHONY: clean annotations parseTree comments exampleTest
diff --git a/testsuite/tests/ghc-api/landmines/Makefile b/testsuite/tests/ghc-api/landmines/Makefile
index 3197647..c727b95 100644
--- a/testsuite/tests/ghc-api/landmines/Makefile
+++ b/testsuite/tests/ghc-api/landmines/Makefile
@@ -10,4 +10,4 @@ landmines: clean
 	./landmines "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
 
 
-.PHONY: clean
+.PHONY: clean landmines
diff --git a/testsuite/tests/ghc-api/show-srcspan/Makefile b/testsuite/tests/ghc-api/show-srcspan/Makefile
index e467b61..8adcaa4 100644
--- a/testsuite/tests/ghc-api/show-srcspan/Makefile
+++ b/testsuite/tests/ghc-api/show-srcspan/Makefile
@@ -10,4 +10,4 @@ showsrcspan: clean
 	./showsrcspan "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
 
 
-.PHONY: clean
+.PHONY: clean showsrcspan



More information about the ghc-commits mailing list