Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need to run "make clean" before ./configure when reconfiguring?

Tags:

autotools

Suppose I've ran ./configure and make, but now I want to change a parameter in the configure script. Do I need to run make clean before ./configure, or will everything be OK even if I don't?

like image 952
sashoalm Avatar asked May 19 '14 08:05

sashoalm


2 Answers

In many cases things might be OK if you don't run make clean, but you can't assume they will.

An example of how things might go wrong: a configure flag might add a -D parameter to a CFLAGS variable or DEFS, instead of defining it through config.h. The latter would give your C files a dependency on config.h which in turn gets regenerated when you re-run configure. But in the former case, if you run configure again and change that flag, the set of #defined symbols in your C files will be different, but those C files will not be recompiled.

like image 94
ptomato Avatar answered Nov 13 '22 13:11

ptomato


configure scripts are designed to run 'out-of-tree'. e.g., you can make a subdirectory build and run ../configure [options] from there, which will (ideally) only affect the build directory.

If you're using ./configure, you should run make clean prior to running configure again - just to be safe. Otherwise, if you're worried about side-effects, a properly written autotools suite should allow for an out-of-tree build directory.

like image 30
Brett Hale Avatar answered Nov 13 '22 12:11

Brett Hale