1+ include Makefile-generic-ocaml-rules.include
12include ../../Makefile.include
23
34# #######
@@ -28,9 +29,12 @@ MLANG=$(MLANG_BIN) $(MLANG_DEFAULT_OPTS) $(OPTIMIZE_FLAG)
2829SPEC_DEP =$(MPP_FILE )
2930endif
3031
31- .PHONY : clean cleangen cleancalc cleanstat cleantest cleanresult
32+ # Include parser lib directory to make its module available
33+ OCAMLC_INCLUDE_LIST = -I parser
3234
33- clean : cleancalc cleanstat cleanresult
35+ .PHONY : clean cleangen cleancalc cleanstat cleantest cleanresult run_tests
36+
37+ clean : cleancalc cleanstat cleanresult cleanparser
3438
3539cleangen :
3640 rm -f ir.ml
@@ -45,16 +49,6 @@ cleanresult:
4549cleanparser :
4650 $(MAKE ) -C parser/ clean
4751
48- # #################################################
49- # Implicit rules for OCaml modules
50- # #################################################
51-
52- % .cmo : % .ml
53- ocamlc.opt -c $(DEBUG_FLAG ) $^
54-
55- % .cmx : % .ml
56- ocamlopt -c $(DEBUG_FLAG ) $^
57-
5852# #################################################
5953# Generating and running OCaml files from Mlang
6054# #################################################
@@ -65,26 +59,20 @@ ir.ml: $(SPEC_DEP)
6559 --backend ocaml --output ir.ml \
6660 $(SOURCE_FILES )
6761
68- test_harness.cmo : test_harness.ml
69- ocamlc.opt -c $(DEBUG_FLAG ) -I parser $^
70-
7162.INTERMEDIATE : test_harness.cmo test_harness.cmi test_harness.o test_harness.cmx
7263# Compiling bytecode
73- types_module.cmo :
74- $(MAKE ) -C parser/ types_module.cmo
75- test_lexer.cmo :
76- $(MAKE ) -C parser/ test_lexer.cmo
77- test_parser.cmo :
78- $(MAKE ) -C parser/ test_parser.cmo
79- fip.cmo :
64+ types_module.cmo test_lexer.cmo test_parser.cmo fip.cmo :
8065 $(MAKE ) -C parser/ fip.cmo
8166
8267test.bc : types_module.cmo test_lexer.cmo test_parser.cmo fip.cmo mvalue.cmo ir.cmo test_harness.cmo
83- ocamlc.opt $(DEBUG_FLAG ) -o $@ -I parser unix.cma $^
68+ ocamlc.opt $(DEBUG_FLAG ) -o $@ $( OCAMLC_INCLUDE_LIST ) unix.cma $^
8469
8570# Compiling native code
86- test.exe : parser/fip.cmx mvalue.cmx ir.cmx test_harness.cmx
87- ocamlopt $(DEBUG_FLAG ) -o $@ unix.cmxa $^
71+ types_module.cmx test_lexer.cmx test_parser.cmx fip.cmx :
72+ $(MAKE ) -C parser/ fip.cmx
73+
74+ test.exe : types_module.cmx test_lexer.cmx test_parser.cmx fip.cmx mvalue.cmx ir.cmx test_harness.cmx
75+ ocamlopt $(DEBUG_FLAG ) -o $@ $(OCAMLC_INCLUDE_LIST ) unix.cmxa $^
8876
8977# Running test suite
9078run : test.bc
0 commit comments