Problem running 'make install' as root when on mounted fs
From: Alex Blewitt <hidden>
Date: 2016-06-15 22:47:12
I just tried building and installing Git on Mac OSX. My home directory is NFS mounted, to which I have write (but root doesn't). When I do make, everything compiles OK When I do sudo make install, I get '/bin/sh: GIT-BUILD-OPTIONS: permission denied' It seems that make install is re-running the GIT-BUILD-OPTIONS target, and that tries to write to the current directory. In my case, on an NFS mounted home, root doesn't have write permissions to the local dir and so the install step fails. I could build on a local partition (e.g. /tmp) but I'd prefer to have the code on my local drive so that I can do a git update and other such changes subsequently. I was able to get it to work by removing the echo>> from the GIT-BUILD-OPTIONS step after having built the code the first time. The problem basically seems to be: install: all all:: ... GIT-BUILD-OPTIONS I think it would be possible to restrict the GIT-BUILD-OPTIONS to be generated during a build phase, so restructuring the Makefile like: install: build all:: build GIT-BUILD-OPTIONS build: ... would then mean the install phase wouldn't have to touch the GIT-BUILD- OPTIONS step. Does that sound reasonable? I'm happy to test it out and submit a patch if people agree (and/or have opinions on what the inner target 'build' should be called) Alex