Improve build: LDFLAGS.

Linker must be passed LDFLAGS for some distributions, as CXXFLAGS should
not normally contain any linker flags (may fail if passed to
compile-only invocations).

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
This commit is contained in:
Robin H. Johnson 2013-07-14 21:10:28 +00:00
parent 4cc9a79a4d
commit e38c3f9ede
2 changed files with 8 additions and 8 deletions

View File

@ -173,27 +173,27 @@ THIN_RMAP_OBJECTS=$(subst .cc,.o,$(THIN_RMAP_SOURCE))
thin_debug: $(THIN_DEBUG_OBJECTS) thin-provisioning/thin_debug.o
@echo " [LD] $@"
$(V) $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
$(V) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
thin_repair: $(THIN_REPAIR_OBJECTS) thin-provisioning/thin_repair.o
@echo " [LD] $@"
$(V) $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
$(V) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
thin_dump: $(THIN_DUMP_OBJECTS) thin-provisioning/thin_dump.o
@echo " [LD] $@"
$(V) $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
$(V) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
thin_restore: $(THIN_RESTORE_OBJECTS) thin-provisioning/thin_restore.o
@echo " [LD] $@"
$(V) $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
$(V) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
thin_check: $(THIN_CHECK_OBJECTS) thin-provisioning/thin_check.o
@echo " [LD] $@"
$(V) $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
$(V) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS)
thin_rmap: $(THIN_RMAP_OBJECTS) thin-provisioning/thin_rmap.o
@echo " [LD] $@"
$(V) $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
$(V) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS)
#----------------------------------------------------------------
# Cache tools
@ -216,7 +216,7 @@ CACHE_CHECK_OBJECTS=$(subst .cc,.o,$(CACHE_CHECK_SOURCE))
cache_check: $(CACHE_CHECK_OBJECTS) cache/check.o
@echo " [LD] $@"
$(V) $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
$(V) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS)
DEPEND_FILES=\
$(subst .cc,.d,$(SOURCE)) \

View File

@ -79,7 +79,7 @@ TEST_OBJECTS=$(subst .cc,.gmo,$(TEST_SOURCE))
unit-tests/unit_tests: $(TEST_OBJECTS) lib/libgmock.a lib/libpdata.a
@echo " [LD] $<"
$(V)g++ $(CXXFLAGS) -o $@ $(TEST_OBJECTS) $(LIBS) $(GMOCK_LIBS) $(LIBEXPAT)
$(V)g++ $(CXXFLAGS) $(LDFLAGS) -o $@ $(TEST_OBJECTS) $(LIBS) $(GMOCK_LIBS) $(LIBEXPAT)
.PHONEY: unit-test