testsuite: simplification of the BYTECODE_ONLY macro
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13672 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
09812d00fb
commit
c2b3a61ef9
|
@ -10,15 +10,19 @@
|
|||
# #
|
||||
#########################################################################
|
||||
|
||||
.PHONY: compile
|
||||
compile: compile-targets
|
||||
|
||||
.PHONY: promote
|
||||
promote: defaultpromote
|
||||
|
||||
.PHONY: clean
|
||||
clean: defaultclean
|
||||
|
||||
include ../makefiles/Makefile.common
|
||||
|
||||
.PHONY: compile-targets
|
||||
compile-targets: testing.cmi testing.cmo
|
||||
@if [ -z "$(BYTECODE_ONLY)" ]; then \
|
||||
@if $(BYTECODE_ONLY); then : ; else \
|
||||
$(MAKE) testing.cmx; \
|
||||
fi
|
||||
|
|
|
@ -48,7 +48,8 @@ OCAMLMKLIB=$(OCAMLRUN) $(OTOPDIR)/tools/ocamlmklib
|
|||
OCAMLYACC=$(TOPDIR)/yacc/ocamlyacc$(EXE)
|
||||
OCAMLBUILD=$(TOPDIR)/_build/ocamlbuild/ocamlbuild.native
|
||||
DUMPOBJ=$(OCAMLRUN) $(OTOPDIR)/tool/dumpobj
|
||||
BYTECODE_ONLY=`if [ "$(ARCH)" = "none" -o "$(ASM)" = "none" ]; then echo 'YES'; fi`
|
||||
BYTECODE_ONLY=[ "$(ARCH)" = "none" -o "$(ASM)" = "none" ]
|
||||
|
||||
#COMPFLAGS=
|
||||
#FORTRAN_COMPILER=
|
||||
#FORTRAN_LIBRARY=
|
||||
|
|
|
@ -41,7 +41,7 @@ compile: $(ML_FILES) $(CMO_FILES) $(MAIN_MODULE).cmo
|
|||
@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
|
||||
@if [ -z "$(BYTECODE_ONLY)" ]; then \
|
||||
@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) \
|
||||
|
@ -54,7 +54,7 @@ run:
|
|||
@printf " ... testing with ocamlc"
|
||||
@./program.byte $(EXEC_ARGS) >$(MAIN_MODULE).result \
|
||||
&& $(DIFF) $(MAIN_MODULE).reference $(MAIN_MODULE).result >/dev/null \
|
||||
&& if [ -z "$(BYTECODE_ONLY)" ]; then \
|
||||
&& if $(BYTECODE_ONLY); then : ; else \
|
||||
printf " ocamlopt"; \
|
||||
./program.native $(EXEC_ARGS) > $(MAIN_MODULE).result \
|
||||
&& $(DIFF) $(MAIN_MODULE).reference $(MAIN_MODULE).result \
|
||||
|
|
|
@ -49,7 +49,7 @@ run-all:
|
|||
$(CMO_FILES)' \
|
||||
FILE=$$file PROGRAM_ARGS=$(PROGRAM_ARGS) \
|
||||
&& \
|
||||
if [ -z "$(BYTECODE_ONLY)" ]; then \
|
||||
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 \
|
||||
|
@ -64,7 +64,7 @@ run-all:
|
|||
-I $(OTOPDIR)/testsuite/lib $(CMO_FILES)' \
|
||||
FILE=$$file \
|
||||
&& \
|
||||
if [ -z "$(BYTECODE_ONLY)" ]; then \
|
||||
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 \
|
||||
|
|
|
@ -111,7 +111,7 @@ OBJS=parsecmmaux.cmo parsecmm.cmo lexcmm.cmo
|
|||
ADD_COMPFLAGS=$(INCLUDES) -g
|
||||
|
||||
default:
|
||||
@if [ -z "$(BYTECODE_ONLY)" -a -n "$(ASPP)" ]; then \
|
||||
@if $(BYTECODE_ONLY) || [ -z "$(ASPP)" ]; then : ; else \
|
||||
$(MAKE) all; \
|
||||
fi
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ run-byte: common
|
|||
&& echo " => passed" || echo " => failed"
|
||||
|
||||
run-opt: common
|
||||
@if [ -z "$(BYTECODE_ONLY)" ]; then \
|
||||
@if $(BYTECODE_ONLY); then : ; else \
|
||||
printf " ... testing 'native':"; \
|
||||
$(OCAMLOPT) -c tcallback.ml; \
|
||||
$(OCAMLOPT) -o ./program unix.cmxa callbackprim.$(O) tcallback.cmx; \
|
||||
|
|
|
@ -14,7 +14,7 @@ BASEDIR=../..
|
|||
CSC=csc
|
||||
|
||||
default:
|
||||
@if [ -z "$(BYTECODE_ONLY)" ]; then \
|
||||
@if $(BYTECODE_ONLY); then : ; else \
|
||||
$(MAKE) all; \
|
||||
fi
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ BASEDIR=../..
|
|||
|
||||
|
||||
default:
|
||||
@if [ -z "$(BYTECODE_ONLY)" ]; then \
|
||||
@if $(BYTECODE_ONLY); then : ; else \
|
||||
$(MAKE) all; \
|
||||
fi
|
||||
|
||||
|
|
|
@ -17,9 +17,10 @@ default: compile run
|
|||
compile: tscanf2_io.cmo
|
||||
@$(OCAMLC) unix.cma tscanf2_io.cmo -o master.byte tscanf2_master.ml
|
||||
@$(OCAMLC) tscanf2_io.cmo -o slave.byte tscanf2_slave.ml
|
||||
@if [ -z "$(BYTECODE_ONLY)" ]; then \
|
||||
@if $(BYTECODE_ONLY); then : ; else \
|
||||
$(MAKE) tscanf2_io.cmx; \
|
||||
$(OCAMLOPT) unix.cmxa tscanf2_io.cmx -o master.native tscanf2_master.ml; \
|
||||
$(OCAMLOPT) unix.cmxa tscanf2_io.cmx -o master.native \
|
||||
tscanf2_master.ml; \
|
||||
$(OCAMLOPT) tscanf2_io.cmx -o slave.native tscanf2_slave.ml; \
|
||||
fi
|
||||
|
||||
|
@ -27,7 +28,7 @@ run:
|
|||
@printf " ... testing with ocamlc"
|
||||
@./master.byte "`$(CYGPATH) ./slave.byte`" >result.byte 2>&1
|
||||
@$(DIFF) reference result.byte >/dev/null \
|
||||
&& if [ -z "$(BYTECODE_ONLY)" ]; then \
|
||||
&& if $(BYTECODE_ONLY); then : ; else \
|
||||
printf " ocamlopt"; \
|
||||
./master.native "`$(CYGPATH) ./slave.native`" >result.native 2>&1;\
|
||||
$(DIFF) reference result.native >/dev/null; \
|
||||
|
|
|
@ -17,11 +17,12 @@ default: compile run
|
|||
compile:
|
||||
@for f in *.ml; do \
|
||||
$(OCAMLC) -w a -o `basename $$f ml`bytecode $$f; \
|
||||
test -z "$(BYTECODE_ONLY)" && $(OCAMLOPT) -w a -o `basename $$f ml`native $$f || true; \
|
||||
if $(BYTECODE_ONLY); then : ; else \
|
||||
$(OCAMLOPT) -w a -o `basename $$f ml`native $$f; \
|
||||
fi; \
|
||||
done
|
||||
@if [ `grep -c HAS_STACK_OVERFLOW_DETECTION ../../../config/s.h` -eq 0 ]; then \
|
||||
rm -f stackoverflow.native || true; \
|
||||
fi
|
||||
@grep -q HAS_STACK_OVERFLOW_DETECTION $(TOPDIR)/config/s.h \
|
||||
|| rm -f stackoverflow.native
|
||||
|
||||
run:
|
||||
@ulimit -s 1024; \
|
||||
|
@ -31,7 +32,7 @@ run:
|
|||
DIFF="$(DIFF)" sh $$f.checker \
|
||||
&& echo " => passed" || echo " => failed"; \
|
||||
fn=`basename $$f bytecode`native; \
|
||||
if [ -z "$(BYTECODE_ONLY)" -a -f "$$fn" ]; then \
|
||||
if $(BYTECODE_ONLY) || [ ! -f "$$fn" ] ; then : ; else \
|
||||
printf " ... testing '$$fn':"; \
|
||||
(./$$fn > $$fn.result 2>&1 || true); \
|
||||
DIFF="$(DIFF)" sh $$fn.checker \
|
||||
|
|
Loading…
Reference in New Issue