Skip to content

Commit aec9e2f

Browse files
lthlspoechsel
authored andcommitted
Fix parallel make (#64)
1 parent 3330806 commit aec9e2f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

Makefile.in

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ stage0: _build0/config.status
5858
# This code should use build contexts instead of --build-dir.
5959
.PHONY: stage1
6060
stage1: ocaml-stage1-config.status stage0 \
61-
ocaml/otherlibs/dynlink/natdynlinkops2 \
62-
flags.sexp
61+
config_files
6362
cp ocaml-stage1-config.status ocaml/config.status
6463
(cd ocaml && ./config.status)
6564
PATH=$(stage0_prefix)/bin:$$PATH \
@@ -89,8 +88,7 @@ stage2: ocaml-stage2-config.status stage1
8988
# in the middle end and backend.
9089
.PHONY: hacking
9190
hacking: ocaml-stage1-config.status stage0 \
92-
ocaml/otherlibs/dynlink/natdynlinkops2 \
93-
flags.sexp
91+
config_files
9492
cp ocaml-stage1-config.status ocaml/config.status
9593
(cd ocaml && ./config.status)
9694
PATH=$(stage0_prefix)/bin:$$PATH \
@@ -137,16 +135,23 @@ ocaml-stage2-config.status: ocaml/configure.ac
137135
--disable-ocamldoc && \
138136
cp config.status ../ocaml-stage2-config.status)
139137

138+
# natdynlinkops2:
140139
# We need to augment dune's substitutions so this part isn't so
141140
# difficult. We use /bin/echo to avoid builtin variants of "echo"
142141
# which don't accept "-n". Unfortunately if there are no
143142
# NATDYNLINKOPS, we need to provide a harmless option, otherwise dune
144143
# will provide '' on the command line to ocamlopt which causes an
145144
# error.
146145
# CR mshinwell: This should be moved into the upstream dune build system.
147-
ocaml/otherlibs/dynlink/natdynlinkops2: ocaml-stage1-config.status
146+
#
147+
# flags.sexp:
148+
# Extract compilation flags from Makefile.config of stage1
149+
# and write them to a file that dune can use in stage1 and stage2.
150+
.PHONY: config_files
151+
config_files: ocaml-stage1-config.status
148152
cp ocaml-stage1-config.status ocaml/config.status
149153
(cd ocaml && ./config.status)
154+
# natdynlinkops2
150155
cat ocaml/Makefile.config \
151156
| sed 's/^NATDYNLINKOPTS=$$/NATDYNLINKOPTS=-g/' \
152157
| grep '^NATDYNLINKOPTS=' \
@@ -164,14 +169,7 @@ ocaml/otherlibs/dynlink/natdynlinkops2: ocaml-stage1-config.status
164169
else \
165170
/bin/echo -n "-bin-annot" > ocaml/otherlibs/dynlink/natdynlinkops1; \
166171
fi
167-
168-
169-
# Extract compilation flags from Makefile.config of stage1
170-
# and write them to a file that dune can use in stage1 and stage2.
171-
.PHONY: flags.sexp
172-
flags.sexp: ocaml-stage1-config.status
173-
cp ocaml-stage1-config.status ocaml/config.status
174-
(cd ocaml && ./config.status)
172+
# flags.sexp
175173
grep -q '^FUNCTION_SECTIONS=true' ocaml/Makefile.config; \
176174
if [ $$? -eq 0 ] ; then \
177175
/bin/echo -n "(:standard -function-sections)" > ocamlopt_flags.sexp; \

0 commit comments

Comments
 (0)