[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [st-hackers] Re: makefile mysteries
- To: mulix <mulix(at-nospam)actcom.co.il>
- Subject: Re: [st-hackers] Re: makefile mysteries
- From: Tzafrir Cohen <tzafrir(at-nospam)technion.ac.il>
- Date: Sat, 8 Sep 2001 16:59:19 +0200 (IST)
- Cc: st-hackers <syscalltrack-hackers(at-nospam)lists.sourceforge.net>, <linux-il(at-nospam)linux.org.il>
- Delivered-To: linux.org.il-linux-il@linux.org.il
- In-Reply-To: <Pine.LNX.4.33.0109081711550.15426-100000@alhambra.merseine.nu>
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
On Sat, 8 Sep 2001, mulix wrote:
> On Sat, 8 Sep 2001, Tzafrir Cohen wrote:
>
> > On Sat, 8 Sep 2001, mulix wrote:
> >
> > > we want to check if an environemnt variable is set, and if not, die.
> > > simple, eh? not. if i do the obvious
> > >
> > > ifeq ($(strip $(KERNEL_DIR)),)
> > > @echo blabla
> > > @exit 1
> > > endif
> > >
> > > at the top of the Makefile, make complains loudly about "*** commands
> > > commence before first target.Stop.". there must be some simple
> > > solution to this (adding a phony target?), but i couldnt find it. for
> >> now, i implemented an extra level of indirection, but it's pretty ugly.
> > > help?
> >
> > Makefiles only execute commands within makefile commands (that are part of
> > rules).
> > In the make info file I see a reference to the function '$(error TEXT...)'
>
> oh, this could be exactly what i need (couldn't find something like this
> earlier). let's see... nope, cant find it. where exactly did you see it?
> it's not under 'Functions' or in the index. i'm using the info pages
> from make-3.77.
make-3.79.1-5mdk from Mandrake 7.2 . the function 'error' is mentioned in
both the "Make Control Functions" paeg and in the reference page.
Alternatively you can try to craft an error that will somehow includes the
variable called attention_attention_you_must_set_tyhe_value_of_KERNEL_DIR
and place it inside an 'if <KERNEL_DIR is defined>' block.
But I'm not sure exactly how, and it soudns like a lousy idea anyway...
--
Tzafrir Cohen
mailto:tzafrir@technion.ac.il
http://www.technion.ac.il/~tzafrir
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il