pika-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pika-dev] xl, xxl, and mxl


From: Jeremy Shaw
Subject: [Pika-dev] xl, xxl, and mxl
Date: Fri, 03 Sep 2004 13:23:40 -0700
User-agent: Wanderlust/2.11.30 (Wonderwall) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)

So, 

I was thinking the otherday that one possible addition to the xl
family might be something along the lines of mxl (men's extra
large???) -- a replacement for make.

Make has many issues, but the ones that affect me the most recently
are:

(1) spaces in filenames :)

yes, make is yet another program that does not support spaces in
filenames. Under certain circumstances, you can fake it, but not for
long. Make uses whitespace seperated lists and provides no escaping
mechanisms, so it quickly becomes a big pain.

(2) parallel builds 

Due to the rising popularity of recursive makes (due to things like
automake), parallel builds often don't work very well. This is because
each makefile in the project deals with so few files, that there is
not much to distribute.

This is not really a problem with make, but more how make has come to
be used. See the paper 'Recursive make considered harmful' for more
discussion on that subject.


(3) templates

I often find that it would be nice to use templates in make, but it's
not very elegant. In make, VAR = string is evaluated 'lazily' but VAR
:= string, is evaluated immediated. So, by using VAR := str syntax
pervasively, I can do tricks like this, where I import the same
Makefile fragments twice, but with different values for some
variables:


PRODUCT := full
PRODUCT_DESTDIR := $(DESTDIR)/los-kde-config-$(PRODUCT)
include kde-config/Makefile.common
include skel/Makefile.common
include wallpapers/Makefile.common
include qt3/Makefile.common
include DesktopLinks/Makefile.common

$(PRODUCT): $($(PRODUCT)_FILES)

PRODUCT := devel
PRODUCT_DESTDIR := $(DESTDIR)/los-kde-config-$(PRODUCT)
include kde-config/Makefile.common
include skel/Makefile.common
include wallpapers/Makefile.common
include qt3/Makefile.common
include DesktopLinks/Makefile.common

$(PRODUCT): $($(PRODUCT)_FILES)

You will also note ridiculous constructions like $($(PRODUCT)_FILES).


skel/Makefile.common looks like:

INSTALLDIR := /usr/share/apps/kdesktop/DesktopLinks
THISDIR := DesktopLinks

# include list of files that should be installed
include $(THISDIR)/Makefile.manifest.common

# Add DesktopLinks files to master list of all files to install for this product
$(PRODUCT)_FILES := $($(PRODUCT)_FILES) $(addprefix 
$(PRODUCT_DESTDIR)$(INSTALLDIR)/,$($(PRODUCT)_DESKTOP_LINKS_FILES))

include mk/Makefile.install_rules


and Makefile.install_rules looks like:


# -*- makefile -*-

$(PRODUCT_DESTDIR)$(INSTALLDIR)/% : $(THISDIR)/%
        (if [ -h "$<" ] ; then mkdir -p "`dirname "$@"`" && cp -d "$<" "$@" ; 
else install -D "$<" "$@" ; fi)

$(PRODUCT_DESTDIR)$(INSTALLDIR)/% : CONFIG := $(PRODUCT)
$(PRODUCT_DESTDIR)$(INSTALLDIR)/% : $(THISDIR)/%.m4
        install -d "$(@D)"
        ((cat configs/$(CONFIG).m4 ; cat "$<") | $(M4) > "$@")

Jumping through all these hopes lets me deal with issues (2) and
(3). I ultimately end up with a single top-level Makefile that can see
the big picture. And, it allows me lots of flexability -- I can
'easily' add new products with slightly different files, or the same
files, but with slightly different contents. But the code is obscene,
given the relative simplicity of what I want to do.

Just something to think about... 

Jeremy Shaw.

--

This message contains information which may be confidential and privileged. 
Unless you are the 
addressee (or authorized to receive for the addressee), you may not use, copy 
or disclose to anyone 
the message or any information contained in the message. If you have received 
the message in error, 
please advise the sender and delete the message.  Thank you.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]