short version: make install tries to recompile the project. I just want to place all the files in the right places.

long version: I've created a docker container for building the projects that I want. It was a success. The rationale is that I don't want to install all the dev dependencies like pcre-devel and such on my final docker container, say, just for the sake of building ag (the silver searcher).

So the process is: I pre bake my sources with ./configure and make. then I go to my final container and only run make install. As I understand, make install just copies files to the right places. But it is instead, trying to recompile the project. I have already issue make, so why make install is trying to rebuild the projetct again?

The specific project that is doing that is ag, the silver searcher

I get this error:

bash-4.2# ./ag --version
ag version 0.32.0

  +jit +lzma -zlib
bash-4.2# make install
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh             /opt/sources/the_silver_searcher/missing autoheader)
rm -f src/stamp-h1
touch src/config.h.in
cd . && /bin/sh ./config.status src/config.h
config.status: creating src/config.h
config.status: src/config.h is unchanged
  CC       src/ignore.o
In file included from src/ignore.c:10:0:
src/options.h:7:18: fatal error: pcre.h: No such file or directory
 #include <pcre.h>
compilation terminated.
make: *** [src/ignore.o] Error 1

of course i do not want to install the pcre-dependency. but that should not be a problem because I have the binary already in place. What is happening?

  • you need the pcre headers. They should be in a package called libprce-dev or libpcre-devel or something like that. Jul 20, 2016 at 22:42
  • There are several ways this could have gotten confused. Unfortunately, your information is not sufficient to tell what. When you copied the files over did you copy everything in a way that preserved the timestamps? If the timestamps from the original build directory weren't preserved in the copy, it may think the binary is older, so it needs to be rebuilt. Also if some of the intermediate files are missing, make can decide they need to be rebuilt. But an answer on a different approach is in the works...
    – MAP
    Jul 21, 2016 at 6:28
  • use checkinstall to build a package in your dev container for installation on the target container. Or just use the packages pre-built for various distros and *bsd that are recommended in the silver-searcher README.md on github.
    – cas
    Jul 21, 2016 at 8:57
  • @MAP, I've copied the dependecies over my docker container with the Dockerfile ADD instruction. How can some intermediate files be missing with that approach? Do you think there could be extra file produced that live outside the silver_searcher repo folder?
    – ninrod
    Jul 21, 2016 at 13:27
  • @cas I use a centos container and the yum repo has no rpm for the_silver_searcher whatsoever. So my options are building it from source or creating an rpm. Now, in the case of the silver searcher, wouldn't it be sufficient to just copy the ag binary to /usr/local/bin?
    – ninrod
    Jul 21, 2016 at 13:34

1 Answer 1


For some projects the "install" phase can be fairly simple. So a different approach might be to run make -n install on the machine where you compiled everything. This will evaluate what's needed for an install and print out but not execute the commands. If this turns out to be relatively short, you can just cut-and-paste between two terminal windows to execute them manually on the target. There may even be a target in the Makefile that packages it up for you (although you may want to take a look at the Makefile.in which may be easier to understand).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .