diff options
author | Joey Hess <joey@kitenet.net> | 2012-09-25 10:27:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-09-25 10:27:21 -0400 |
commit | a8059df713ed85bbb8b0ceb49172514667fa840a (patch) | |
tree | fcf1cee79f249ef5c365c6e9efe88d327d6449be /Makefile | |
parent | 137ff3969bc85b80380dd6a9c3001191dbead990 (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-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 |