Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
SOURCES = scanner.mll \
parser.mly \
sast.ml \
ast.ml \
semant.ml \
parser.ml \
scanner.ml \
test2.ml


OCAMLBUILD = ocamlbuild test2.native

all:
$(OCAMLBUILD) test2.native parser semant

clean:
$(OCAMLBUILD) -clean
rm -rf *.cmi *.cmo parser.ml parser.mli scanner.ml




65 changes: 65 additions & 0 deletions build.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#For those machine doesn't have ocamlbuild, build the project with this makefile

OBJ=ast.cmo \
sast.cmo \
semant.cmo \
scanner.cmo \
parser.cmo \
test2.cmo \
printer.cmo

PythonPlusPlus=pythonpp

FLAGS:=-g

$(PythonPlusPlus): $(OBJ)
ocamlc -g -o parser parser.cmo scanner.cmo ast.cmo
ocamlc -g -o semant parser.cmo scanner.cmo ast.cmo sast.cmo
ocamlc -g -o test2 parser.cmo scanner.cmo ast.cmo sast.cmo semant.cmo test2.cmo

printer: $(OBJ)
ocamlc -o printer.cma -a ast.cmo sast.cmo printer.cmo

.SUFFIXES: .ml .cmo .cmi .mll .mly .mli
.PRECIOUS: %.ml %.mli %.cmo

.ml.cmo:
ocamlc -c $(FLAGS) $<

.mli.cmi:
ocamlc -c $(FLAGS) $<

.mll.ml:
ocamllex $<

.mly.ml:
ocamlyacc -v $<

.mly.mli:
ocamlyacc -v $<

clean:
rm -f *.cmi *.cmo parser.ml scanner.ml *.output parser.mli parser_test semant test2


# Generated by ocamldep
ast.cmo:
ast.cmx:
parser.cmo: util.cmo ast.cmo parser.cmi
parser.cmx: util.cmx ast.cmx parser.cmi
parser.cmi: ast.cmo
sast.cmo: util.cmo ast.cmo
sast.cmx: util.cmx ast.cmx
scanner.cmo: parser.cmi
scanner.cmx: parser.cmx
semant.cmo: sast.cmo ast.cmo
semant.cmx: sast.cmx ast.cmx
parser.cmo: scanner.cmo parser.cmi ast.cmo
parser.cmx: scanner.cmx parser.cmx ast.cmx
test2.cmo: scanner.cmo parser.cmi \
output.cmo interpreter.cmo
test2.cmx: semant.cmx scanner.cmx parser.cmx \
output.cmx interpreter.cmx

printer.cmo: ast.cmo sast.cmo
printer.cmx: ast.cmx sast.cmx