help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implicit rules


From: Jean-Roch Roy
Subject: Re: Implicit rules
Date: Tue, 7 Jan 2003 20:06:37 -0500 (EST)

Hello,

Svein E. Seldal wrote:

> Now I would like to do the following:
> 
> %.o: $(SRCDIR)/%.c
> $(CC) $(CFLAGS) -c $< -o $@
> 
> And I would still like to write 'make file.o'
> and 'make test/file.o'. But the latter wont
> work as long as there's a '/' in the implicit
> rule. If I try it I get a "make: *** No rule
> to make target `test/file.o'. Stop.".

Will the VPATH variable work for you, as in the
following?

VPATH=$(SRCDIR)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@

--smig


______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca




reply via email to

[Prev in Thread] Current Thread [Next in Thread]