-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (55 loc) · 1.16 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# DO NOT EDIT THIS FILE
SUBMIT := gctx.ml gctx.mli widget.ml widget.mli paint.ml
OCB := ocamlbuild -r -tag debug -use-ocamlfind -pkg unix -pkg graphics -pkg js_of_ocaml -pkg js_of_ocaml-lwt -pkg js_of_ocaml-lwt.graphics -pkg js_of_ocaml-ppx
DEPENDS := \
assert.ml \
assert.mli \
deque.ml \
deque.mli \
eventloop.ml \
eventloop.mli \
g-js.ml.x \
g-native.ml.x \
gctx.ml \
gctx.mli \
gdemo.html \
gdemo.ml \
gdemo.mli \
lightbulb.html \
lightbulb.ml \
lightbulb.mli \
paint.html \
paint.ml \
paint.mli \
widget.ml \
widget.mli \
widgetTest.ml \
widgetTest.mli \
notifierdemo.html \
notifierdemo.mli \
notifierdemo.ml
HWNAME := hw05
ts := $(shell /bin/date "+%Y-%m-%d-%H:%M:%S")
ZIPNAME := $(HWNAME)-submit($(ts)).zip
.PHONY: all format clean zip
all: gdemo.js lightbulb.js paint.js notifierdemo.js widgetTest.native
%.js: %.byte
js_of_ocaml $<
%.native: $(DEPENDS)
rm -rf g.ml
cp g-native.ml.x g.ml
$(OCB) $@
rm -rf g.ml
%.byte: $(DEPENDS)
rm -rf g.ml
cp g-js.ml.x g.ml
$(OCB) $@
rm -rf g.ml
run% : %.native $(DEPENDS)
OCAMLRUNPARAM=b ./$<
zip: $(SUBMIT)
zip '$(ZIPNAME)' $(SUBMIT)
clean:
ocamlbuild -clean
rm -f *.js
rm -rf *.zip