Re: [dev] make framework for wmii

From: Kris Maglione <>
Date: Mon, 25 May 2009 11:39:21 -0400

On Mon, May 25, 2009 at 11:38:47PM +0900, KIMURA Masaru wrote:
>I'm now browsing wmii hg2467.
> a) default has X11PACKAGES=xft and INCX11=$$(pkg-config
>--cflags $(X11PACKAGES))
> b) cmd/Makefile has redundant $$(pkg-config --libs $(X11PACKAGES)) w/
>hardcoded -lXext
> c) cmd/click/Makefile has hardcoded -lXtst in LDFLAGS
> d) test/Makefile has $(LIBX11) and w/ hardcoded -lXext in LDFLAGS
>Folks, could you mind to explain why they are?
>My point is,
> a) X11PACKAGES and INCX11 is a bit global. It can be hide into
>separated Makefike fragment like other X libs.
> b) $(LINK) has $$(pkg-config --libs $(PAKCAGES)) in mk/
> c) Ditto
> d) Ditto

The pkg-config bit is new and therefore rough. I may not even
keep it, and if I do, it'll certainly look significantly
different than it does now. As for cmd/Makefile, the pkg-config
fragment isn't redundant, it's there because not all programs in
cmd require X11. I may add an x11 subdirectory to handle the

>To tell you the truth, I've been being confused about Kris' make
>framework for wmii.
>In the past, I saw Anselm's Makefile for wmii, it was straightforward to me.
>Or, should I do self-enlightenment by reading some articles related mk?

The old makefile may have been straightforward, but it was also
bulky. Every directory needed its own, complete set of build
recipes, most of which was redundant and generally superfluous.
When I start writing a new program or library, I don't like to
cut and paste huge chunks of code, when I make changes, I don't
like to make them in 10 places, and when I read a makefile, I
like to see only the relevant bits of information (what objects
I'm using, what libs I'm linking, what extra compiler flags I
need). wmii's build system *is* based on Plan 9's system
mkfiles, and is admittedly a lot nicer when written in mk. I'll
admit though that it's grown by accretion to the point that it
needs some serious cleanup.

Kris Maglione
The power of instruction is seldom of much efficacy except in those
happy dispositions where it is almost superfluous.
	--Edward Gibbon
Received on Mon May 25 2009 - 15:39:21 UTC

This archive was generated by hypermail 2.2.0 : Mon May 25 2009 - 15:48:02 UTC