alicebob / miniredis

Pure Go Redis server for Go unittests
MIT License
3.05k stars 212 forks source link

Fix makefile help #371

Closed wszaranski closed 5 months ago

wszaranski commented 5 months ago

Add Makefile help comments

Commit that originally introduced make help target also had special comments (starting with ###) for help target to parse.
Makefile that was finally merged after some changes lacked this comments. Without this comments when executed help prints empty output.


Move .PHONY next to each target

It's clearer to keep target and it's .PHONY together. When reading Makefile it's easier to see if target is phony or not (without jumping back to first line and reading all of .PHONY dependencies). It's also harder to forget remove/rename .PHONY dependency when target is changed when they are together.

There is no official standard but make documentation in .DEFAULT_GOAL use multiple .PHONY:

.PHONY: foo
foo: ; @echo $@

$(warning default goal is $(.DEFAULT_GOAL))

# Reset the default goal.
.DEFAULT_GOAL :=

.PHONY: bar
bar: ; @echo $@
alicebob commented 5 months ago

Oh, the ### ones were special, learned something new today. Sorry for messing up and thanks for fixing!