summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2013-05-16 15:20:48 +0000
committerDamien Doligez <damien.doligez-inria.fr>2013-05-16 15:20:48 +0000
commit98c197a63b655e9a9c698fe58e987fa6c3714a4c (patch)
tree16ed0ffeee519507b934b3644e9fc46f6ce29182
parenta3b1c67fffd7de640ee9a0791f1fd0fad965b867 (diff)
testsuite: allow testing without installing (continued)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13686 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--testsuite/external/Makefile2
-rw-r--r--testsuite/makefiles/Makefile.common30
-rw-r--r--testsuite/makefiles/Makefile.okbad7
-rw-r--r--testsuite/makefiles/Makefile.one20
-rw-r--r--testsuite/makefiles/Makefile.several23
-rw-r--r--testsuite/tests/callback/Makefile21
-rw-r--r--testsuite/tests/lib-bigarray/Makefile2
-rw-r--r--testsuite/tests/lib-dynlink-bytecode/Makefile5
-rw-r--r--testsuite/tests/lib-dynlink-csharp/Makefile13
-rw-r--r--testsuite/tests/lib-dynlink-native/Makefile25
-rw-r--r--testsuite/tests/lib-num-2/Makefile2
-rw-r--r--testsuite/tests/lib-num/Makefile3
-rw-r--r--testsuite/tests/lib-scanf-2/Makefile5
-rw-r--r--testsuite/tests/lib-str/Makefile2
-rw-r--r--testsuite/tests/lib-systhreads/Makefile4
-rw-r--r--testsuite/tests/lib-threads/Makefile4
-rw-r--r--testsuite/tests/tool-ocamldoc/Makefile15
17 files changed, 126 insertions, 57 deletions
diff --git a/testsuite/external/Makefile b/testsuite/external/Makefile
index 692c44497..a33d09d19 100644
--- a/testsuite/external/Makefile
+++ b/testsuite/external/Makefile
@@ -37,7 +37,7 @@ default:
.PHONY: all-cygwin
all-cygwin: findlib ounit res pcre react ocamltext ocamlssl camlzip cryptokit \
- sqlite menhir hevea mysql ocgi xmllight configfile xmlm omake \
+ sqlite ocgi xmllight configfile xmlm omake \
camomile zen vsyml extlib fileutils ocamlify ocamlmod \
calendar dbm ocamlscript camlp5 geneweb coq
diff --git a/testsuite/makefiles/Makefile.common b/testsuite/makefiles/Makefile.common
index a9b1be7a8..c8f6b1236 100644
--- a/testsuite/makefiles/Makefile.common
+++ b/testsuite/makefiles/Makefile.common
@@ -39,18 +39,24 @@ SORT=sort
include $(TOPDIR)/config/Makefile
OCAMLRUN=$(TOPDIR)/boot/ocamlrun$(EXE)
-OCAML=$(OCAMLRUN) $(OTOPDIR)/ocaml -I $(OTOPDIR)/stdlib $(COMPFLAGS)
-OCAMLC=$(OCAMLRUN) $(OTOPDIR)/ocamlc -I $(OTOPDIR)/stdlib $(COMPFLAGS)
-OCAMLOPT=$(OCAMLRUN) $(OTOPDIR)/ocamlopt -I $(OTOPDIR)/stdlib $(COMPFLAGS)
+
+OCFLAGS=-nostdlib -I $(OTOPDIR)/stdlib $(COMPFLAGS)
+
+OCAML=$(OCAMLRUN) $(OTOPDIR)/ocaml $(OCFLAGS)
+OCAMLC=$(OCAMLRUN) $(OTOPDIR)/ocamlc $(OCFLAGS)
+OCAMLOPT=$(OCAMLRUN) $(OTOPDIR)/ocamlopt $(OCFLAGS)
OCAMLDOC=$(OCAMLRUN) $(OTOPDIR)/ocamldoc/ocamldoc
OCAMLLEX=$(OCAMLRUN) $(OTOPDIR)/lex/ocamllex
-OCAMLMKLIB=$(OCAMLRUN) $(OTOPDIR)/tools/ocamlmklib
+OCAMLMKLIB=$(OCAMLRUN) $(OTOPDIR)/tools/ocamlmklib \
+ -ocamlc '$(OTOPDIR)/boot/ocamlrun$(EXE) \
+ $(OTOPDIR)/ocamlc $(OCFLAGS)' \
+ -ocamlopt '$(OTOPDIR)/boot/ocamlrun$(EXE) \
+ $(OTOPDIR)/ocamlopt $(OCFLAGS)'
OCAMLYACC=$(TOPDIR)/yacc/ocamlyacc$(EXE)
OCAMLBUILD=$(TOPDIR)/_build/ocamlbuild/ocamlbuild.native
DUMPOBJ=$(OCAMLRUN) $(OTOPDIR)/tool/dumpobj
BYTECODE_ONLY=[ "$(ARCH)" = "none" -o "$(ASM)" = "none" ]
-#COMPFLAGS=
#FORTRAN_COMPILER=
#FORTRAN_LIBRARY=
@@ -71,23 +77,23 @@ defaultclean:
.SUFFIXES: .mli .ml .mly .mll .cmi .cmo .cmx .cmm .cmxa .s .S .o .so .c .f
.mli.cmi:
- @$(OCAMLC) -c $(COMPFLAGS) $(ADD_COMPFLAGS) $<
+ @$(OCAMLC) -c $(ADD_COMPFLAGS) $<
.ml.cmi:
- @$(OCAMLC) -c $(COMPFLAGS) $(ADD_COMPFLAGS) $<
+ @$(OCAMLC) -c $(ADD_COMPFLAGS) $<
.ml.cmo:
- @if [ -f $<i ]; then $(OCAMLC) -c $(COMPFLAGS) $(ADD_COMPFLAGS) $<i; fi
- @$(OCAMLC) -c $(COMPFLAGS) $(ADD_COMPFLAGS) $<
+ @if [ -f $<i ]; then $(OCAMLC) -c $(ADD_COMPFLAGS) $<i; fi
+ @$(OCAMLC) -c $(ADD_COMPFLAGS) $<
.ml.cmx:
- @$(OCAMLOPT) -c $(COMPFLAGS) $(ADD_COMPFLAGS) $<
+ @$(OCAMLOPT) -c $(ADD_COMPFLAGS) $<
.cmx.so:
- @$(OCAMLOPT) -o $@ -shared $(COMPFLAGS) $(ADD_COMPFLAGS) $<
+ @$(OCAMLOPT) -o $@ -shared $(ADD_COMPFLAGS) $<
.cmxa.so:
- @$(OCAMLOPT) -o $@ -shared -linkall $(COMPFLAGS) $(ADD_COMPFLAGS) $<
+ @$(OCAMLOPT) -o $@ -shared -linkall $(ADD_COMPFLAGS) $<
.mly.ml:
@$(OCAMLYACC) -q $< 2> /dev/null
diff --git a/testsuite/makefiles/Makefile.okbad b/testsuite/makefiles/Makefile.okbad
index e57d6d021..2a0bb324a 100644
--- a/testsuite/makefiles/Makefile.okbad
+++ b/testsuite/makefiles/Makefile.okbad
@@ -23,8 +23,9 @@ compile:
test -f $$F.mli && $(OCAMLC) -c -w a $$F.mli; \
$(OCAMLC) -c -w a $$file 2>/dev/null \
&& if [ -f $$F.reference ]; then \
- $(OCAMLC) $$F.cmo \
- && ./a.out >$$F.result \
+ rm -f program.byte; \
+ $(OCAMLC) $$F.cmo -o program.byte \
+ && $(OCAMLRUN) program.byte >$$F.result \
&& $(DIFF) $$F.reference $$F.result >/dev/null; \
fi \
&& echo " => passed" || echo " => failed"; \
@@ -36,4 +37,4 @@ promote: defaultpromote
.PHONY: clean
clean: defaultclean
- @rm -f ./a.out *.cm* *.result
+ @rm -f program.byte *.cm* *.result
diff --git a/testsuite/makefiles/Makefile.one b/testsuite/makefiles/Makefile.one
index 527f3dd0e..5acfc5b6d 100644
--- a/testsuite/makefiles/Makefile.one
+++ b/testsuite/makefiles/Makefile.one
@@ -27,11 +27,13 @@ GENERATED_SOURCES=$(ML_LEX_FILES) $(ML_YACC_FILES) $(MLI_YACC_FILES)
CUSTOM_FLAG=`if [ -n "$(C_FILES)" ]; then echo '-custom'; fi`
ADD_CFLAGS+=$(CUSTOM_FLAG)
+MYRUNTIME=`if [ -z "$(C_FILES)" ]; then echo '$(OCAMLRUN)'; fi`
CC=$(NATIVECC) $(NATIVECCCOMPOPTS)
.PHONY: default
-default: compile run
+default:
+ @LD_LIBRARY_PATH='$(LD_LIBRARY_PATH)' $(MAKE) compile run
.PHONY: compile
compile: $(ML_FILES) $(CMO_FILES) $(MAIN_MODULE).cmo
@@ -39,12 +41,13 @@ compile: $(ML_FILES) $(CMO_FILES) $(MAIN_MODULE).cmo
$(NATIVECC) $(NATIVECCCOMPOPTS) -c -I$(CTOPDIR)/byterun $$file.c; \
done;
@rm -f program.byte program.byte.exe
- @$(OCAMLC) $(ADD_COMPFLAGS) $(ADD_CFLAGS) -o program.byte $(O_FILES) \
- $(CMA_FILES) $(CMO_FILES) $(ADD_CMO_FILES) $(MAIN_MODULE).cmo
+ @$(OCAMLC) $(ADD_COMPFLAGS) $(ADD_CFLAGS) -o program.byte$(EXE) \
+ $(O_FILES) $(CMA_FILES) $(CMO_FILES) $(ADD_CMO_FILES) \
+ $(MAIN_MODULE).cmo
@if $(BYTECODE_ONLY); then : ; else \
rm -f program.native program.native.exe; \
$(MAKE) $(CMX_FILES) $(MAIN_MODULE).cmx; \
- $(OCAMLOPT) $(ADD_COMPFLAGS) -o program.native $(O_FILES) \
+ $(OCAMLOPT) $(ADD_COMPFLAGS) -o program.native$(EXE) $(O_FILES) \
$(CMXA_FILES) $(CMX_FILES) $(ADD_CMX_FILES) \
$(MAIN_MODULE).cmx; \
fi
@@ -52,11 +55,11 @@ compile: $(ML_FILES) $(CMO_FILES) $(MAIN_MODULE).cmo
.PHONY: run
run:
@printf " ... testing with ocamlc"
- @./program.byte $(EXEC_ARGS) >$(MAIN_MODULE).result \
+ @$(MYRUNTIME) ./program.byte$(EXE) $(EXEC_ARGS) >$(MAIN_MODULE).result\
&& $(DIFF) $(MAIN_MODULE).reference $(MAIN_MODULE).result >/dev/null \
&& if $(BYTECODE_ONLY); then : ; else \
printf " ocamlopt"; \
- ./program.native $(EXEC_ARGS) > $(MAIN_MODULE).result \
+ ./program.native$(EXE) $(EXEC_ARGS) > $(MAIN_MODULE).result \
&& $(DIFF) $(MAIN_MODULE).reference $(MAIN_MODULE).result \
>/dev/null; \
fi \
@@ -68,5 +71,6 @@ promote: defaultpromote
.PHONY: clean
clean: defaultclean
- @rm -f *.result program program.exe $(GENERATED_SOURCES) $(O_FILES) \
- $(TEST_TEMP_FILES)
+ @rm -f *.result program.byte program.byte.exe \
+ program.native program.native.exe \
+ $(GENERATED_SOURCES) $(O_FILES) $(TEST_TEMP_FILES)
diff --git a/testsuite/makefiles/Makefile.several b/testsuite/makefiles/Makefile.several
index f9c5878a9..f5b49ffe4 100644
--- a/testsuite/makefiles/Makefile.several
+++ b/testsuite/makefiles/Makefile.several
@@ -20,6 +20,7 @@ O_FILES=$(C_FILES:=.o)
CUSTOM_FLAG=`if [ -n "$(C_FILES)" ]; then echo '-custom'; fi`
ADD_CFLAGS+=$(CUSTOM_FLAG)
+MYRUNTIME=`if [ -z "$(C_FILES)" ]; then echo '$(OCAMLRUN)'; fi`
FORTRAN_LIB=`if [ -n "$(F_FILES)" ]; then echo '$(FORTRAN_LIBRARY)'; fi`
ADD_CFLAGS+=$(FORTRAN_LIB)
ADD_OPTFLAGS+=$(FORTRAN_LIB)
@@ -27,7 +28,7 @@ ADD_OPTFLAGS+=$(FORTRAN_LIB)
.PHONY: check
check:
@if [ -n "$(FORTRAN_COMPILER)" -o -z "$(F_FILES)" ]; then \
- $(MAKE) run-all; \
+ LD_LIBRARY_PATH='$(LD_LIBRARY_PATH)' $(MAKE) run-all; \
fi
.PHONY: run-all
@@ -44,6 +45,7 @@ run-all:
fi; \
printf " ... testing '$$file':"; \
$(MAKE) run-file DESC=ocamlc COMP='$(OCAMLC)' \
+ RUNTIME='$(MYRUNTIME)' \
COMPFLAGS='-w a $(ADD_COMPFLAGS) $(ADD_CFLAGS) $(O_FILES) \
$(CMA_FILES) -I $(OTOPDIR)/testsuite/lib \
$(CMO_FILES)' \
@@ -51,14 +53,16 @@ run-all:
&& \
if $(BYTECODE_ONLY); then : ; else \
$(MAKE) run-file DESC=ocamlopt COMP='$(OCAMLOPT)' \
- COMPFLAGS='-w a $(ADD_COMPFLAGS) $(ADD_OPTFLAGS) $(O_FILES)\
- $(CMXA_FILES) -I $(OTOPDIR)/testsuite/lib \
- $(CMX_FILES)' \
+ RUNTIME= \
+ COMPFLAGS='-w a $(ADD_COMPFLAGS) $(ADD_OPTFLAGS) \
+ $(O_FILES) $(CMXA_FILES) \
+ -I $(OTOPDIR)/testsuite/lib $(CMX_FILES)' \
FILE=$$file PROGRAM_ARGS=$(PROGRAM_ARGS); \
fi \
&& \
if [ -n "$(UNSAFE)" ]; then \
$(MAKE) run-file DESC=ocamlc-unsafe COMP='$(OCAMLC)' \
+ RUNTIME='$(MYRUNTIME)' \
COMPFLAGS='-w a -unsafe $(ADD_COMPFLAGS) $(ADD_CFLAGS) \
$(O_FILES) $(CMA_FILES) \
-I $(OTOPDIR)/testsuite/lib $(CMO_FILES)' \
@@ -66,9 +70,10 @@ run-all:
&& \
if $(BYTECODE_ONLY); then : ; else \
$(MAKE) run-file DESC=ocamlopt-unsafe COMP='$(OCAMLOPT)' \
- COMPFLAGS='-w a -unsafe $(ADD_COMPFLAGS) $(ADD_OPTFLAGS) \
- $(O_FILES) $(CMXA_FILES) -I $(OTOPDIR)/testsuite/lib \
- $(CMX_FILES)' \
+ RUNTIME= \
+ COMPFLAGS='-w a -unsafe $(ADD_COMPFLAGS) $(ADD_OPTFLAGS)\
+ $(O_FILES) $(CMXA_FILES) \
+ -I $(OTOPDIR)/testsuite/lib $(CMX_FILES)' \
FILE=$$file; \
fi; \
fi \
@@ -82,9 +87,9 @@ run-file:
@$(COMP) $(COMPFLAGS) $(FILE) -o program$(EXE)
@F="`basename $(FILE) .ml`"; \
if [ -f $$F.runner ]; then \
- sh $$F.runner; \
+ RUNTIME="$(RUNTIME)" sh $$F.runner; \
else \
- ./program$(EXE) $(PROGRAM_ARGS) > $$F.result; \
+ $(RUNTIME) ./program$(EXE) $(PROGRAM_ARGS) >$$F.result; \
fi \
&& \
if [ -f $$F.checker ]; then \
diff --git a/testsuite/tests/callback/Makefile b/testsuite/tests/callback/Makefile
index d8ab9c4f8..c7c28b844 100644
--- a/testsuite/tests/callback/Makefile
+++ b/testsuite/tests/callback/Makefile
@@ -14,34 +14,45 @@ BASEDIR=../..
CC=$(NATIVECC) -I $(CTOPDIR)/byterun
+COMPFLAGS=-I $(OTOPDIR)/otherlibs/unix
+
+.PHONY: default
default:
@case " $(OTHERLIBRARIES) " in \
- *' unix '*) $(MAKE) run-byte run-opt;; \
+ *' unix '*) LD_LIBRARY_PATH='$(OTOPDIR)/otherlibs/unix' \
+ $(MAKE) run-byte run-opt;; \
esac
+.PHONY: common
common:
@$(CC) -c callbackprim.c
+.PHONY: run-byte
run-byte: common
@printf " ... testing 'bytecode':"
- @$(OCAMLC) -c tcallback.ml
- @$(OCAMLC) -o ./program -custom unix.cma callbackprim.$(O) tcallback.cmo
+ @$(OCAMLC) $(COMPFLAGS) -c tcallback.ml
+ @$(OCAMLC) $(COMPFLAGS) -o ./program -custom unix.cma \
+ callbackprim.$(O) tcallback.cmo
@./program >bytecode.result
@$(DIFF) reference bytecode.result \
&& echo " => passed" || echo " => failed"
+.PHONY: run-opt
run-opt: common
@if $(BYTECODE_ONLY); then : ; else \
printf " ... testing 'native':"; \
- $(OCAMLOPT) -c tcallback.ml; \
- $(OCAMLOPT) -o ./program unix.cmxa callbackprim.$(O) tcallback.cmx; \
+ $(OCAMLOPT) $(COMPFLAGS) -c tcallback.ml; \
+ $(OCAMLOPT) $(COMPFLAGS) -o ./program unix.cmxa callbackprim.$(O) \
+ tcallback.cmx; \
./program >native.result; \
$(DIFF) reference native.result \
&& echo " => passed" || echo " => failed"; \
fi
+.PHONY: promote
promote: defaultpromote
+.PHONY: clean
clean: defaultclean
@rm -f *.result ./program
diff --git a/testsuite/tests/lib-bigarray/Makefile b/testsuite/tests/lib-bigarray/Makefile
index bee3ca550..c799d79be 100644
--- a/testsuite/tests/lib-bigarray/Makefile
+++ b/testsuite/tests/lib-bigarray/Makefile
@@ -12,6 +12,8 @@
BASEDIR=../..
LIBRARIES=unix bigarray
+ADD_COMPFLAGS=-I $(OTOPDIR)/otherlibs/unix -I $(OTOPDIR)/otherlibs/bigarray
+LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/unix:$(OTOPDIR)/otherlibs/bigarray
include $(BASEDIR)/makefiles/Makefile.several
include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/lib-dynlink-bytecode/Makefile b/testsuite/tests/lib-dynlink-bytecode/Makefile
index 0c8d877c2..95ae89935 100644
--- a/testsuite/tests/lib-dynlink-bytecode/Makefile
+++ b/testsuite/tests/lib-dynlink-bytecode/Makefile
@@ -12,8 +12,11 @@
BASEDIR=../..
+COMPFLAGS=-I $(OTOPDIR)/otherlibs/dynlink
+
.PHONY: default
-default: compile run
+default:
+ @LD_LIBRARY_PATH='$(OTOPDIR)/otherlibs/dynlink' $(MAKE) compile run
.PHONY: compile
compile:
diff --git a/testsuite/tests/lib-dynlink-csharp/Makefile b/testsuite/tests/lib-dynlink-csharp/Makefile
index bbd141ac1..f7860ef6c 100644
--- a/testsuite/tests/lib-dynlink-csharp/Makefile
+++ b/testsuite/tests/lib-dynlink-csharp/Makefile
@@ -13,17 +13,23 @@
BASEDIR=../..
CSC=csc
+COMPFLAGS=-I $(OTOPDIR)/otherlibs/bigarray
+
+.PHONY: default
default:
@if $(BYTECODE_ONLY); then : ; else \
- $(MAKE) all; \
+ LD_LIBRARY_PATH='$(OTOPDIR)/otherlibs/bigarray' $(MAKE) all; \
fi
+.PHONY: all
all: prepare bytecode bytecode-dll native native-dll
+.PHONY: prepare
prepare:
@$(OCAMLC) -c plugin.ml
@$(OCAMLOPT) -o plugin.cmxs -shared plugin.ml
+.PHONY: bytecode
bytecode:
@printf " ... testing 'bytecode':"
@if [ ! `which $(CSC) >/dev/null 2>&1` ]; then \
@@ -36,6 +42,7 @@ bytecode:
&& echo " => passed" || echo " => failed"; \
fi
+.PHONY: bytecode-dll
bytecode-dll:
@printf " ... testing 'bytecode-dll':"
@if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
@@ -50,6 +57,7 @@ bytecode-dll:
&& echo " => passed" || echo " => failed"; \
fi
+.PHONY: native
native:
@printf " ... testing 'native':"
@if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
@@ -62,6 +70,7 @@ native:
&& echo " => passed" || echo " => failed"; \
fi
+.PHONY: native-dll
native-dll:
@printf " ... testing 'native-dll':"
@if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
@@ -77,8 +86,10 @@ native-dll:
&& echo " => passed" || echo " => failed"; \
fi
+.PHONY: promote
promote: defaultpromote
+.PHONY: clean
clean: defaultclean
@rm -f *.result *.exe *.dll
diff --git a/testsuite/tests/lib-dynlink-native/Makefile b/testsuite/tests/lib-dynlink-native/Makefile
index 4aa326299..0bf450d1b 100644
--- a/testsuite/tests/lib-dynlink-native/Makefile
+++ b/testsuite/tests/lib-dynlink-native/Makefile
@@ -12,12 +12,17 @@
BASEDIR=../..
+COMPFLAGS=-I $(OTOPDIR)/otherlibs/unix -I $(OTOPDIR)/otherlibs/systhreads \
+ -I $(OTOPDIR)/otherlibs/dynlink
+LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/unix:$(OTOPDIR)/otherlibs/systhreads:$(OTOPDIR)/otherlibs/dynlink
+.PHONY: default
default:
@if $(BYTECODE_ONLY); then : ; else \
- $(MAKE) all; \
+ LD_LIBRARY_PATH='$(LD_LIBRARY_PATH)' $(MAKE) all; \
fi
+.PHONY: all
all: compile run
PLUGINS=plugin.so plugin2.so sub/plugin.so sub/plugin3.so plugin4.so \
@@ -27,8 +32,10 @@ PLUGINS=plugin.so plugin2.so sub/plugin.so sub/plugin3.so plugin4.so \
ADD_COMPFLAGS=-thread
+.PHONY: compile
compile: $(PLUGINS) main$(EXE) mylib.so
+.PHONY: run
run:
@printf " ... testing 'main'"
@./main$(EXE) plugin.so plugin2.so plugin_thread.so > result
@@ -46,32 +53,32 @@ main_ext$(EXE): api.cmx main.cmx factorial.$(O)
sub/plugin3.cmx: sub/api.cmi sub/api.cmx sub/plugin3.ml
@cd sub; \
mv api.cmx api.cmx.bak; \
- $(OCAMLOPT) -c $(COMPFLAGS) plugin3.ml; \
+ $(OCAMLOPT) -c plugin3.ml; \
mv api.cmx.bak api.cmx
plugin2.cmx: api.cmx plugin.cmi plugin.cmx
@mv plugin.cmx plugin.cmx.bak;
- @$(OCAMLOPT) -c $(COMPFLAGS) plugin2.ml
+ @$(OCAMLOPT) -c plugin2.ml
@mv plugin.cmx.bak plugin.cmx
sub/api.so: sub/api.cmi sub/api.ml
- @cd sub; $(OCAMLOPT) -c $(COMPFLAGS) $(SHARED) api.ml
+ @cd sub; $(OCAMLOPT) -c $(SHARED) api.ml
sub/api.cmi: sub/api.mli
- @cd sub; $(OCAMLOPT) -c $(COMPFLAGS) api.mli
+ @cd sub; $(OCAMLOPT) -c api.mli
sub/api.cmx: sub/api.cmi sub/api.ml
- @cd sub; $(OCAMLOPT) -c $(COMPFLAGS) api.ml
+ @cd sub; $(OCAMLOPT) -c api.ml
plugin.cmx: api.cmx plugin.cmi
sub/plugin.cmx: api.cmx
plugin4.cmx: api.cmx
main.cmx: api.cmx
plugin_ext.cmx: api.cmx plugin_ext.ml
- @$(OCAMLOPT) -c $(COMPFLAGS) plugin_ext.ml
+ @$(OCAMLOPT) -c plugin_ext.ml
plugin_ext.so: factorial.$(O) plugin_ext.cmx
- @$(OCAMLOPT) $(COMPFLAGS) -shared -o plugin_ext.so factorial.$(O) \
+ @$(OCAMLOPT) -shared -o plugin_ext.so factorial.$(O) \
plugin_ext.cmx
plugin4_unix.so: plugin4.cmx
@@ -93,9 +100,11 @@ mylib.cmxa: plugin.cmx plugin2.cmx
factorial.$(O): factorial.c
@$(OCAMLOPT) -c -ccopt "$(SHAREDCCCOMPOPTS)" factorial.c
+.PHONY: promote
promote:
@cp result reference
+.PHONY: clean
clean: defaultclean
@rm -f result *.so *.o *.cm* main main_ext *.exe *.s *.asm *.obj
@rm -f *.a *.lib
diff --git a/testsuite/tests/lib-num-2/Makefile b/testsuite/tests/lib-num-2/Makefile
index 3011f1e41..ed92006ee 100644
--- a/testsuite/tests/lib-num-2/Makefile
+++ b/testsuite/tests/lib-num-2/Makefile
@@ -12,6 +12,8 @@
BASEDIR=../..
LIBRARIES=nums
+ADD_COMPFLAGS=-I $(OTOPDIR)/otherlibs/num
+LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/num
PROGRAM_ARGS=1000
include $(BASEDIR)/makefiles/Makefile.several
diff --git a/testsuite/tests/lib-num/Makefile b/testsuite/tests/lib-num/Makefile
index ed4b0d125..6e3635b65 100644
--- a/testsuite/tests/lib-num/Makefile
+++ b/testsuite/tests/lib-num/Makefile
@@ -13,8 +13,9 @@
BASEDIR=../..
MODULES=test test_nats test_big_ints test_ratios test_nums test_io
MAIN_MODULE=end_test
-ADD_COMPFLAGS=-w a
LIBRARIES=nums
+ADD_COMPFLAGS=-w a -I $(OTOPDIR)/otherlibs/num
+LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/num
include $(BASEDIR)/makefiles/Makefile.one
include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/lib-scanf-2/Makefile b/testsuite/tests/lib-scanf-2/Makefile
index 067f3323b..0d907ed8a 100644
--- a/testsuite/tests/lib-scanf-2/Makefile
+++ b/testsuite/tests/lib-scanf-2/Makefile
@@ -12,8 +12,11 @@
BASEDIR=../..
+COMPFLAGS=-I $(OTOPDIR)/otherlibs/unix
+
.PHONY: default
-default: compile run
+default:
+ @LD_LIBRARY_PATH='$(OTOPDIR)/otherlibs/unix' $(MAKE) compile run
.PHONY: compile
compile: tscanf2_io.cmo
diff --git a/testsuite/tests/lib-str/Makefile b/testsuite/tests/lib-str/Makefile
index 4f78a9714..93d96f36f 100644
--- a/testsuite/tests/lib-str/Makefile
+++ b/testsuite/tests/lib-str/Makefile
@@ -12,6 +12,8 @@
BASEDIR=../..
LIBRARIES=str
+ADD_COMPFLAGS=-I $(OTOPDIR)/otherlibs/str
+LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/str
include $(BASEDIR)/makefiles/Makefile.several
include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/lib-systhreads/Makefile b/testsuite/tests/lib-systhreads/Makefile
index 7e5ce838f..5be187d85 100644
--- a/testsuite/tests/lib-systhreads/Makefile
+++ b/testsuite/tests/lib-systhreads/Makefile
@@ -12,7 +12,9 @@
BASEDIR=../..
LIBRARIES=unix threads
-ADD_COMPFLAGS=-thread
+ADD_COMPFLAGS=-thread -I $(OTOPDIR)/otherlibs/systhreads \
+ -I $(OTOPDIR)/otherlibs/unix
+LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/unix:$(OTOPDIR)/otherlibs/systhreads
include $(BASEDIR)/makefiles/Makefile.several
include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/lib-threads/Makefile b/testsuite/tests/lib-threads/Makefile
index 7e5ce838f..5be187d85 100644
--- a/testsuite/tests/lib-threads/Makefile
+++ b/testsuite/tests/lib-threads/Makefile
@@ -12,7 +12,9 @@
BASEDIR=../..
LIBRARIES=unix threads
-ADD_COMPFLAGS=-thread
+ADD_COMPFLAGS=-thread -I $(OTOPDIR)/otherlibs/systhreads \
+ -I $(OTOPDIR)/otherlibs/unix
+LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/unix:$(OTOPDIR)/otherlibs/systhreads
include $(BASEDIR)/makefiles/Makefile.several
include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/tool-ocamldoc/Makefile b/testsuite/tests/tool-ocamldoc/Makefile
index ec97aa1e1..efebc25c1 100644
--- a/testsuite/tests/tool-ocamldoc/Makefile
+++ b/testsuite/tests/tool-ocamldoc/Makefile
@@ -12,20 +12,25 @@
BASEDIR=../..
CUSTOM_MODULE=odoc_test
-ADD_COMPFLAGS=-I +ocamldoc
+COMPFLAGS=-I $(OTOPDIR)/ocamldoc
+LD_LIBRARY_PATH=$(OTOPDIR)/otherlibs/unix:$(OTOPDIR)/otherlibs/str
+DOCFLAGS=-I $(OTOPDIR)/stdlib $(COMPFLAGS)
+
+default:
+ @LD_LIBRARY_PATH='$(LD_LIBRARY_PATH)' $(MAKE) run
run: $(CUSTOM_MODULE).cmo
@for file in t*.ml; do \
printf " ... testing '$$file'"; \
F="`basename $$file .ml`"; \
- $(OCAMLDOC) -hide-warnings -g $(CUSTOM_MODULE).cmo -o $$F.result \
- $$file; \
+ $(OCAMLDOC) $(DOCFLAGS) -hide-warnings -g $(CUSTOM_MODULE).cmo \
+ -o $$F.result $$file; \
$(DIFF) $$F.reference $$F.result >/dev/null \
&& echo " => passed" || echo " => failed"; \
done;
- @$(OCAMLDOC) -hide-warnings -html t*.ml 2>&1 \
+ @$(OCAMLDOC) $(DOCFLAGS) -hide-warnings -html t*.ml 2>&1 \
| grep -v test_types_display || true
- @$(OCAMLDOC) -hide-warnings -latex t*.ml 2>&1 \
+ @$(OCAMLDOC) $(DOCFLAGS) -hide-warnings -latex t*.ml 2>&1 \
| grep -v test_types_display || true
promote: defaultpromote