| ... |
... |
@@ -97,12 +97,26 @@ lib/targets/default.target : config.mk default.target |
|
97
|
97
|
@echo "Copying the bindist-configured default.target to lib/targets/default.target"
|
|
98
|
98
|
cp default.target $@
|
|
99
|
99
|
|
|
|
100
|
+# sequentially create one layer of subdirectories under DESTDIR, then
|
|
|
101
|
+# subsequent install_* jobs can happen concurrently without bsd
|
|
|
102
|
+# install race condition. required for make install -j to work on
|
|
|
103
|
+# macos/freebsd, see #27499.
|
|
|
104
|
+.PHONY: install_dirs
|
|
|
105
|
+install_dirs:
|
|
|
106
|
+ $(INSTALL_DIR) "$(DESTDIR)$(prefix)"
|
|
|
107
|
+ $(INSTALL_DIR) "$(DESTDIR)$(ActualBinsDir)"
|
|
|
108
|
+ $(INSTALL_DIR) "$(DESTDIR)$(WrapperBinsDir)"
|
|
|
109
|
+ $(INSTALL_DIR) "$(DESTDIR)$(ActualLibsDir)"
|
|
|
110
|
+ $(INSTALL_DIR) "$(DESTDIR)$(mandir)"
|
|
|
111
|
+ $(INSTALL_DIR) "$(DESTDIR)$(docdir)"
|
|
|
112
|
+ $(INSTALL_DIR) "$(DESTDIR)$(datadir)"
|
|
|
113
|
+
|
|
100
|
114
|
# We need to install binaries relative to libraries.
|
|
101
|
115
|
BINARIES = $(wildcard ./bin/*)
|
|
102
|
116
|
.PHONY: install_bin_libdir
|
|
103
|
|
-install_bin_libdir:
|
|
|
117
|
+install_bin_libdir: install_dirs
|
|
104
|
118
|
@echo "Copying binaries to $(DESTDIR)$(ActualBinsDir)"
|
|
105
|
|
- $(INSTALL_DIR) "$(DESTDIR)$(ActualBinsDir)"
|
|
|
119
|
+
|
|
106
|
120
|
for i in $(BINARIES); do \
|
|
107
|
121
|
if test -L "$$i"; then \
|
|
108
|
122
|
cp -RP "$$i" "$(DESTDIR)$(ActualBinsDir)"; \
|
| ... |
... |
@@ -112,15 +126,14 @@ install_bin_libdir: |
|
112
|
126
|
done
|
|
113
|
127
|
|
|
114
|
128
|
.PHONY: install_bin_direct
|
|
115
|
|
-install_bin_direct:
|
|
|
129
|
+install_bin_direct: install_dirs
|
|
116
|
130
|
@echo "Copying binaries to $(DESTDIR)$(WrapperBinsDir)"
|
|
117
|
|
- $(INSTALL_DIR) "$(DESTDIR)$(WrapperBinsDir)"
|
|
|
131
|
+
|
|
118
|
132
|
$(INSTALL_PROGRAM) ./bin/* "$(DESTDIR)$(WrapperBinsDir)/"
|
|
119
|
133
|
|
|
120
|
134
|
.PHONY: install_lib
|
|
121
|
|
-install_lib: lib/settings lib/targets/default.target
|
|
|
135
|
+install_lib: install_dirs lib/settings lib/targets/default.target
|
|
122
|
136
|
@echo "Copying libraries to $(DESTDIR)$(ActualLibsDir)"
|
|
123
|
|
- $(INSTALL_DIR) "$(DESTDIR)$(ActualLibsDir)"
|
|
124
|
137
|
|
|
125
|
138
|
@dest="$(DESTDIR)$(ActualLibsDir)"; \
|
|
126
|
139
|
cd ./lib; \
|
| ... |
... |
@@ -146,9 +159,8 @@ install_lib: lib/settings lib/targets/default.target |
|
146
|
159
|
done; \
|
|
147
|
160
|
|
|
148
|
161
|
.PHONY: install_docs
|
|
149
|
|
-install_docs:
|
|
|
162
|
+install_docs: install_dirs
|
|
150
|
163
|
@echo "Copying docs to $(DESTDIR)$(docdir)"
|
|
151
|
|
- $(INSTALL_DIR) "$(DESTDIR)$(docdir)"
|
|
152
|
164
|
|
|
153
|
165
|
if [ -d doc ]; then \
|
|
154
|
166
|
cd ./doc; $(FIND) . -type f -exec sh -c \
|
| ... |
... |
@@ -163,9 +175,9 @@ install_docs: |
|
163
|
175
|
fi
|
|
164
|
176
|
|
|
165
|
177
|
.PHONY: install_data
|
|
166
|
|
-install_data:
|
|
|
178
|
+install_data: install_dirs
|
|
167
|
179
|
@echo "Copying data to $(DESTDIR)share"
|
|
168
|
|
- $(INSTALL_DIR) "$(DESTDIR)$(datadir)"
|
|
|
180
|
+
|
|
169
|
181
|
if [ -d share ]; then \
|
|
170
|
182
|
cd ./share; $(FIND) . -type f -exec sh -c \
|
|
171
|
183
|
'$(INSTALL_DIR) "$(DESTDIR)$(datadir)/`dirname $$1`" && \
|
| ... |
... |
@@ -177,18 +189,17 @@ MAN_SECTION := 1 |
|
177
|
189
|
MAN_PAGES := manpage/ghc.1
|
|
178
|
190
|
|
|
179
|
191
|
.PHONY: install_man
|
|
180
|
|
-install_man:
|
|
|
192
|
+install_man: install_dirs
|
|
181
|
193
|
if [ -f $(MAN_PAGES) ]; then \
|
|
182
|
|
- $(INSTALL_DIR) "$(DESTDIR)$(mandir)"; \
|
|
183
|
194
|
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man$(MAN_SECTION)"; \
|
|
184
|
195
|
$(INSTALL_MAN) $(INSTALL_OPTS) $(MAN_PAGES) "$(DESTDIR)$(mandir)/man$(MAN_SECTION)"; \
|
|
185
|
196
|
fi
|
|
186
|
197
|
|
|
187
|
198
|
export SHELL
|
|
188
|
199
|
.PHONY: install_wrappers
|
|
189
|
|
-install_wrappers: install_bin_libdir install_hsc2hs_wrapper
|
|
|
200
|
+install_wrappers: install_dirs install_bin_libdir install_hsc2hs_wrapper
|
|
190
|
201
|
@echo "Installing wrapper scripts"
|
|
191
|
|
- $(INSTALL_DIR) "$(DESTDIR)$(WrapperBinsDir)"
|
|
|
202
|
+
|
|
192
|
203
|
for p in `cd ./wrappers; $(FIND) . ! -type d`; do \
|
|
193
|
204
|
mk/install_script.sh "$$p" "$(DESTDIR)/$(WrapperBinsDir)/$$p" "$(WrapperBinsDir)" "$(ActualBinsDir)" "$(ActualBinsDir)/$$p" "$(ActualLibsDir)" "$(docdir)" "$(includedir)"; \
|
|
194
|
205
|
done
|