tags:

views:

47

answers:

4

I am implementing some idea on sqlite3. Every time I want to test my codes, I have to compile the whole project. The following is exactly what I do :

sudo make uninstall
sudo make clean
./configure 
sudo make
sudo make install

some of above commands cost long time. What should I do to save time?

+4  A: 

Skip other steps and do only

sudo make 
sudo make install

after you changed some source codes.

S.Mark
A: 

If you have a dual-core machine, use make -j2 to compile 2 files at a time in parallel. Quad core: make -j4, etc. This helps a lot if you make header file changes.

And listen to S.Mark: only do the steps you need to do each time. You probably won't need to run the slow ./configure again. If you run/link your tests against the sqlite in your build directory, you don't need make install either, leaving you with just make.

Harold L
And if `configure` is needed, you can use it with the `-C` option to speed things up with cached config params.
laalto
+3  A: 

Also, don't use sudo at all. You should be able to run an instance without actually "installing" it anywhere. This is what developers will normally do, rather than having to keep installing code they're working on into the very system they're using.

Greg Hewgill
A: 

ccache might be your friend.

On Ubuntu (or similar systems), you start with apt-get install ccache and then before you compile, do PATH=/usr/lib/ccache:$PATH. It'll cache stuff in ~/.ccache and likely speed up subsequent compiles.

keturn