summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-25 10:27:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-25 10:27:21 -0400
commita8059df713ed85bbb8b0ceb49172514667fa840a (patch)
treefcf1cee79f249ef5c365c6e9efe88d327d6449be /Makefile
parent137ff3969bc85b80380dd6a9c3001191dbead990 (diff)
preserve library directories
Should avoid overwriting libraries when there are multiple versions of a library used by different programs.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 952a14856..5861636fb 100644
--- a/Makefile
+++ b/Makefile
@@ -152,10 +152,14 @@ osxapp: $(bins)
install -d "$(OSXAPP_BASE)/git-core"
(cd "$(shell git --exec-path)" && tar c .) | (cd "$(OSXAPP_BASE)"/git-core && tar x)
- install -d "$(OSXAPP_BASE)/lib"
+ touch "$(OSXAPP_BASE)/libdirs.tmp"
for lib in $$(otool -L "$(OSXAPP_BASE)"/bin/* "$(OSXAPP_BASE)"/git-core/* | egrep '^ ' | cut -d ' ' -f 1 | sed 's/^ //' | sort | uniq); do \
- base=$$(basename "$$lib"); \
- cp "$$lib" "$(OSXAPP_BASE)/lib/$$base"; \
+ dir=$$(dirname "$$lib"); \
+ install -d "$(OSXAPP_BASE)/$$dir"; \
+ echo "$$dir" >> "$(OSXAPP_BASE)/libdirs.tmp"; \
+ cp "$$lib" "$(OSXAPP_BASE)/$$dir"; \
done
+ sort "$(OSXAPP_BASE)/libdirs.tmp" | uniq > "$(OSXAPP_BASE)/libdirs"
+ rm -f "$(OSXAPP_BASE)/libdirs.tmp"
.PHONY: $(bins) test install