I want to write a makefile only for installing. I was thinking of having an install
target and an all
target. The all
target would only exist as the default target so running make
would say something like "Nothing to build". However, when I do a small test and run make
or make all
, it seems that the install target is also run. 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 output 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 doesn't happen if I put something like touch all
in the all
target. Can someone explain why this might be happening?
Heh, nice one. :)
Run `make install` to
This contains backticks, which invokes the command make install
. Use simple apostrophes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With