Commit a0ef626e authored by thomie's avatar thomie Committed by Austin Seipp
Browse files

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
parent 30dc59e8
......@@ -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
......@@ -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
......@@ -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
......@@ -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
......@@ -10,4 +10,4 @@ landmines: clean
./landmines "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
.PHONY: clean
.PHONY: clean landmines
......@@ -10,4 +10,4 @@ showsrcspan: clean
./showsrcspan "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
.PHONY: clean
.PHONY: clean showsrcspan
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment