This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: makefile syntax


"Jan-Friedrich Mutter" <jmutter@bigfoot.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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]