Grégory Pakosz
2016-06-28 17:21:45 UTC
Hello,
What's the rationale behind Automake passing CFLAGS or CXXFLAGS when linking?
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
In comparison, GNU Make's default linking rule is
.o:
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
where LINK.o = $(CC) $(LDFLAGS) $(TARGET_ARCH)
Regards,
Gregory
What's the rationale behind Automake passing CFLAGS or CXXFLAGS when linking?
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
In comparison, GNU Make's default linking rule is
.o:
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
where LINK.o = $(CC) $(LDFLAGS) $(TARGET_ARCH)
Regards,
Gregory