Declare some Makefile targets to be PHONY
authorThomas Miedema <thomasmiedema@gmail.com>
Mon, 23 Feb 2015 09:40:34 +0000 (03:40 -0600)
committerAustin Seipp <austin@well-typed.com>
Mon, 23 Feb 2015 09:40:34 +0000 (03:40 -0600)
commita0ef626e8c51784cc0bf9b33e3c5b3e750b2786b
treeb04a6c1ee4be663f8c51a8062d22c1cadfd6b297
parent30dc59e889205ee62ce77168616f7a4183811d74
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
testsuite/tests/driver/recomp014/Makefile
testsuite/tests/ghc-api/T7478/Makefile
testsuite/tests/ghc-api/annotations-literals/Makefile
testsuite/tests/ghc-api/annotations/Makefile
testsuite/tests/ghc-api/landmines/Makefile
testsuite/tests/ghc-api/show-srcspan/Makefile