Dear there,

My make file was working with the

CFLAGS=-std=c99 -O3 -m32 -D_REENTRANT


After following the chapter 4.13 Generating Prerequisite Automatically
in the book GNU Make, I got the following error:

ld: warning: in csv.o, file was built for i386 which is not the
architecture being linked (x86_64)
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found


The change suggested by the chapter 4.13 is:

%.d: %.c
        @set -e; rm -f $@; \
        $(CC) -MM $(CPPFLAGS) $< > $@.$$$$; \
        sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
        rm -f $@.$$$$

include $(sources:.c=.d)

Also the "make" complains cannot find .d files, but .d files are
generated anyway. hence there is no complaining in the second cal of
make.

Any ideas of the error and complaining?

-- 
All the best,
Michael Chen

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to