Message-ID: <371F038A.223E3C84@cfwb.be> Date: Thu, 22 Apr 1999 13:10:02 +0200 From: dominique DOT cretel AT cfwb DOT be (CRETEL Dominique) X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: fr,fr-BE,en MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: Help for Makefile References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Eli Zaretskii wrote: > This is because you defined a wrong command in the rule: > > %.o: %.c > $(CC) -c $@ $(CPPFLAGS) $(CFLAGS) $< > > $@ is the target, so it needs to be after the -o switch: > > $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $< > Ok, thanks for your help Eli, but the rule used is not this one! You're right, I defined a wrong rule. The wrong rule I used to make library was: (%.o): %.c $(CC) -c $% $(CPPFLAGS) $(CFLAGS) $< $(AR) cr $@ $% $(RM) $% and the correct one should be (without the $%): (%.o): %.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $< $(AR) cr $@ $% $(RM) $% Ok, now when I execute the makefile, all the objects files are generated. But, at the end, I get an error message: ------------------------------------ gcc -c -s -O2 -Wall -pedantic sflxmll.c sflxmll.c: In function `get_next_element_token': sflxmll.c:424: warning: suggest explicit braces to avoid ambiguous `else' ar cr libsfl.a sflxmll.o del sflxmll.o libsfl.a make.exe: *** [libsfl.a] Error -1 D:\Sfl> ------------------------------------ > See how simple this is? Had you posted the error with the original > message, you could have the answer 4 days ago ;-). Can you help me? Dominique.