On 2002-12-18 18:02:33, Andrea Riciputi wrote: > It seems not to make any difference. Anyway the error message seems to > complain to unable to find a rule for '/obj/foo.o'. I suspect that it > can't match the target of the following rule: > > $(ObjectDir)/%.o: $(SourceDir)%.c > $(CCompiler) $(CFLAGS) -c $^ -o $@
Hmm... $(ObjectDir) should be full path (so /obj/foo.o seems odd), add a
'/' for the src too.
> Note that an explicit rule such as:
>
> $(ObjectDir)/foo.o: $(SourceDir)/foo.c
> $(CCompiler) $(CFLAGS) -c $^ -o $@
> works. But I'd happy to avoid to write an explicit rule for each source
> file!!!!
That's understandable, I usually do one of two things:
1) pattern + explicit rules
%.o: %.c
$(CC) ..
file.o: file.c
file.c: file.h
...
2) auto generate dependencies (see info page) which I then include:
Maybe your % is matching the wrong thing. Also are you sure that all .o
files depend on all .c files?
/Allan
--
Allan Wind
P.O. Box 2022
Woburn, MA 01888-0022
USA
msg01812/pgp00000.pgp
Description: PGP signature
_______________________________________________ Help-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-make
