diff options
author | Michał Górny <mgorny@gentoo.org> | 2023-02-08 16:50:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-08 16:50:43 (GMT) |
commit | 2a8bf2580441147f1a15e61229d669abc0ab86ee (patch) | |
tree | b4d819572bb43f6b6020fc8b9405aac153a9e6d4 /Makefile.pre.in | |
parent | 35dd55005ee9aea2843eff7f514ee689a0995df8 (diff) | |
download | cpython-2a8bf2580441147f1a15e61229d669abc0ab86ee.zip cpython-2a8bf2580441147f1a15e61229d669abc0ab86ee.tar.gz cpython-2a8bf2580441147f1a15e61229d669abc0ab86ee.tar.bz2 |
gh-100221: Fix creating dirs in `make sharedinstall` (GH-100329)
Fix creating install directories in `make sharedinstall` if they exist already outside `DESTDIR`. The previous make rules assumed that the directories would be created via a dependency on a rule for `$(DESTSHARED)` that did not fire if the directory did exist outside `$(DESTDIR)`.
While technically `$(DESTDIR)` could be prepended to the rule name, moving the rules for creating directories straight into the `sharedinstall` rule seems to fit the common practices better. Since the rule explicitly checks whether the individual directories exist anyway, there seems to be no reason to rely on make determining that implicitly as well.
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r-- | Makefile.pre.in | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in index 3641c4e..2559df8 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1816,7 +1816,15 @@ commoninstall: check-clean-src @FRAMEWORKALTINSTALLFIRST@ \ # Install shared libraries enabled by Setup DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED) -sharedinstall: $(DESTSHARED) all +sharedinstall: all + @for i in $(DESTDIRS); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ + echo "Creating directory $$i"; \ + $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ + else true; \ + fi; \ + done @for i in X $(SHAREDMODS); do \ if test $$i != X; then \ echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \ @@ -1828,17 +1836,6 @@ sharedinstall: $(DESTSHARED) all fi; \ done - -$(DESTSHARED): - @for i in $(DESTDIRS); \ - do \ - if test ! -d $(DESTDIR)$$i; then \ - echo "Creating directory $$i"; \ - $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \ - else true; \ - fi; \ - done - # Install the interpreter with $(VERSION) affixed # This goes into $(exec_prefix) altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@ |