about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--functions.mk2
-rw-r--r--install.mk2
-rw-r--r--libraries.mk6
-rw-r--r--programs.mk6
4 files changed, 8 insertions, 8 deletions
diff --git a/functions.mk b/functions.mk
index c92cdbc54ea0..45d917399391 100644
--- a/functions.mk
+++ b/functions.mk
@@ -11,4 +11,4 @@ filename-to-dep = $(dir $1).$(notdir $1).dep
 find-program = $(shell for i in $$(IFS=: ; echo $$PATH); do p=$$i/$(strip $1); if [ -e $$p ]; then echo $$p; break; fi; done)
 
 # Remove trailing slash.
-remove-trailing-slash = $(patsubst %/,%,$(1))
+add-trailing-slash = $(patsubst %/,%,$(1))/
diff --git a/install.mk b/install.mk
index 0fe4cf938d50..dad0fd8533ab 100644
--- a/install.mk
+++ b/install.mk
@@ -1,7 +1,7 @@
 # Add a rule for creating $(1) as a directory.  This template may be
 # called multiple times for the same directory.
 define create-dir
-   _i := $$(call remove-trailing-slash, $(DESTDIR)$$(strip $(1)))
+   _i := $$(call add-trailing-slash, $(DESTDIR)$$(strip $(1)))
   ifndef $$(_i)_SEEN
     $$(_i)_SEEN = 1
     $$(_i):
diff --git a/libraries.mk b/libraries.mk
index 35ce4983a135..21718c496a25 100644
--- a/libraries.mk
+++ b/libraries.mk
@@ -68,7 +68,7 @@ define build-library
 
     $(1)_PATH := $$(_d)/$$($(1)_NAME).$(SO_EXT)
 
-    $$($(1)_PATH): $$($(1)_OBJS) $$(_libs) | $$(_d)
+    $$($(1)_PATH): $$($(1)_OBJS) $$(_libs) | $$(_d)/
 	$$(trace-ld) $(CXX) -o $$@ -shared $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE))
 
     $(1)_LDFLAGS_USE += -L$$(_d) -Wl,-rpath,$$(abspath $$(_d)) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME)))
@@ -79,7 +79,7 @@ define build-library
 
     $$(eval $$(call create-dir, $$($(1)_INSTALL_DIR)))
 
-    $$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) | $(DESTDIR)$$($(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$$(DESTDIR)$$($(1)_INSTALL_DIR) -Wl,-rpath,$$($(1)_INSTALL_DIR) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME)))
@@ -92,7 +92,7 @@ define build-library
 
     $(1)_PATH := $$(_d)/$$($(1)_NAME).a
 
-    $$($(1)_PATH): $$($(1)_OBJS) | $$(_d)
+    $$($(1)_PATH): $$($(1)_OBJS) | $$(_d)/
 	$(trace-ar) ar crs $$@ $$?
 
     $(1)_LDFLAGS_USE += $$($(1)_PATH) $$($(1)_LDFLAGS)
diff --git a/programs.mk b/programs.mk
index 5e27a7d62fb1..04ba282b2c75 100644
--- a/programs.mk
+++ b/programs.mk
@@ -28,7 +28,7 @@ define build-program
 
   $$(eval $$(call create-dir, $$(_d)))
 
-  $$($(1)_PATH): $$($(1)_OBJS) $$(_libs) | $$(_d)
+  $$($(1)_PATH): $$($(1)_OBJS) $$(_libs) | $$(_d)/
 	$$(trace-ld) $(CXX) -o $$@ $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE))
 
   $(1)_INSTALL_DIR ?= $$(bindir)
@@ -42,12 +42,12 @@ define build-program
 
     _libs_final := $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_INSTALL_PATH))
 
-    $(DESTDIR)$$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) | $(DESTDIR)$$($(1)_INSTALL_DIR)
+    $(DESTDIR)$$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) | $(DESTDIR)$$($(1)_INSTALL_DIR)/
 	$$(trace-ld) $(CXX) -o $$@ $(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED))
 
   else
 
-    $(DESTDIR)$$($(1)_INSTALL_PATH): $$($(1)_PATH) | $(DESTDIR)$$($(1)_INSTALL_DIR)
+    $(DESTDIR)$$($(1)_INSTALL_PATH): $$($(1)_PATH) | $(DESTDIR)$$($(1)_INSTALL_DIR)/
 	install -t $$($(1)_INSTALL_DIR) $$<
 
   endif