guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/64: Make it work on GNU Make > 3.81 again


From: Ludovic Courtès
Subject: 04/64: Make it work on GNU Make > 3.81 again
Date: Mon, 05 Jan 2015 16:38:49 +0000

civodul pushed a commit to branch nix
in repository guix.

commit 7bef965d6f191efb9c671f49fd187f4214db6120
Author: Eelco Dolstra <address@hidden>
Date:   Tue Feb 18 13:35:35 2014 +0100

    Make it work on GNU Make > 3.81 again
---
 functions.mk |    2 +-
 install.mk   |    2 +-
 libraries.mk |    6 +++---
 programs.mk  |    6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/functions.mk b/functions.mk
index c92cdbc..45d9173 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 0fe4cf9..dad0fd8 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 35ce498..21718c4 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 5e27a7d..04ba282 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]