मैं निम्नलिखित पुनरावर्ती makefile है:जब पैटर्न शासन की घोषणा के रूप में जाली, यह ट्रिगर नहीं है
.PHONY: all clean
%.subdir:
$(MAKE) -C src $*
$(MAKE) -C dict $*
all: all.subdir
clean: clean.subdir
और यह ठीक काम करता है:
$ make all
make -C src all
make[1]: Entering directory `/or-1.3.6-fix/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/or-1.3.6-fix/src'
make -C dict all
make[1]: Entering directory `/or-1.3.6-fix/dict'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/or-1.3.6-fix/dict'
लेकिन यह %.subdir
परिभाषित करने के लिए अधिक तार्किक होगा फोनी के रूप में नियम:
.PHONY: all clean all.subdir clean.subdir
और अब मैं काम करना बंद कर देता हूं जैसा कि मैं चाहता हूं:
$ make all
make: Nothing to be done for `all'.
$ make -d all
...
Updating goal targets....
Considering target file `all'.
File `all' does not exist.
Considering target file `all.subdir'.
File `all.subdir' does not exist.
Finished prerequisites of target file `all.subdir'.
Must remake target `all.subdir'.
Successfully remade target file `all.subdir'.
Finished prerequisites of target file `all'.
Must remake target `all'.
Successfully remade target file `all'.
make: Nothing to be done for `all'.
क्या कोई मुझे समझा सकता है (या दस्तावेज़ीकरण करने के लिए मुझे बेहतर बिंदु क्यों)?
अच्छा संकेत के लिए धन्यवाद! बहुत अच्छा। मैं थोड़ा और अधिक प्रसन्नता करूंगा और 'PHONY_TARGETS: = सभी साफ' कहूंगा और फिर 'PHONY: $ (PHONY_TARGETS) $ (adduffix .subdir, $ (PHONY_TARGETS)) ' –
उन दो कोलन दिखने वाले लक्ष्य/dep के लिए प्रलेखन मिला यदि कोई दिलचस्पी लेता है तो लाइन: https://www.gnu.org/software/make/manual/html_node/Static-Usage.html#Static-Usage – solstice333