about summary refs log tree commit diff
path: root/libraries.mk
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-07T14·06+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-07T15·21+0100
commita210c995cdd9279ed4137ec5d2e4cc928cb36097 (patch)
treedc62d7fd0dad896bcbc53f41a892a74c37c3be11 /libraries.mk
parent97f8e9bc76b08ac6d63c6419490f8fcc9670a58b (diff)
Support DESTDIR
Diffstat (limited to 'libraries.mk')
-rw-r--r--libraries.mk10
1 files changed, 5 insertions, 5 deletions
diff --git a/libraries.mk b/libraries.mk
index e1c694cb38c5..c41694794b60 100644
--- a/libraries.mk
+++ b/libraries.mk
@@ -50,7 +50,7 @@ define build-library
   $(1)_LDFLAGS_USE :=
   $(1)_LDFLAGS_USE_INSTALLED :=
 
-  $$(eval $$(call create-dir,$$(_d)))
+  $$(eval $$(call create-dir, $$(_d)))
 
   ifeq ($(BUILD_SHARED_LIBS), 1)
 
@@ -71,16 +71,16 @@ define build-library
 
     $(1)_LDFLAGS_USE += -L$$(_d) -Wl,-rpath,$$(abspath $$(_d)) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME)))
 
-    $(1)_INSTALL_PATH := $$($(1)_INSTALL_DIR)/$$($(1)_NAME).$(SO_EXT)
+    $(1)_INSTALL_PATH := $(DESTDIR)$$($(1)_INSTALL_DIR)/$$($(1)_NAME).$(SO_EXT)
 
     _libs_final := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_INSTALL_PATH))
 
-    $$(eval $$(call create-dir,$$($(1)_INSTALL_DIR)))
+    $$(eval $$(call create-dir, $$($(1)_INSTALL_DIR)))
 
-    $$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) | $$($(1)_INSTALL_DIR)
+    $$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) | $(DESTDIR)$$($(1)_INSTALL_DIR)
 	$$(trace-ld) $(CXX) -o $$@ -shared $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED))
 
-    $(1)_LDFLAGS_USE_INSTALLED += -L$$($(1)_INSTALL_DIR) -Wl,-rpath,$$($(1)_INSTALL_DIR) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME)))
+    $(1)_LDFLAGS_USE_INSTALLED += -L$$(DESTDIR)$$($(1)_INSTALL_DIR) -Wl,-rpath,$$($(1)_INSTALL_DIR) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME)))
 
     ifdef $(1)_FORCE_INSTALL
       install: $$($(1)_INSTALL_PATH)