Mail Archives: djgpp/1999/04/22/07:08:25
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.
- Raw text -