Skip to content

Commit

Permalink
Fix race in Makefile caused by flags.sexp dependencies (ocaml-flambda#32
Browse files Browse the repository at this point in the history
)

Refactor all .sexp targets into flags.sexp.
  • Loading branch information
gretay-js authored and poechsel committed May 26, 2021
1 parent 2795863 commit b04603a
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,7 @@ ocaml/otherlibs/dynlink/natdynlinkops2: ocaml-stage1-config.status
# Extract compilation flags from Makefile.config of stage1
# and write them to a file that dune can use in stage1 and stage2.
.PHONY: flags.sexp
flags.sexp: ocamlopt_flags.sexp oc_cflags.sexp oc_cppflags.sexp \
sharedlib_cflags.sexp

ocamlopt_flags.sexp: ocaml-stage1-config.status
flags.sexp: ocaml-stage1-config.status
cp ocaml-stage1-config.status ocaml/config.status
(cd ocaml && ./config.status)
grep -q '^FUNCTION_SECTIONS=true' ocaml/Makefile.config; \
Expand All @@ -181,22 +178,10 @@ ocamlopt_flags.sexp: ocaml-stage1-config.status
else \
/bin/echo -n "(:standard)" > ocamlopt_flags.sexp; \
fi

oc_cflags.sexp: ocaml-stage1-config.status
cp ocaml-stage1-config.status ocaml/config.status
(cd ocaml && ./config.status)
/bin/echo -n "( $$(grep "^OC_CFLAGS=" ocaml/Makefile.config \
| sed 's/^OC_CFLAGS=//') )" > oc_cflags.sexp

oc_cppflags.sexp: ocaml-stage1-config.status
cp ocaml-stage1-config.status ocaml/config.status
(cd ocaml && ./config.status)
/bin/echo -n "( $$(grep "^OC_CPPFLAGS=" ocaml/Makefile.config \
| sed 's/^OC_CPPFLAGS=//') )" > oc_cppflags.sexp

sharedlib_cflags.sexp: ocaml-stage1-config.status
cp ocaml-stage1-config.status ocaml/config.status
(cd ocaml && ./config.status)
/bin/echo -n "( $$(grep "^SHAREDLIB_CFLAGS=" ocaml/Makefile.config \
| sed 's/^SHAREDLIB_CFLAGS=//') )" > sharedlib_cflags.sexp

Expand Down

0 comments on commit b04603a

Please sign in to comment.