From: Luke D. <cod...@ho...> - 2003-01-09 08:35:03
|
Since typing "make" or "make Game.exe" will do the linking, you shouldn't need a "link" target. Maybe this is what you want: defTarget : $(EXENAME) compile : $(OBJECTS) $(EXENAME) : $(OBJECTS) g++ $(OBJECTS) $(LINKFLAGS) With your original ".PHONY" directives and implicit rules, this should allow you to type "make compile" to compile all the objects, and "make" to build the executable (but will compile first if necessary). The important part is to make your executable depend on your object files (which other people have already told you). Luke ----- Original Message ----- From: "Ulf Magnusson" <ulf...@ho...> To: <Min...@li...> Sent: Wednesday, January 08, 2003 9:38 PM Subject: Re: [Mingw-users] Makefile problems > I altered the makfile like this: > > EXENAME = Game.exe > > ... > > .PHONY : defTarget > defTarget : compile link > > ... > > $(EXENAME) : $(OBJECTS) > > ... > > .PHONY : compile > compile : $(EXENAME) > > ... > > .PHONY : link > link : > (tab) g++ $(OBJECTS) $(LINKFLAGS) > > > I still get the same problems though.. > > the "compile" target is for when you only want to update the object files, > without performing a link. Thus the separation.. > > Ulfalizer > |