-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
72 lines (64 loc) · 2.28 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
69
70
71
72
CC=mcs
VERSION := $(shell grep "^\[assembly\:AssemblyVersionAttribute" Assembly.cs | awk -F\" '{ print $$2 }' - | awk -F\. '{printf "%s.%s", $$1, $$2; if ($$3 != '0' || $$4 != '0') printf ".%s", $$3; if ($$4 && $$4 != '0') printf ".%s", $$4}')
BUILD_ZIP_DIR=.build-zip
ZIP_DIR=weland-$(VERSION)
create-zipdir=mkdir -p "$(BUILD_ZIP_DIR)/$(ZIP_DIR)"
remove-zipdir=rm -rf "$(BUILD_ZIP_DIR)"
define copy-readme
cp COPYING.txt "$(BUILD_ZIP_DIR)/$(ZIP_DIR)"
cp README.md "$(BUILD_ZIP_DIR)/$(ZIP_DIR)"
endef
define copy-plugins
mkdir -p "$(BUILD_ZIP_DIR)/$(ZIP_DIR)/Plugins"
cp Plugins/README.txt "$(BUILD_ZIP_DIR)/$(ZIP_DIR)/Plugins/"
cp Plugins/*.dll "$(BUILD_ZIP_DIR)/$(ZIP_DIR)/Plugins/"
cp Plugins/Makefile "$(BUILD_ZIP_DIR)/$(ZIP_DIR)/Plugins/"
endef
all: .FORCE
$(CC) @weland.rsp
make -C Plugins
.FORCE:
plugins:
make -C Plugins
windows: .FORCE
$(CC) @windows.rsp
Weland.app: .FORCE
$(CC) @weland.rsp
rm -rf Weland.app
mkdir -p Weland.app/Contents
sed -e 's/WELAND_VERSION/$(VERSION)/g' mac/Info.plist > Weland.app/Contents/Info.plist
mkdir -p Weland.app/Contents/Resources
cp icons/Weland.icns Weland.app/Contents/Resources/
mkdir -p Weland.app/Contents/MacOS
cp mac/weland.sh Weland.app/Contents/MacOS/weland
chmod u+x Weland.app/Contents/MacOS/weland
cp Weland.exe Weland.app/Contents/MacOS/Weland.exe
winzip: windows plugins
$(create-zipdir)
$(copy-readme)
$(copy-plugins)
cp Weland.exe "$(BUILD_ZIP_DIR)/$(ZIP_DIR)"
cd "$(BUILD_ZIP_DIR)" && zip -r "../weland-$(VERSION)-win.zip" "$(ZIP_DIR)"
$(remove-zipdir)
maczip: Weland.app plugins
$(create-zipdir)
$(copy-readme)
$(copy-plugins)
cp -r Weland.app "$(BUILD_ZIP_DIR)/$(ZIP_DIR)"
cd "$(BUILD_ZIP_DIR)" && zip -y -r "../weland-$(VERSION)-mac.zip" "$(ZIP_DIR)"
$(remove-zipdir)
dist:
$(create-zipdir)
zip -r "$(BUILD_ZIP_DIR)/tmp.zip" . -i Makefile -i \*.cs -i \*.png -i \*.glade -i \*.txt -i \*.rsp -i mac/Info.plist -i mac/weland.sh -i icons/Weland.icns -i icons/Weland.ico -i Plugins/Makefile -i Plugins/README.txt
unzip -d "$(BUILD_ZIP_DIR)/$(ZIP_DIR)" "$(BUILD_ZIP_DIR)/tmp.zip"
cd "$(BUILD_ZIP_DIR)" && zip -r "../weland-$(VERSION)-src.zip" "$(ZIP_DIR)"
$(remove-zipdir)
release: winzip maczip plugins dist
.PHONY: clean
clean:
$(remove-zipdir)
rm -f Weland.exe
rm -rf Weland.app
rm -rf *.zip
rm -rf *.mdb
make -C Plugins clean