detect if configure/make was executed in a source directory

0

I have a script that installs a software. The script have answers prepared in advance in order to feed checkinstall with them. checkinstall prompts differently when the source has already been configured/make or not.
How can I tell if configure / make / make install was executed in the source directory?

Dor

Posted 2011-07-20T14:01:03.240

Reputation: 196

Are you using plain make or autotools? – Benjamin Bannier – 2011-07-20T15:14:38.410

I'm executing ./configure, make and checkinstall. But checkinstall is essentially make install. – Dor – 2011-07-20T15:30:39.453

Answers

1

I am not sure I understand how your setup looks like, but when using autotools (like you seem to do) files are created from autotools template files like configure.in and Makefile.am.

The different steps then produce a number of files in the build directory you could check for.

  • ./configure creates e.g. Makefile and config.status
  • make creates e.g files below .deps and .libs
  • make install doesn't leave any traces in the build directory, but copies files to their install locations.

To check if make install was run you could supplement the default install rules, e.g. add to your Makefile.am

install-data-local:
        @touch .installed

and then check for .installed.

Since when using autotools there won't be no Makefile before running ./configure you would have to handle this case differently.

Benjamin Bannier

Posted 2011-07-20T14:01:03.240

Reputation: 13 999