Re: [dwm] improve config.mk

From: Anselm R. Garbe <arg_AT_10kloc.org>
Date: Thu, 7 Sep 2006 10:32:33 +0200

On Thu, Sep 07, 2006 at 10:21:40AM +0200, Cedric Krier wrote:
> On 07/09/06 08:12 +0200, Anselm R. Garbe wrote:
> > Besides this, you can override any variable defined in config.mk
> > using make in this way:
> >
> > make <var1>=<value> <var2>=<value>
> >
> > So I really see no need for using the ?= operator (dunno how
> > portable it is btw. The Makefile's work out of the box
> > with GNU and BSD make and are still quite readable
> > (compared to that stupid junk called automake).
> >
>
> And what about this patch ? Because I think it must be better if you can
> compile dwm with optimisation like that :
>
> make CFLAGS="-O3 -march=athlon-xp"
>
> --- dwm-1.4~/config.mk 2006-09-07 10:16:53.000000000 +0200
> +++ dwm-1.4/config.mk 2006-09-07 10:17:41.000000000 +0200
> @@ -15,7 +15,7 @@
> LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
>
> # flags
> -CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\"
> +CFLAGS += ${INCS} -DVERSION=\"${VERSION}\"
> LDFLAGS = ${LIBS}
> #CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
> #LDFLAGS = -g ${LIBS}

No, because CFLAGS might inherit totally retarded options from
the host OS with your patch. Also, the -OXXX -march=XXXX options
don't bring any real benefit. You shouldn't believe the FUD the
gentoo people want to make you believe. The gcc optimizations
are kind of a joke compared to other commercial C compilers.
-Os is optimizing for size and the architecture is implicitely
given by the compiler. If your userland is already builded for
the athlon-xp architecture and your compiler toolchain is linked
as well to athlon-xp architecture, you don't need to set any
options in gcc. Just compare the binaries with -O3 and -O3
-march=athlon-xp, I doubt you will see much or any difference in
your environment. Apart from that, I doubt you will be able to
measure any difference in resource usage, cpu execution time,
and what not.

Regards,

-- 
 Anselm R. Garbe  ><><  www.ebrag.de  ><><  GPG key: 0D73F361
Received on Thu Sep 07 2006 - 10:32:33 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:31:03 UTC