From: Earnie B. <ear...@ya...> - 2003-01-07 12:44:15
|
Make file basics. You link target is phony so it gets executed every time. You need a real file target so that make can check the date with it against the dates of it dependencies. Or make a dependency of the link target the real file, see below. I'm sure that this can be improved. Ulf Magnusson wrote: > In my makefile the default, phony target "defTarget" should depend upon > "compile" and "link". "compile" in turn should depend upon the object > files in my projects and "link" simply perform a link in its rule. > > When I run make the result is always a direct "link", seemingly not even > checking object dependencies. > -8<- > > #---------------------------------------------------- > # Linking > #---------------------------------------------------- > > .PHONY : link > link : > g++ $(OBJECTS) $(LINKFLAGS) > .PHONY : link link : myprog.exe myprog.exe : $(OBJECTS) g++ -o myprog.exe $(OBJECTS) $(LINKFLAGS) Earnie. |