PREFIX in Makefile

Posted on

Problem :

I don’t really know how to give this question a title, since it is pretty weird to me.
I’m gonna try linux form scratch, but I’m doing some research first. I’m stuck with compiling packages from source. The compiling isn’t the issue, but the installing is. most packages use configure to configure the build. One handy feature is –prefix=${YOUR_PREFIX}. The prefix is want is /usr for most packages. So –prefix=/usr will do the job, but not all packages come with configure, a lot of them have just a makefile. How to set the prefix? I’m using dwm as an example and it uses /usr/local as prefix. I can manualy change the config.mk file, but i don’t like doing that everytime. is there a way to set prefix=/usr as defaults?

I tried this on arch

Solution :

You might have a try setting the environment variable, e.g. running PREFIX=/usr make instead of make.