Solved How to tell gmake to install in /usr/local instead of /usr in order not to pollute base.

Well, if there is an configure script configure --prefix=/usr/local would probably do that. If it's just a lone Makefile you might be lucky to have it respect the DESTDIR variable (either passed in the environment or on the make commandline) but there really isn't any generic way.
 
That depends on the make file. Most of them have a variable that's something like "INSTALL_DESTINATION" or "TARGET", or the DESTDIR that ekvz already mentioned. Read the makefile and understand it. Perhaps start by doing a string search for "usr".
 
Depends on what you're compiling. For example, the dwm source code uses PREFIX in its config.mk while projects like VILE use prefix; Makefile macro names are case-sensitive. If the makefile supports it, you can also use DESTDIR=/usr/local/ to force installation to /usr/local/{prefix}; I recommend ensuring the path specified by DESTDIR ends with a trailing slash, possibly resulting in a path such as /usr/local//usr/bin since I have encountered some makefiles with broken DESTDIR behavior (i.e. ${DESTDIR}${prefix} where ${prefix} was not an absolute path resulted in things like /usr/localprefix/bin instead of /usr/local/prefix/bin). And as ekvz mentioned, if you have a configure script, you usually can use --prefix=/usr/local anyway.
 
Perverse idea (don't try this it home, it's insane): Leave the make file as it is. Take a union file system, and mount an empty file system over /usr. Like that, all the writes into /usr will end up in the empty file system, but all the reads from /usr still work. Then unmount the union mount, remount the (formerly empty) file system somewhere (like /tmp/new_stuff), and rsync from there to /usr/local.

The same could be accomplished by taking a snapshot of /usr, running make, rsync'ing the new stuff out to /usr/local, then reverting /usr to the snapshot.

All these ideas are INSANE, and only presented for amusement. But they might work.
 
For that project, a simple gmake worked fine for me. You might try env -u prefix gmake in case a prefix environment variable is defined for some reason. If it still doesn't work, I'm not sure what the problem would be unless you edited the GNUmakefile to set the prefix macro to a value other than the default /usr/local or used something like gmake prefix=/usr.
 
I did
Code:
gmake prefix=/usr/local
gmake install prefix=/usr/local
OK

Code:
pkg-config --cflags --libs gtkd-3
returned nothing.

But the manually include and library works fine!
Code:
ldmd2 -I/usr/local/include/d/gtkd-3 -L-lgtkd-3 ./hello.d
 
Code:
pkg-config --cflags --libs gtkd-3
returned nothing.

But the manually include and library works fine!
Code:
ldmd2 -I/usr/local/include/d/gtkd-3 -L-lgtkd-3 ./hello.d
That's because pkgconf(1) looks in /usr/local/libdata/pkgconfig while the makefile installs into /usr/local/lib/pkgconfig. If you pull the latest changes on the master branch, you can use gmake install prefix=/usr/local pkgconfigdir=libdata/pkgconfig. Then you can use pkg-config/pkgconf as usual, instead of dealing with the includes and libs manually.
 
GtkD uses the lowercase prefix setting. Consistency and orthogonality :).
Is there no group of wise and old man who can bow over if prefix should be capital or small on UNIX'es.
 
Or provide developers and universities with free keyboards with only capital letters. Problem solved.

I actually quite like this idea. Almost like if a child's handwriting is messy, they don't let them "upgrade" from pencil to pen in primary school.

The way some of my past students demonstrate a blatant disregard for case, It would be a very productive exercise to hand them a "beginner" keyboard!
 
Top