-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
55 lines (49 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
52
53
54
55
# -verbose 1
MLTONFLAGS =
KERN=$(shell uname -s)
ifeq ($(strip $(KERN)),Linux)
MLTONFLAGS += -cc-opt -static -link-opt -static
else
MLTONFLAGS +=
endif
.PHONY: default
default:
@echo "make tutor to make the demonic tutor"
@echo "make player-*.exe to make the player-*.sml"
.PHONY: tutor
tutor:
mlton -const "Exn.keepHistory true" -output tutor eternal/demonic-tutor.cm
# TODO: I think this strategy of building is kind of confusing,
# since if player.sml doesn't compile, it reports errors there
# and tempts you to make edits to it, which are then lost when
# you do make again. We can probably improve it... -tom7
#
# XXX: Also this doesn't seem to rebuild if anything but player-*.sml
# changes?
player-%.tar.gz: player-%.exe
@mkdir -p $<-build
@cp $< $<-build/run
@echo '#!/bin/sh' > $<-build/install
@echo 'exit 0' >> $<-build/install
@chmod +x $<-build/install
@mkdir $<-build/src
@echo '*** THIS IS OKAY FOR THE ARENA, BUT WE MUST COPY SOURCE IN FOR THE FINAL SUBMISSION! ***'
tar czvf $@ -C $<-build run install src
@echo '*** THIS IS OKAY FOR THE ARENA, BUT WE MUST COPY SOURCE IN FOR THE FINAL SUBMISSION! ***'
@rm -rf $<-build
player-%.exe: .DUMMY
@rm -f player.sml
@echo '(* DO NOT EDIT! Instead edit source' $(@:exe=sml) '! *)' >> player.sml
@echo >> player.sml
@cat $(@:exe=sml) >> player.sml
@echo >> player.sml
@echo '(* DO NOT EDIT! Instead edit source' $(@:exe=sml) '! *)' >> player.sml
@echo >> player.sml
@svn info | ./embedversion.pl > version.sml
@chmod a-w player.sml # try to prevent user from editing
mlton $(MLTONFLAGS) -const "Exn.keepHistory true" -output $@ player.cm
@chmod u+w player.sml
@rm -f player.sml
@rm version.sml
.PHONY: .DUMMY
.DUMMY: