[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: makefile mysteries
- To: mulix <mulix(at-nospam)actcom.co.il>
- Subject: Re: makefile mysteries
- From: Tzafrir Cohen <tzafrir(at-nospam)technion.ac.il>
- Date: Sat, 8 Sep 2001 16:02:30 +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.0109081553590.13398-100000@alhambra.merseine.nu>
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
On Sat, 8 Sep 2001, mulix wrote:
> hi guys,
>
> even though today was declared to be a 'non syscalltrack day', a
> Makefile bug bit apparitio and seemed "simple enough to fix".
> these words are, in case you dont know, high on the list of famous last
> words.
>
> we want to check if an environemnt variable is set, and if not, die.
> simple, eh? not. if i do the obvious
>
> ifeq ($(string $(KERNEL_DIR)),)
> @echo bla bla
> @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...)'
>
> my solution (snipped off irrelevant stuff)
>
> # Makefile for syscalltrack_modules.
> # (loosely based on the examples in rubini's device drivers book)
>
> ifeq($(strip $(KERNEL_DIR)), )
> NO_KERNEL = 1
maybe you should set here the default to some sane default (perhaps
'/usr/src/linux')
--
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