Can someone explain me the purpose of a $(DESTDIR)
variable in a build system?
I mean that I know that it points a temporary directory for currently installed package, but I can not imagine what is practical use of it.
To clarify, well, I know what --prefix
option is, for instance if we point the buldsystem like ./configure --prefix="/usr"
all the package's files will belong /usr
, like /usr/lib
, /usr/share
and so on, but in Makefiles I've also seen the following constructions:
$(DESTDIR)/$(prefix)
And what's id purpose of that? In short, is there a difference between DESTDIR
and prefix
and when should both be used?