forked from aliyun/oss-browser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
75 lines (66 loc) · 3.25 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
73
74
75
VERSION=1.6.3
NAME=oss-browser
CUSTOM=./custom
GULP=node ./node_modules/gulp/bin/gulp.js
PKGER=node node_modules/electron-packager/cli.js
ZIP=node ../zip.js
ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/
ELECTRON_VERSION=1.6.5
BUILD=ELECTRON_MIRROR=$(ELECTRON_MIRROR) $(PKGER) ./dist $(NAME) --asar --overwrite --out=build --version $(ELECTRON_VERSION)
i:
cnpm i
clean:
rm -rf dist node_modules build releases node/crc64/cpp-addon/node_modules node/ossstore/node_modules
dev:
NODE_ENV=development electron . --inspect=5858
run:
custom=$(CUSTOM) npm run dev
prod:
npm run prod
watch:
$(GULP) watch --custom=$(CUSTOM)
build:
$(GULP) build --custom=$(CUSTOM)
node gen.js
win64:
$(BUILD) --platform=win32 --arch=x64 --icon=$(CUSTOM)/icon.ico
cp -rf $(CUSTOM) build/$(NAME)-win32-x64/resources
rm -rf releases/$(VERSION)/$(NAME)-win32-x64.zip && mkdir -p releases/$(VERSION)
cd build && $(ZIP) ../releases/$(VERSION)/$(NAME)-win32-x64.zip $(NAME)-win32-x64/
win32:
$(BUILD) --platform=win32 --arch=ia32 --icon=$(CUSTOM)/icon.ico
cp -rf $(CUSTOM) build/$(NAME)-win32-ia32/resources
rm -rf releases/$(VERSION)/$(NAME)-win32-ia32.zip && mkdir -p releases/$(VERSION)
cd build && $(ZIP) ../releases/$(VERSION)/$(NAME)-win32-ia32.zip $(NAME)-win32-ia32/
linux64:
$(BUILD) --platform=linux --arch=x64
cp -rf $(CUSTOM) build/$(NAME)-linux-x64/resources
rm -rf releases/$(VERSION)/$(NAME)-linux-x64.zip && mkdir -p releases/$(VERSION)
cd build && $(ZIP) ../releases/$(VERSION)/$(NAME)-linux-x64.zip $(NAME)-linux-x64/
linux32:
$(BUILD) --platform=linux --arch=ia32
cp -rf $(CUSTOM) build/$(NAME)-linux-ia32/resources
rm -rf releases/$(VERSION)/$(NAME)-linux-ia32.zip && mkdir -p releases/$(VERSION)
cd build && $(ZIP) ../releases/$(VERSION)/$(NAME)-linux-ia32.zip $(NAME)-linux-ia32/
mac:
$(BUILD) --platform=darwin --arch=x64 --icon=$(CUSTOM)/icon.icns
cp -rf $(CUSTOM) build/$(NAME)-darwin-x64/$(NAME).app/Contents/Resources
rm -rf releases/$(VERSION)/$(NAME)-darwin-x64.zip && mkdir -p releases/$(VERSION)
cd build && $(ZIP) ../releases/$(VERSION)/$(NAME)-darwin-x64.zip $(NAME)-darwin-x64/
dmg:
rm build/$(NAME)-darwin-x64/LICENSE* build/$(NAME)-darwin-x64/version || continue
ln -s /Applications/ build/$(NAME)-darwin-x64/Applications || continue
#cp dist/icons/icon.icns build/$(NAME)-darwin-x64/.VolumeIcon.icns
#mkdir -p build/$(NAME)-darwin-x64/.background
#cp dist/icons/background.tiff build/$(NAME)-darwin-x64/.background
rm -f releases/$(VERSION)/$(NAME).dmg || continue
hdiutil create -size 250M -format UDZO -srcfolder build/$(NAME)-darwin-x64 -o releases/$(VERSION)/$(NAME).dmg
all:win32 win64 linux32 linux64 mac asar
@echo 'Done'
asar:
mkdir -p releases/$(VERSION)/darwin-x64 && cp build/$(NAME)-darwin-x64/$(NAME).app/Contents/Resources/app.asar releases/$(VERSION)/darwin-x64
mkdir -p releases/$(VERSION)/win32-x64 && cp build/$(NAME)-win32-x64/resources/app.asar releases/$(VERSION)/win32-x64
mkdir -p releases/$(VERSION)/win32-ia32 && cp build/$(NAME)-win32-ia32/resources/app.asar releases/$(VERSION)/win32-ia32
mkdir -p releases/$(VERSION)/linux-x64 && cp build/$(NAME)-linux-x64/resources/app.asar releases/$(VERSION)/linux-x64
mkdir -p releases/$(VERSION)/linux-ia32 && cp build/$(NAME)-linux-ia32/resources/app.asar releases/$(VERSION)/linux-ia32
.PHONY:build