Make launches all goals

I want to write makefile for installation only. I was thinking about purpose installand purpose all. The target allwill exist only as the default target, so the launch makewill say something like "Nothing to build". However, when I do a little test and run, makeor make allit seems that the install target is also running. Here is the makefile:

vimprefix=/usr/share/vim/vim73

.PHONY: all
all: 
    @echo "Nothing to build. Run `make install` to install configurations."

.PHONY: install
install:
    test -d $(vimprefix)

And here is the result from make:

$ make
Nothing to build. Run make[1]: Entering directory `/home/user/documents/conf'
test -d /usr/share/vim/vim73
make[1]: Leaving directory `/home/user/documents/conf' to install configurations.

I noticed that this does not happen if I put something like touch allon the target all. Can someone explain why this could happen?

+4
source share
1 answer

Hehe, good. :)

Run `make install` to 

, make install. .

+7

Source: https://habr.com/ru/post/1537292/


All Articles