diff --git a/Examples/Makefile.in b/Examples/Makefile.in index 7022166a0..2688b16f3 100644 --- a/Examples/Makefile.in +++ b/Examples/Makefile.in @@ -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 ######