-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
84 lines (64 loc) · 2.3 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
76
77
78
79
80
81
82
83
84
APP_NAME = OctotreeForSafari
APPICON_DIR = $(APP_NAME)/Assets.xcassets/AppIcon.appiconset
.PHONY: bootstrap upstream update_css update_fonts update_icons update_octotree_files
bootstrap:
@git submodule update --init --recursive
@mkdir -p upstream/tmp
update_safariextension: bootstrap
cd upstream && npm install && npm start safari
# update_octotree_files's dependencies
remove_old_files:
rm -f octotree/*.css octotree/*.js octotree/fonts/* octotree/images/*
octotree/file-icons.css: upstream/libs/file-icons.css
sed 's|\.\./fonts|fonts|' < $< > $@
touch -r $< $@
update_css: upstream/tmp/safari/octotree.safariextension/*.css
ifeq ($(MAKELEVEL), 0)
@$(MAKE) $@
else
cp -p $(filter-out upstream/tmp/safari/octotree.safariextension/file-icons.css, $^) octotree
endif
update_fonts: upstream/tmp/safari/octotree.safariextension/fonts/*
mkdir -p octotree/fonts
ifeq ($(MAKELEVEL), 0)
@$(MAKE) $@
else
cp -p $^ octotree/fonts
endif
update_icons: $(APPICON_DIR)/*.png
ifeq ($(MAKELEVEL), 0)
@$(MAKE) $@
endif
update_images: upstream/tmp/safari/octotree.safariextension/images/*
mkdir -p octotree/images
ifeq ($(MAKELEVEL), 0)
@$(MAKE) $@
else
cp -p $^ octotree/images
endif
$(APPICON_DIR)/%.png: upstream/icons/%.png
cp -p $< $@
update_js: upstream/tmp/safari/octotree.safariextension/*.js
ifeq ($(MAKELEVEL), 0)
@$(MAKE) $@
else
cp -p $^ octotree
endif
fix_file_modes:
chmod 644 octotree/*.css octotree/*.js octotree/fonts/* octotree/images/*
update_octotree_files: update_safariextension remove_old_files octotree/file-icons.css update_css update_fonts update_icons update_images update_js fix_file_modes
NOTARIZE_PATH?= notarize.noindex
APP_PATH?= $(NOTARIZE_PATH)/$(APP_NAME).app
ARCHIVE_PATH = $(NOTARIZE_PATH)/$(APP_NAME).xcarchive
XCODE_FLAGS = -project $(APP_NAME).xcodeproj -scheme $(APP_NAME) CODE_SIGN_IDENTITY="Developer ID Application" CODE_SIGN_STYLE=Manual
ZIP_PATH?= $(NOTARIZE_PATH)/$(APP_NAME).zip
$(NOTARIZE_PATH):
mkdir -p $(NOTARIZE_PATH)
$(ARCHIVE_PATH): $(NOTARIZE_PATH)
xcodebuild $(XCODE_FLAGS) -archivePath $(ARCHIVE_PATH) archive
archive: $(ARCHIVE_PATH)
$(APP_PATH): $(ARCHIVE_PATH)
xcodebuild -exportArchive -archivePath $(ARCHIVE_PATH) -exportPath $(NOTARIZE_PATH) -exportOptionsPlist export/options.plist
export: $(APP_PATH)
notarize: $(APP_PATH)
export/notarize.sh $(APP_PATH) $(ZIP_PATH)