[Git][ghc/ghc][wip/ghc-9.10] hadrian/bindist: Eliminate extraneous `dirname` invocation
Ben Gamari (@bgamari)
gitlab at gitlab.haskell.org
Mon Mar 11 21:56:39 UTC 2024
Ben Gamari pushed to branch wip/ghc-9.10 at Glasgow Haskell Compiler / GHC
Commits:
563fa0fd by Ben Gamari at 2024-03-11T17:56:26-04:00
hadrian/bindist: Eliminate extraneous `dirname` invocation
Previously we would call `dirname` twice per installed library file.
We now instead reuse this result. This helps appreciably on Windows, where
processes are quite expensive.
- - - - -
1 changed file:
- hadrian/bindist/Makefile
Changes:
=====================================
hadrian/bindist/Makefile
=====================================
@@ -175,18 +175,19 @@ install_lib: lib/settings
@dest="$(DESTDIR)$(ActualLibsDir)"; \
cd lib; \
for i in `$(FIND) . -type f`; do \
- $(INSTALL_DIR) "$$dest/`dirname $$i`" ; \
+ dir="`dirname $$i`" ; \
+ $(INSTALL_DIR) "$$dest/$$dir" ; \
case $$i in \
*.a) \
- $(INSTALL_DATA) $$i "$$dest/`dirname $$i`" ; \
+ $(INSTALL_DATA) $$i "$$dest/$$dir" ; \
$(RANLIB_CMD) "$$dest"/$$i ;; \
*.dll) \
- $(INSTALL_PROGRAM) $$i "$$dest/`dirname $$i`" ; \
+ $(INSTALL_PROGRAM) $$i "$$dest/$$dir" ; \
$(STRIP_CMD) "$$dest"/$$i ;; \
*.so) \
- $(INSTALL_SHLIB) $$i "$$dest/`dirname $$i`" ;; \
+ $(INSTALL_SHLIB) $$i "$$dest/$$dir" ;; \
*.dylib) \
- $(INSTALL_SHLIB) $$i "$$dest/`dirname $$i`" ;; \
+ $(INSTALL_SHLIB) $$i "$$dest/$$dir" ;; \
*.mjs) \
$(INSTALL_SCRIPT) $$i "$$dest/`dirname $$i`" ;; \
*) \
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/563fa0fd6d25b6187e763832adaae2659fe1f52e
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/563fa0fd6d25b6187e763832adaae2659fe1f52e
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240311/2d0c6766/attachment-0001.html>
More information about the ghc-commits
mailing list