[PATCH] Define phony make targets as such.

Thibault Nélis thib at stammed.net
Thu Feb 4 23:48:50 UTC 2021


Hello,

I just spent more time than I care to admit troubleshooting a make
issue after naively using `./configure --builddir=build` (make target
inadvertently matches this directory name).

Not sure if taking a dep on POSIX sed in the build system is kosher or
not, but if it is I figure this patch could save the next one some time
;).

Quickly tested on top of default tip as of this writing
(7765:519b55453c45).

Best regards,

--- a/auto/init
+++ b/auto/init
@@ -44,6 +44,8 @@ fi
 
 cat << END > Makefile
 
+.PHONY: default clean
+
 default:       build
 
 clean:
--- a/auto/install
+++ b/auto/install
@@ -196,6 +196,8 @@ done
 
 # create Makefile
 
+sed -i "/^\.PHONY/s/$/ build install modules upgrade/" Makefile
+
 cat << END >> Makefile
 
 build:




More information about the nginx-devel mailing list