Merge branch 'OCaml-examples-race-conditions'

* OCaml-examples-race-conditions:
  Fix parallel 'make check-ocaml-examples'
  [OCaml] Fix race conds when running the examples with parallel make
This commit is contained in:
William S Fulton 2019-03-26 08:01:30 +00:00
commit 12a438542a
4 changed files with 13 additions and 9 deletions

View file

@ -865,12 +865,15 @@ NOLINK ?= false
OCAMLPP= -pp "camlp4o ./swigp4.cmo"
OCAMLP4WHERE=`$(COMPILETOOL) @CAMLP4@ -where`
OCAMLCORE=\
(test -f swig.mli || $(SWIG) -ocaml -co swig.mli 2>/dev/null) && \
(test -f swig.ml || $(SWIG) -ocaml -co swig.ml 2>/dev/null) && \
(test -f swigp4.ml || $(SWIG) -ocaml -co swigp4.ml 2>/dev/null) && \
(test -f swig.cmi || $(OCC) -c swig.mli) && \
(test -f swig.cmo || $(OCC) -c swig.ml) && \
(test -f swigp4.cmi || $(OCC) -I $(OCAMLP4WHERE) -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml)
$(SWIG) -ocaml -co swig.mli 2>/dev/null && \
$(SWIG) -ocaml -co swig.ml 2>/dev/null && \
$(SWIG) -ocaml -co swigp4.ml 2>/dev/null && \
$(OCC) -c swig.mli && \
$(OCC) -c swig.ml && \
mkdir -p ./localtmp && \
env TMPDIR=./localtmp $(OCC) -I $(OCAMLP4WHERE) -pp "camlp4o pa_extend.cmo q_MLast.cmo" -c swigp4.ml && \
rm -rf ./localtmp
# TMPDIR above is a workaround for some ocamlc versions, such as 4.05.0, which always create a temp file of the same name breaking parallel make
ocaml_static: $(SRCDIR_SRCS)
$(OCAMLCORE)
@ -957,6 +960,7 @@ ocaml_clean:
rm -f *_wrap* *~ .~* *.cmo *.cmi *.mli $(TARGET).ml $(RUNME) $(RUNME)_top swig.ml swigp4.ml
rm -f core @EXTRA_CLEAN@
rm -f *.@OBJEXT@ *@SO@
rm -rf ./localtmp
##################################################################
##### RUBY ######

View file

@ -20,7 +20,7 @@ static:
PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
ocaml_static_cpp
toplevel:
toplevel: static
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \

View file

@ -19,7 +19,7 @@ static:
PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
ocaml_static
toplevel:
toplevel: static
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \

View file

@ -23,7 +23,7 @@ dynamic:
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
ocaml_static_cpp
toplevel:
toplevel: static
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
PROGFILE='$(PROGFILE)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \