Re: [PATCH] Fix compile errors on Debian systems

From: Willy Tarreau <>
Date: Wed, 2 Jan 2008 11:54:26 +0100

Hi Arnaud,

On Wed, Jan 02, 2008 at 12:14:44AM +0100, Arnaud Cornet wrote:
> Le mardi 01 janvier 2008 à 23:23 +0100, Willy Tarreau a écrit :
> > Oh and by the way, to those who might wonder if it's why not switching over
> > to autoconf, I can already reply that as an end user, I *hate* having to debug
> > that complicated crap, and I don't want to impose it to any of my users ;-)
> Only elite m4 hackers will blame you for that.


> Since we are playing with makefiles, I noticed that your makefile does
> not check for dependancies when building. If you change a core structure
> in a .h file, you need to make clean or old objects using the structure
> won't be rebuild.
> Here is a patch that will have make generate dependancies and include
> them.

In my experiences, automatic dependencies have been useless to the best, and annoying to the worst.

Sometimes you just change a little thing in a core file (eg: a constant) and don't want to rebuild everything. But Make decides differently than you and rebuilds everything.

On the opposite side, sometimes you will just rebuild after having changed a macro passed as a CFLAG with -DXXX=yyy and make will not detect any change so you have to do your make clean by hand anyway.

I do have a few shell scripts in my working dir which basically do "make CPU=xxx, PCREDIR=xxx, SMALLOPTS=xxx USE_xxx=1" and everytime I produce a wrong binary (quire rare in fact), it is not because of a change in a .h, but because I accidentely run several of these scripts in a row without a "make clean" in between.

So if you know how I could make the dependencies optional, I agree to add this feature, but if there is no easy way for this, I'd rather leave it to the developer to know when to clean and when not to clean. I certainly can replace "make" by "make haproxy" to do a partial rebuild, but I do not want to have to hack deps files for this.

BTW, you should be very careful with "sed -i", it's a useful GNU extension which was added very recently (sed 4) and which is not portable at all to other unixes nor older linux distros. For this reason, it's better to use the old boring "sed < x > x.tmp && mv x.tmp x".

> Note that GNU make is smart enough to deal with included files that it
> generates itself. Older make are not.

By "older", you mean which version ? I'm asking this because eventhough it's quite common to find GNU make >= 3.78.1 on Linux, when you work on other platforms, versions 3.75..3.77 are quite common too.

Willy Received on 2008/01/02 11:54

This archive was generated by hypermail 2.2.0 : 2008/01/02 12:00 CET