Statistics
| Branch: | Tag: | Revision:

root / Makefile @ 175:f9f5640c2a3a

History | View | Annotate | Download (2.3 kB)

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