-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (41 loc) · 1.67 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
TODO_SRC := OCamlMVC.mli OCamlMVC.ml VCR.mli VCR.ml TodoList.mli TodoList.ml TodoListComponent.mli TodoListComponent.ml Main.ml
TODO_CMO := $(patsubst %.ml,%.cmo,$(filter-out %.mli,$(TODO_SRC)))
EDITOR_SRC := OCamlMVC.mli OCamlMVC.ml VCR.mli VCR.ml TodoList.mli TodoList.ml TodoListComponent.mli TodoListComponent.ml Editor.ml EditorMain.ml
EDITOR_CMO := $(patsubst %.ml,%.cmo,$(filter-out %.mli,$(EDITOR_SRC)))
SRC := $(TODO_SRC) $(EDITOR_SRC)
all: todo.js editor.js
######################################################################
todo.byte: $(TODO_CMO)
@echo Linking $@
@ocamlfind ocamlc -package js_of_ocaml -linkpkg -o $@ $^
editor.byte: $(EDITOR_CMO)
@echo Linking $@
@ocamlfind ocamlc -package js_of_ocaml -linkpkg -o $@ $^
######################################################################
clean:
rm -f *.cmo *.cmi
rm -f todo.byte todo.js
rm -f editor.byte editor.js
rm -f *~
######################################################################
%.cmo: %.ml
@echo Compiling $<
@ocamlfind ocamlc -package js_of_ocaml \
-package js_of_ocaml.syntax \
-syntax camlp4o \
-c $<
%.cmi: %.mli
@echo Compiling $<
@ocamlfind ocamlc -package js_of_ocaml \
-package js_of_ocaml.syntax \
-syntax camlp4o \
-c $<
%.js: %.byte
@echo Compiling $< to $@
@js_of_ocaml --opt 2 $<
######################################################################
.ocamldeps: $(SRC)
@ocamlfind ocamldep -package js_of_ocaml.syntax \
-syntax camlp4o \
$(SRC) >.ocamldeps
-include .ocamldeps