Does `make install` overwrite files

configuremakesoftware installation

I've taken some time to install a newer version of Apache2.x on my Mac Os X 10.6.8.

When configuring apache through ./configure I specified the Darwin layout. This layout assumes the path setup of the existing apache installation, which is what I want since my aim is to replace the old one.

I ran make, then of course sudo make install.

I checked the apache version by doing

apachetcl -v

and I got

Server version: Apache/2.4.1 (Unix)
Server built:   Mar 31 2012 01:52:54

Which is good. But then here is the strange part. I checked the 'old' httpd.conf file in /etc/apache2 and it had an old modification date.

I didn't really figure that out until after I tried running apache. Apache tried to load some extensions that were not compatible with the new version.

This led me to check the /usr/libexec/apache2 directory and I saw that the modules had not been recently modified except for a two or three. Essentially sudo make install had not overwritten every possible file.

What is the convention here? Should make install overwrite everything or not?

I'm assuming that it just depends on how the developers wrote the configure script and the Makefile.

I ended up doing some rm -rf on any existing apache dirs I knew about before running make install again. After that, everything was fresh.

Best Answer

You are correct regarding the Makefile the only things that happen are defined in it or companion scripts that get run. "Best practices" when upgrading software from source is typically to use the uninstall option if you did not run a make clean or delete your original source installation directory.

You have to be careful though, should the program have installed files outside of /usr/local you might remove files that were added by the package manager. Often main configuration files like Apache's do not get clobbered and simply deleted during installation they can or are preserved. Though this is not always the case. You can backup every destination with the -b or --backup option to install.

Edit: Looking at the Makefile.in for the current version of httpd it looks like several of their cp commands add the -p switch which preserve ownership and timestamps.

Related Question