Date: Thu, 28 Aug 1997 12:23:16 +0300 (IDT) From: Eli Zaretskii To: Michael Mauch cc: djgpp AT delorie DOT com Subject: Re: Simple Makefile: how to generate .exe file In-Reply-To: <5u1cie$61v$3@news-hrz.uni-duisburg.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 27 Aug 1997, Michael Mauch wrote: > x.exe: x.o > > This makes the x.o from x.c, because of the implicit rule for compiling > .o from .c. But x.exe is not created. Make doesn't know how to make .exe from .o, it's not in its built-in rule data-base. So you must tell it how to do that. For example: x.exe: x.o $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ (All of the $(whatever) variables used in the above are stored in Make's built-in rule data-base; see the manual for more details.) You could also make this rule more general by using pattern rules: %.exe: %.o $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ This will make the rule work for any .o file, not just for x.o. Again, see the Make manual for details.