sashoalm
sashoalm

Reputation: 79527

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

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?

Upvotes: 10

Views: 4974

Answers (2)

ptomato
ptomato

Reputation: 57890

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.

Upvotes: 3

Brett Hale
Brett Hale

Reputation: 22318

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.

Upvotes: 3

Related Questions