Skip to content

Commit

Permalink
Merge testsuite/tools/Makefile into the root Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
shindere committed Nov 30, 2023
1 parent ca3ee4c commit c8cb87b
Show file tree
Hide file tree
Showing 18 changed files with 233 additions and 136 deletions.
117 changes: 117 additions & 0 deletions .depend
Original file line number Diff line number Diff line change
Expand Up @@ -9496,3 +9496,120 @@ testsuite/lib/testing.cmo : \
testsuite/lib/testing.cmx : \
testsuite/lib/testing.cmi
testsuite/lib/testing.cmi :
testsuite/tools/codegen_main.cmo : \
utils/profile.cmi \
testsuite/tools/parsecmmaux.cmi \
testsuite/tools/parsecmm.cmi \
testsuite/tools/lexcmm.cmi \
asmcomp/emitaux.cmi \
asmcomp/emit.cmi \
middle_end/compilenv.cmi \
utils/clflags.cmi \
asmcomp/asmgen.cmi \
testsuite/tools/codegen_main.cmi
testsuite/tools/codegen_main.cmx : \
utils/profile.cmx \
testsuite/tools/parsecmmaux.cmx \
testsuite/tools/parsecmm.cmx \
testsuite/tools/lexcmm.cmx \
asmcomp/emitaux.cmx \
asmcomp/emit.cmx \
middle_end/compilenv.cmx \
utils/clflags.cmx \
asmcomp/asmgen.cmx \
testsuite/tools/codegen_main.cmi
testsuite/tools/codegen_main.cmi :
testsuite/tools/expect.cmo : \
utils/warnings.cmi \
toplevel/toploop.cmi \
parsing/printast.cmi \
parsing/pprintast.cmi \
parsing/parsetree.cmi \
parsing/parse.cmi \
utils/misc.cmi \
driver/main_args.cmi \
parsing/location.cmi \
utils/load_path.cmi \
driver/compmisc.cmi \
driver/compenv.cmi \
utils/clflags.cmi \
typing/btype.cmi \
parsing/asttypes.cmi \
parsing/ast_mapper.cmi \
testsuite/tools/expect.cmi
testsuite/tools/expect.cmx : \
utils/warnings.cmx \
toplevel/toploop.cmx \
parsing/printast.cmx \
parsing/pprintast.cmx \
parsing/parsetree.cmi \
parsing/parse.cmx \
utils/misc.cmx \
driver/main_args.cmx \
parsing/location.cmx \
utils/load_path.cmx \
driver/compmisc.cmx \
driver/compenv.cmx \
utils/clflags.cmx \
typing/btype.cmx \
parsing/asttypes.cmi \
parsing/ast_mapper.cmx \
testsuite/tools/expect.cmi
testsuite/tools/expect.cmi : \
parsing/location.cmi
testsuite/tools/lexcmm.cmo : \
testsuite/tools/parsecmm.cmi \
utils/misc.cmi \
parsing/location.cmi \
lambda/lambda.cmi \
testsuite/tools/lexcmm.cmi
testsuite/tools/lexcmm.cmx : \
testsuite/tools/parsecmm.cmx \
utils/misc.cmx \
parsing/location.cmx \
lambda/lambda.cmx \
testsuite/tools/lexcmm.cmi
testsuite/tools/lexcmm.cmi : \
testsuite/tools/parsecmm.cmi
testsuite/tools/parsecmm.cmo : \
testsuite/tools/parsecmmaux.cmi \
utils/misc.cmi \
parsing/location.cmi \
lambda/lambda.cmi \
lambda/debuginfo.cmi \
utils/config.cmi \
asmcomp/cmm.cmi \
parsing/asttypes.cmi \
asmcomp/arch.cmi \
testsuite/tools/parsecmm.cmi
testsuite/tools/parsecmm.cmx : \
testsuite/tools/parsecmmaux.cmx \
utils/misc.cmx \
parsing/location.cmx \
lambda/lambda.cmx \
lambda/debuginfo.cmx \
utils/config.cmx \
asmcomp/cmm.cmx \
parsing/asttypes.cmi \
asmcomp/arch.cmx \
testsuite/tools/parsecmm.cmi
testsuite/tools/parsecmm.cmi : \
parsing/location.cmi \
lambda/lambda.cmi \
asmcomp/cmm.cmi
testsuite/tools/parsecmmaux.cmo : \
parsing/location.cmi \
lambda/lambda.cmi \
lambda/debuginfo.cmi \
middle_end/backend_var.cmi \
testsuite/tools/parsecmmaux.cmi
testsuite/tools/parsecmmaux.cmx : \
parsing/location.cmx \
lambda/lambda.cmx \
lambda/debuginfo.cmx \
middle_end/backend_var.cmx \
testsuite/tools/parsecmmaux.cmi
testsuite/tools/parsecmmaux.cmi : \
parsing/location.cmi \
lambda/debuginfo.cmi \
middle_end/backend_var.cmi
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,7 @@ META
/ocamldoc/odoc_text_parser.ml
/ocamldoc/odoc_text_parser.mli
/ocamldoc/*.output
/ocamldoc/test_stdlib
/ocamldoc/test_latex
/ocamldoc/test

/ocamltest/.dep
/ocamltest/ocamltest
/ocamltest/ocamltest.opt
/ocamltest/ocamltest_config.ml
Expand Down Expand Up @@ -273,9 +269,8 @@ META

/testsuite/_retries


/testsuite/tools/codegen
/testsuite/tools/expect_test
/testsuite/tools/expect
/testsuite/tools/lexcmm.ml
/testsuite/tools/parsecmm.ml
/testsuite/tools/parsecmm.mli
Expand Down
44 changes: 39 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -540,14 +540,15 @@ $(foreach PROGRAM, $(OCAML_PROGRAMS),\
OCAML_BYTECODE_PROGRAMS = expunge \
$(TOOLS_BYT_PROGRAMS) \
$(addprefix tools/, cvt_emit make_opcodes ocamltex) \
debugger/ocamldebug
$(OPTIONAL_BYTECODE_TOOLS)

$(foreach PROGRAM, $(OCAML_BYTECODE_PROGRAMS),\
$(eval $(call OCAML_BYTECODE_PROGRAM,$(PROGRAM))))

# OCaml programs that are compiled only in native code

OCAML_NATIVE_PROGRAMS = ocamlnat tools/lintapidiff.opt
OCAML_NATIVE_PROGRAMS = \
ocamlnat tools/lintapidiff.opt $(OPTIONAL_NATIVE_TOOLS)

$(foreach PROGRAM, $(OCAML_NATIVE_PROGRAMS),\
$(eval $(call OCAML_NATIVE_PROGRAM,$(PROGRAM))))
Expand Down Expand Up @@ -1806,7 +1807,7 @@ $(ocamltest_DEP_FILES): $(DEPDIR)/ocamltest/%.$(D): ocamltest/%.c
ocamltest/%: CAMLC = $(BEST_OCAMLC) $(STDLIBFLAGS)

ocamltest: ocamltest/ocamltest$(EXE) \
testsuite/lib/lib.cmo testsuite/lib/testing.cma
testsuite/lib/lib.cmo testsuite/lib/testing.cma testsuite/tools/expect$(EXE)

testsuite/lib/%: VPATH += testsuite/lib

Expand All @@ -1816,11 +1817,39 @@ testing_LIBRARIES =
$(addprefix testsuite/lib/testing., cma cmxa): \
OC_COMMON_LINKFLAGS += -linkall

testsuite/tools/%: VPATH += testsuite/tools

expect_SOURCES = $(addprefix testsuite/tools/,expect.mli expect.ml)
expect_LIBRARIES = $(addprefix compilerlibs/,\
ocamlcommon ocamlbytecomp ocamltoplevel)

testsuite/tools/expect$(EXE): OC_BYTECODE_LINKFLAGS += -linkall

codegen_SOURCES = $(addprefix testsuite/tools/,\
parsecmmaux.mli parsecmmaux.ml \
parsecmm.mly \
lexcmm.mli lexcmm.mll \
codegen_main.mli codegen_main.ml)
codegen_LIBRARIES = $(addprefix compilerlibs/,ocamlcommon ocamloptcomp)

# The asmgen tests are not ported to MSVC64 yet, so make sure
# to compile the arch specific module they require only if necessary
ifeq "$(CCOMPTYPE)-$(ARCH)" "msvc-amd64"
asmgen_OBJECT =
else
asmgen_MODULE = testsuite/tools/asmgen_$(ARCH)
asmgen_SOURCE = $(asmgen_MODULE).S
asmgen_OBJECT = $(asmgen_MODULE).$(O)
$(asmgen_OBJECT): $(asmgen_SOURCE)
$(V_ASM)$(ASPP) $(OC_ASPPFLAGS) -o $@ $< || $(ASPP_ERROR)
endif

ocamltest/ocamltest$(EXE): OC_BYTECODE_LINKFLAGS += -custom

ocamltest/ocamltest$(EXE): ocamlc ocamlyacc ocamllex

ocamltest.opt: ocamltest/ocamltest.opt$(EXE) testsuite/lib/testing.cmxa
ocamltest.opt: ocamltest/ocamltest.opt$(EXE) \
testsuite/lib/testing.cmxa $(asmgen_OBJECT) testsuite/tools/codegen$(EXE)

ocamltest/ocamltest.opt$(EXE): ocamlc.opt ocamlyacc ocamllex

Expand Down Expand Up @@ -1848,6 +1877,11 @@ partialclean::
rm -rf $(ocamltest_GENERATED_FILES)
rm -f ocamltest/ocamltest.html
rm -f $(addprefix testsuite/lib/*.,cm* o obj a lib)
rm -f $(addprefix testsuite/tools/*.,cm* o obj a lib)
rm -f testsuite/tools/codegen testsuite/tools/codegen.exe
rm -f testsuite/tools/expect testsuite/tools/expect.exe
rm -f testsuite/tools/lexcmm.ml
rm -f $(addprefix testsuite/tools/parsecmm., ml mli output)

# Documentation

Expand Down Expand Up @@ -2347,7 +2381,7 @@ depend: beforedepend
lambda file_formats middle_end/closure middle_end/flambda \
middle_end/flambda/base_types \
driver toplevel toplevel/byte toplevel/native lex tools debugger \
ocamldoc ocamltest testsuite/lib; \
ocamldoc ocamltest testsuite/lib testsuite/tools; \
do \
$(OCAMLDEP) $(OC_OCAMLDEPFLAGS) -I $$d $(INCLUDES) \
$(OCAMLDEPFLAGS) $$d/*.mli $$d/*.ml \
Expand Down
2 changes: 2 additions & 0 deletions Makefile.build_config.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ lib_systhreads = @lib_systhreads@
lib_unix = @lib_unix@

OPTIONAL_LIBRARIES = @optional_libraries@
OPTIONAL_BYTECODE_TOOLS = @optional_bytecode_tools@
OPTIONAL_NATIVE_TOOLS = @optional_native_tools@

# Whether to install the native toplevel (ocamlnat)
INSTALL_OCAMLNAT = @install_ocamlnat@
Expand Down
10 changes: 9 additions & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ lib_str=false
lib_systhreads=false
lib_unix=false
optional_libraries=''
optional_bytecode_tools=''
optional_native_tools=''
ocamltest_libunix=None
ocamltest_unix_impl="dummy"
unix_library=""
Expand Down Expand Up @@ -191,6 +193,8 @@ AC_SUBST([lib_str])
AC_SUBST([lib_systhreads])
AC_SUBST([lib_unix])
AC_SUBST([optional_libraries])
AC_SUBST([optional_bytecode_tools])
AC_SUBST([optional_native_tools])
AC_SUBST([ocamltest_CPP])
AC_SUBST([ocamltest_libunix])
AC_SUBST([unix_library])
Expand Down Expand Up @@ -2181,6 +2185,7 @@ AS_CASE([$enable_ocamldebug],
[AS_IF([$sockets],
[with_debugger="ocamldebug"
build_ocamldebug=true
optional_bytecode_tools="$optional_bytecode_tools debugger/ocamldebug"
AC_MSG_NOTICE([ocamldebug supported])],
[with_debugger=""
build_ocamldebug=false
Expand Down Expand Up @@ -2314,7 +2319,8 @@ AS_CASE([$enable_ocamltest,OCAML__DEVELOPMENT_VERSION],
ocamltest_target=ocamltest
ocamltest_opt_target=ocamltest.opt
ocamltest='ocamltest'
],
testsuite_tools='testsuite/tools/codegen testsuite/tools/expect'
optional_bytecode_tools="$optional_bytecode_tools $testsuite_tools"],
[build_ocamltest=false
ocamltest=''])

Expand Down
2 changes: 1 addition & 1 deletion ocamltest/ocaml_actions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ let run_expect_once input_file principal log env =
let principal_flag = if principal then "-principal" else "" in
let commandline =
[
Ocaml_commands.ocamlrun_expect_test;
Ocaml_commands.ocamlrun_expect;
expect_flags;
flags env;
repo_root;
Expand Down
4 changes: 2 additions & 2 deletions ocamltest/ocaml_commands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ let ocamlrun_ocamlopt = ocamlrun Ocaml_files.ocamlopt

let ocamlrun_ocaml = ocamlrun Ocaml_files.ocaml

let ocamlrun_expect_test =
ocamlrun Ocaml_files.expect_test
let ocamlrun_expect =
ocamlrun Ocaml_files.expect

let ocamlrun_ocamllex = ocamlrun Ocaml_files.ocamllex

Expand Down
2 changes: 1 addition & 1 deletion ocamltest/ocaml_commands.mli
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ val ocamlrun_ocamlopt : string

val ocamlrun_ocaml : string

val ocamlrun_expect_test : string
val ocamlrun_expect : string

val ocamlrun_ocamllex : string

Expand Down
4 changes: 2 additions & 2 deletions ocamltest/ocaml_files.ml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ let cmpbyt =
Filename.make_path
[Ocaml_directories.srcdir; "tools"; Filename.mkexe "cmpbyt"]

let expect_test =
let expect =
Filename.make_path
[Ocaml_directories.srcdir; "testsuite"; "tools";
Filename.mkexe "expect_test"]
Filename.mkexe "expect"]

let ocamllex =
Filename.make_path
Expand Down
2 changes: 1 addition & 1 deletion ocamltest/ocaml_files.mli
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ val ocamlnat : string

val cmpbyt : string

val expect_test : string
val expect : string

val ocamllex : string

Expand Down
Loading

0 comments on commit c8cb87b

Please sign in to comment.