Statistics
| Branch: | Tag: | Revision:

root / Makefile @ 175:f9f5640c2a3a

History | View | Annotate | Download (2.3 kB)

1
UNITY=/opt/Unity/Editor/Unity
2
SCENE="Assets/_Scenes/Cells\ 3,4.unity"
3
4
5
VERSION=$(shell printf '%s.%s' \
6
	`grep -m 1 MajorVersion "$(SCENE)" | sed -e 's/^.*\([0-9]\+\).*$$/\1/'` \
7
	`grep -m 1 MinorVersion "$(SCENE)" | sed -e 's/^.*\([0-9]\+\).*$$/\1/'` )
8
9
BUILD=build
10
LINUX=tidmarsh-$(VERSION)-linux
11
MAC=tidmarsh-$(VERSION)-mac
12
WIN=tidmarsh-$(VERSION)-win
13
14
LINUX_APP=Tidmarsh_v$(VERSION).x86_64
15
MAC_APP=Tidmarsh_v$(VERSION).app
16
WIN_APP=Tidmarsh.exe
17
18
UNITY_ARGS=-batchmode -quit -logfile /dev/stdout \
19
	-projectPath '$(shell pwd)'
20
21
.PHONY: linux
22
linux: $(BUILD)/$(LINUX).tar.bz2
23
24
.PHONY: mac
25
mac: $(BUILD)/$(MAC).zip
26
27
.PHONY: win
28
win: $(BUILD)/$(WIN).exe
29
30
DEPLOY_FILES=$(BUILD)/$(MAC).zip $(BUILD)/$(WIN).exe $(BUILD)/$(LINUX).tar.bz2 $(BUILD)/index.json
31
32
.PHONY: deploy-beta deploy-prod deploy-local
33
deploy-beta: $(DEPLOY_FILES)
34
	scp $^ web@tidmarsh.media.mit.edu:/srv/beta/dl
35
36
deploy-prod: $(DEPLOY_FILES)
37
	scp $^ web@tidmarsh.media.mit.edu:/srv/http/dl
38
39
deploy-local: $(DEPLOY_FILES)
40
	scp $^ ~/tid-site/dl
41
42
$(BUILD)/$(LINUX)/$(LINUX_APP): 
43
	mkdir -p $(BUILD)/$(LINUX)
44
	$(UNITY) -batchmode -quit -projectPath '$(shell pwd)' -buildLinux64Player $@ -logFile /dev/stdout 
45
46
$(BUILD)/$(LINUX).tar.bz2: $(BUILD)/$(LINUX)/$(LINUX_APP)
47
	cd $(BUILD) && tar cjvf $(LINUX).tar.bz2 $(LINUX)
48
49
$(BUILD)/$(MAC)/$(MAC_APP):
50
	mkdir -p $(BUILD)/$(MAC)
51
	$(UNITY) -batchmode -quit -projectPath '$(shell pwd)' -buildOSX64Player $@ -logFile /dev/stdout 
52
53
$(BUILD)/$(MAC).dmg: $(BUILD)/$(MAC)/$(MAC_APP)
54
	genisoimage -V $(MAC) -D -R -apple -no-pad -o $@ $(BUILD)/$(MAC)
55
56
$(BUILD)/$(MAC).zip: $(BUILD)/$(MAC)/$(MAC_APP)
57
	cd $(BUILD)/$(MAC) && zip -r ../$(MAC).zip $(MAC_APP)
58
59
$(BUILD)/$(WIN)/$(WIN_APP): 
60
	mkdir -p $(BUILD)/$(WIN)
61
	$(UNITY) -batchmode -quit -projectPath '$(shell pwd)' -buildWindowsPlayer $@ -logFile /dev/stdout 
62
63
$(BUILD)/$(WIN)/tidmarsh_$(VERSION).nsi: Assets/Installer/Tidmarsh.nsi
64
	mkdir -p $(BUILD)/$(WIN)
65
	sed -e 's/%VER%/$(VERSION)/g' $< > $@
66
67
$(BUILD)/$(WIN).exe: $(BUILD)/$(WIN)/tidmarsh_$(VERSION).nsi $(BUILD)/$(WIN)/$(WIN_APP)
68
	cd $(BUILD)/$(WIN) && makensis tidmarsh_$(VERSION).nsi && cp $(WIN).exe ..
69
70
$(BUILD)/index.json: Assets/Installer/downloads.json
71
	sed -e 's/%VER%/$(VERSION)/g' -e 's/%DATE%/$(shell date --rfc-3339=seconds)/g' $< > $@
72
73
.PHONY: showversion
74
showversion:
75
	@echo "Version: " $(VERSION)
76
77
.PHONY: showfiles
78
showfiles: 
79
	@echo '$(FILES)'
80
81