www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/06/23/20:41:03

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199906232331.SAA00568@mercury.xraylith.wisc.edu>
To: "Jan-Friedrich Mutter" <jmutter AT bigfoot DOT de>
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: makefile syntax
In-Reply-To: Your message of "Thu, 24 Jun 1999 02:12:35 +0200."
<001c01bebdd6$43e71020$0300a8c0 AT phlegma>
Date: Wed, 23 Jun 1999 18:31:14 -0500
From: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>

"Jan-Friedrich Mutter" <jmutter AT bigfoot DOT de> writes:
> Hi,
> 
> I have problems with the make/Makefile syntax. Maybe someone could help me.
> 
> My Makefile looks like that:
> ###
> all: someclass.class
> 
> %.class:
>  echo $< ;
> ###
> 
> $< should contain 'someclass.class', shouldn't it ? But unfortunately it is
> empty.
> Did I take the wrong variable name, which one should I take ?
> 

Please read the make documentation on pattern rules, specifically the
section on automatic variables. 
  
  $ info make "Pattern Rules" Automatic

You're confusing targets vs dependencies (and perhaps the old suffix
rules syntax vs gnu make's). Also, I'm assuming that you know about 
the required TAB character before the echo command.

  all: someclass.class

  %.class:
	  echo $@ ;

should echo what you expect.

Please follow up in one of the gnu newsgroups, where general questions
about make is more appropriate.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019