gnu make tutorial
Kurt Wall
kwall
Mon May 17 11:59:26 PDT 2004
In a 0.9K blaze of typing glory, M.W. Chang wrote:
> # Makefile
> objects = b.o mwlib.o rlib.o
>
> all : b
>
> b : $(objects)
> harbour-link $(objects)
>
> b.o : b.prg
> mwlib.o : mwlib.prg
> rlib.o : rlib.prg
>
> # %.o : %.prg
> .prg.o :
> gharbour $<
>
> clean :
> rm b
> rm $(objects)
> # end of Makefile
>
> The error:
>
> root at server: b> make
> harbour-link b.o mwlib.o rlib.o
> gcc: b.o: No such file or directory
> gcc: mwlib.o: No such file or directory
> gcc: rlib.o: No such file or directory
> make: *** [b] Error 1
>
> It should have called gharbour to compile *.prg into *.o, but it called
> gcc. the .prg.o rule didn't work. It still used the implicit rule I
> beleived.
I believe that's exactly what happened. The implicit rules are used
first. I think you must use an explicit rule in this case because you
are not using a compiler that GCC has been taught to use and you are
using a non-standard file extension.
Kurt
--
Mickey Mouse wears a Spiro Agnew watch.
More information about the Linux-users
mailing list