[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
- branch nix updated (0a75126 -> a1dd396), Ludovic Courtès, 2015/01/05
- 01/64: Support setting CFLAGS and CXXFLAGS for libraries/programs, Ludovic Courtès, 2015/01/05
- 02/64: Add a function for looking up programs in $PATH, Ludovic Courtès, 2015/01/05
- 03/64: More GNU Make 3.81 compatibility, Ludovic Courtès, 2015/01/05
- 06/64: Add a variable GLOBAL_CXXFLAGS_PCH for use by precompiled headers, Ludovic Courtès, 2015/01/05
- 05/64: Add variable GLOBAL_COMMON_DEPS, Ludovic Courtès, 2015/01/05
- 07/64: Add support for making relocatable packages using $ORIGIN, Ludovic Courtès, 2015/01/05
- 09/64: Tweak error message, Ludovic Courtès, 2015/01/05
- 04/64: Make it work on GNU Make > 3.81 again,
Ludovic Courtès <=
- 10/64: Support Illumos, Ludovic Courtès, 2015/01/05
- 11/64: Sync with make-rules repo, Ludovic Courtès, 2015/01/05
- 12/64: Fix compile errors on Illumos, Ludovic Courtès, 2015/01/05
- 13/64: Document that we require a C++11 compiler, Ludovic Courtès, 2015/01/05
- 16/64: Remove unnecessary quotes around file names, Ludovic Courtès, 2015/01/05
- 08/64: Don't set an absolute soname, Ludovic Courtès, 2015/01/05
- 15/64: Include position info in function application, Ludovic Courtès, 2015/01/05
- 14/64: Update release notes, Ludovic Courtès, 2015/01/05
- 18/64: forceInt: Show position info, Ludovic Courtès, 2015/01/05
- 19/64: forceList: Show position info, Ludovic Courtès, 2015/01/05