pah8J
pah8J

Reputation: 867

How to reset source tree become what they like before I run "./configure" command?

The project contains "configure" file is a classical automake project. However when I run ./configure, it will generate Makefile under the source tree which include the privacy information about my platform. When I what to test the automake project, I need to compile it to binary file. Binary file are easy to clean by make clean, but the file generate by ./configure can not be cleaned. Is there a easy way to reset all the files like what they are before I run ./configure?

Upvotes: 2

Views: 558

Answers (1)

MadScientist
MadScientist

Reputation: 100906

You can use the make distclean rule which should delete all files that weren't provided by the distribution (all files that were generated).

If you want to be even more reliable, and if your project uses autotools correctly, then you can use "remote builds". This means that you create a separate directory rather than building inside the distribution directory. For example:

src=$(pwd)
mkdir ../_build
cd ../_build
"$src"/configure
make

This should not make any changes in the distribution directory at all (you shouldn't even need write permissions to it). Then when you want to clean this out:

cd ..
rm -rf _build

Upvotes: 2

Related Questions