Description: Fix makefiles to install parts at the correct location
Author: Maarten L. Hekkelman <maarten@hekkelman.com>
Last-Update: Thu, 10 Sep 2020 08:55:19 +0200
Forwarded: not-needed

--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -16,7 +16,7 @@
 LDFLAGS				= @LDFLAGS@ @BOOST_LDFLAGS@
 LIBS				= @BOOST_PROGRAM_OPTIONS_LIB@ @BOOST_DATE_TIME_LIB@ @LIBS@
 
-prefix				= @prefix@
+prefix				= $(DESTDIR)@prefix@
 exec_prefix			= @exec_prefix@
 libdir				= @libdir@
 datarootdir			= @datarootdir@
@@ -125,12 +125,10 @@
 -include $(OBJECTS:%.lo=%.d)
 
 $(OBJDIR)/%.lo: %.cpp | $(OBJDIR)
-	@ echo ">>" $<
-	@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(OBJDIR)/$*.d -c -o $@ $<
+	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(OBJDIR)/$*.d -c -o $@ $<
 
 $(OBJDIR)/%.o: %.cpp | $(OBJDIR)
-	@ echo ">>" $<
-	@ $(CXX) $(CXXFLAGS) -MT $@ -MD -MP -MF $(OBJDIR)/$*.d -c -o $@ $<
+	$(CXX) $(CXXFLAGS) -MT $@ -MD -MP -MF $(OBJDIR)/$*.d -c -o $@ $<
 
 $(LIB_TARGET): $(OBJECTS)
 	$(CXXLINK) -rpath $(libdir) $(OBJECTS) $(LDFLAGS) $(LIBS)
@@ -166,11 +164,15 @@
 .PHONY: install-lib
 install-lib: $(LIB_TARGET)
 	install -d $(libdir)
-	$(LIBTOOL) --mode=install install $(LIB_TARGET) $(libdir);
+	$(LIBTOOL) --mode=install install $(LIB_TARGET) $(libdir)
+	rm -f $(libdir)/libzeep.so $(libdir)/libzeep.a $(libdir)/libzeep.la
 
 # Install header files and .pc files
 .PHONY: install-dev
 install-dev: $(LIB_TARGET) libzeep.pc
+	install -d $(libdir)
+	$(LIBTOOL) --mode=install install $(LIB_TARGET) $(libdir)
+	rm -f $(libdir)/libzeep.so.5.0.0 $(libdir)/libzeep.so.5
 	for dir in . ./http ./json ./xml ; do \
 		install -d $(includedir)/zeep/$${dir}; \
 		for hdr in include/zeep/$${dir}/*.hpp ; do \
@@ -226,8 +228,7 @@
 endif
 
 tests/$(1)-test: $(LIB_TARGET) $$($(1)_OBJECTS) | tests
-	@ echo ">>> building $(1)-test"
-	@ $(CXX) -o $$@ $$($(1)_OBJECTS) $$(CFLAGS) $$(CXXFLAGS) $(LDFLAGS) -L.libs -lzeep $(LIBS)
+	$(CXX) -o $$@ $$($(1)_OBJECTS) $$(CFLAGS) $$(CXXFLAGS) $(LDFLAGS) -L.libs -lzeep $(LIBS)
 
 .PHONY: $(1)-test
 $(1)-test: tests/$(1)-test
