gnu make tutorial

M.W. Chang mwchang
Mon May 17 11:59:26 PDT 2004


# 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.

> Please post the complete makefile. It's hard to debug them without
> seeing them.


More information about the Linux-users mailing list