help with makefiles

Matt Price matt.price-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Sat Dec 23 14:06:41 UTC 2006


Hi,

I'm just learning a little bit about makefiles as I'm trying to modify
the very user-unfriendly debian/rules in ubuntu's
linux-restricted-modules package.  THis package is set up for developers
who are building lots and lots of distro-standard kernels; I want it to
be more friendly to users who just want to build the restricted-modules
package for the little custom kernel they built themselves.  One of the
really frustrating things about ubuntu is that, while the kernel is more
inclusive and up-to-date than debian's, ist's actually quite abit more
difficult to modify than is the case when using debian itself.  

Anyway part of this would be controlled by a variable in debian/rules
called flavours.  So for instance in the 386 architecture, the variable
is set thus:

flavours := $(addprefix $(kernel_abi_version)-, generic 386 lowlatency)
I'd like to modify this by introducing a new variable "FLAVOURS" (ok
maybe it should be named something else) thus:

ifndef $(FLAVOURS) 
FLAVOURS := "generic 386 lowlatency"
endif
flavours := $(addprefix $(kernel_abi_version)-,$(FLAVOURS))

as I understand it, the ifndef shoud check to see whether FLAVOURS is
assigned a value, and if not, assign it the value "generic 386
lowlatency".  So if you don't pass a value for FLAVOURS, the behaviour
of debian/rules would be exactly as expected by the devs; but if you do
pass a value, you can determine the name of the flavour.  

Howver, I find that this does not work right:

$ FLAVOURS="TESTME" debian/rules printenv
DEB_HOST_ARCH:   i386
flavours:        2.6.20-2-generic 2.6.20-2-386 2.6.20-2-lowlatency
FLAVOURS:        generic 386 lowlatency

OK, but now I try somehting else; get rid of the ifndef loop and just
write:  

flavours := $(addprefix $(kernel_abi_version)-,$(FLAVOURS))

now what happens?
$ FLAVOURS="TESTME" debian/rules printenv
DEB_HOST_ARCH:   i386
flavours:        2.6.20-2-TESTME
FLAVOURS:        TESTME


So why doesn't my little loop work?  The makefile is not entirely
trivial (as you'd expect for a pretty complicated package) so I am not
really sure what's going on (this is my first effort with makefiles).
I've posted the whole thing at:
http://www.derailleur.org/rules

ANyway I appreciate any help you guys can give me!

Matt

-- 
Matt Price
History Dept
University of Toronto
matt.price-H217xnMUJC0sA/PxXw9srA at public.gmane.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://gtalug.org/pipermail/legacy/attachments/20061223/267d4e32/attachment.sig>


More information about the Legacy mailing list