Problem with make.

Mark Draughn draughn at iitcs.UUCP
Fri Jul 12 06:20:48 AEST 1985


This is probably a case of stupidity on my part, but here is my problem:

I'm trying to use make to maintain an archive of .o files.  I want
the archive modules to depend directly on the source files, so I don't
need to keep the object files around.  From the documentation, I thought
a dependency declaration like this would work in the makefile:

library.a(module.o) : module.c
        cc -c module.c
        ar r library.a module.o
        rm module.o

The problem is that the commands are executed every time, even if the module
is up to date.  The problem also arises if I make the module depend on
the .o file.  I tried it like this:

library.a(module.o) :
        cc -c module.c
        ar r library.a module.o
        rm module.o

and it still fails which means that make doesn't even realize it exists.
Is this a problem with make or am I just being a luser who isn't
abusing make properly?
Any help would be appreciated.

                                     Mark Draughn



More information about the Comp.unix mailing list