-
Notifications
You must be signed in to change notification settings - Fork 89
/
Makefile
226 lines (193 loc) · 5.84 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
ARCH ?= x86_64
CONFIGURATION ?= Debug
BUILDDIRPATH=$(CURDIR)/build
BUILDDIR=$(shell mkdir -p $(BUILDDIRPATH) && echo $(BUILDDIRPATH))
BINDIR=$(BUILDDIR)/$(CONFIGURATION)/Vico.app/Contents/MacOS
VPATH = app app/en.lproj json oniguruma oniguruma/enc universalchardet lemon \
util par help
HELP_SRCS = \
basics.md \
change.md \
change_indent.md \
delete.md \
dot.md \
ex.md \
ex_cmds.md \
ex_ranges.md \
explorer.md \
indent_settings.md \
insert.md \
jumplist.md \
line_search.md \
move_chars.md \
move_lines.md \
move_symbols.md \
move_words.md \
movement.md \
open_line.md \
operators.md \
remote.md \
scrolling.md \
searching.md \
splits.md \
ssh_keygen.md \
symbols.md \
terminal.md \
visual.md
HELP_HTMLS = $(addprefix $(HELP_EN)/,$(HELP_SRCS:.md=.html))
$(HELP_EN)/%.html: %.md
mkdir -p $(@D)
help/md2html $< > $@
app: submodules
xcodebuild -scheme "Vico app" -configuration Debug SYMROOT=$(BUILDDIR)
submodules: $(BUILDDIR)/gitmodules.stamp
$(BUILDDIR)/gitmodules.stamp:
git submodule update --init --recursive -- .
touch $@
binaries: $(OBJDIR)/Vico $(OBJDIR)/vicotool $(OBJDIR)/par
$(OBJDIR)/Vico: $(OBJS)
mkdir -p $(OBJDIR)
$(CXX) $(LDFLAGS) $(LDLIBS) $(APP_LDLIBS) $(addprefix -framework ,$(APP_FRAMEWORKS)) $^ -o $@
$(OBJDIR)/vicotool: $(TOOL_OBJS)
mkdir -p $(OBJDIR)
$(CC) $(LDFLAGS) $(TOOL_LDLIBS) $^ -o $@
TMPDMG = $(BUILDDIR)/vico-tmp.dmg
VOLNAME = vico-$(SHORT_VERSION)
DMGFILE = $(VOLNAME).dmg
DMG = $(BUILDDIR)/$(DMGFILE)
DMGDIR = "$(BUILDDIR)/Vico $(SHORT_VERSION)"
APPCAST_BASE = http://www.vicoapp.com/relnotes
DOWNLOAD_BASE = http://www.vicoapp.com/download
KSIZE = $(shell du -ks $(APPDIR) | cut -f1)
SIZE = $(shell echo $$(($(KSIZE) * 1024)) )
SPARKLE_PKEY = sparkle_priv.pem
SIGNATURE = $(shell /usr/bin/openssl dgst -sha1 -binary < $(DMG) | \
/usr/bin/openssl dgst -dss1 -sign $(SPARKLE_PKEY) | \
/usr/bin/openssl enc -base64)
APPCAST_XML = $(DMG).xml
#dmg: $(DMG)
#$(DMG): app
# @echo "Creating disk image $(VOLNAME)"
# /bin/rm -rf $(TMPDMG) $(DMGDIR) $(DMG)
# mkdir -p $(DMGDIR)
# /bin/cp -a $(APPDIR) $(DMGDIR)
# ln -s /Applications $(DMGDIR)/Applications
# hdiutil makehybrid -o $(TMPDMG) $(DMGDIR) -hfs
# hdiutil convert -format UDBZ $(TMPDMG) -o $(DMG)
# /bin/rm -rf $(TMPDMG) $(DMGDIR)
# ls -lh $(DMG)
#### Create and sign a zip file for automatic updates.
#appcast: $(DMG)
# @sed -e 's,@SHORT_VERSION@,$(SHORT_VERSION),g' \
# -e 's,@REPO_VERSION@,$(REPO_VERSION),g' \
# -e 's,@RELNOTES_LINK@,$(APPCAST_BASE)/$(SHORT_VERSION),g' \
# -e 's/@DATE@/$(shell LC_TIME=en_US date +"%a, %d %b %G %T %z")/g' \
# -e 's,@DOWNLOAD_FILE@,$(DOWNLOAD_BASE)/$(DMGFILE),g' \
# -e 's,@SIGNATURE@,$(SIGNATURE),g' \
# -e 's,@SIZE@,$(SIZE),g' < appcast.xml.in > $(APPCAST_XML)
# @cat $(APPCAST_XML)
#RELEASE_TAG ?= $(shell git rev-parse --short HEAD)
#RELEASE_DIR = build/$(CONFIGURATION)-$(RELEASE_TAG)
#.PHONY: checkout
#checkout:
# @echo release directory is $(RELEASE_DIR)
# @if test -d $(RELEASE_DIR); then echo "release directory already exists"; exit 1; fi
# @echo checking out sources for '$(RELEASE_TAG)'
# git clone . $(RELEASE_DIR)
# cd $(RELEASE_DIR) && git co $(RELEASE_TAG)
#release: checkout
# $(MAKE) -C $(RELEASE_DIR) appcast
# convenience targets
run: app
$(BINDIR)/Vico $(CURDIR)
gdb: app
gdb $(BINDIR)/Vico
leaks: app
MallocStackLogging=YES \
$(BINDIR)/Vico $(CURDIR)
zombie: app
NSZombieEnabled=YES NSDebugEnabled=YES \
$(BINDIR)/Vico $(CURDIR)
test:
xcodebuild -configuration $CONFIGURATION -target Tests
test_snippets:
export OTHER_TEST_FLAGS="-SenTest TestViSnippet" && \
xcodebuild -configuration Debug -target Tests
test_scopes:
export OTHER_TEST_FLAGS="-SenTest TestScopeSelectors" && \
xcodebuild -configuration Debug -target Tests
api:
rm -rf doc/html
appledoc --project-name "Vico API" \
--project-company "Martin Hedenfalk" \
--company-id se.bzero \
--no-repeat-first-par \
--output doc \
--create-html \
--no-create-docset \
--merge-categories \
app/ExCommand.h \
app/ExMap.h \
app/ExParser.h \
app/NSEvent-keyAdditions.h \
app/NSString-additions.h \
app/NSView-additions.h \
app/ViCommand.h \
app/ViDocument.h \
app/ViDocumentView.h \
app/ViEventManager.h \
app/ViKeyManager.h \
app/ViLanguage.h \
app/ViMap.h \
app/ViMark.h \
app/ViParser.h \
app/ViPreferencePane.h \
app/ViPreferencesController.h \
app/ViRegisterManager.h \
app/ViScope.h \
app/ViTabController.h \
app/ViTextStorage.h \
app/ViTextView.h \
app/ViViewController.h \
app/ViWindowController.h
syncapi: api
rsync -av --delete doc/html/ www:/var/www/feedback.vicoapp.com/public/api
HELP_FILES = \
index.html \
$(HELP_SRCS) \
shared/help.css \
shared/icon_hand.png \
shared/icon_hand_32.png \
shared/icon_hand_64.png \
help-Info.plist \
help-InfoPlist.strings
help: $(DERIVEDDIR)/help.stamp
HELP_RESDIR = $(RESDIR)/Vico.help/Contents/Resources
HELP_EN = $(HELP_RESDIR)/English.lproj
$(DERIVEDDIR)/help.stamp: $(HELP_FILES)
mkdir -p $(HELP_EN)
cp -f help/index.html $(HELP_EN)/VicoHelp.html
rsync -a --delete --exclude ".DS_Store" help/shared $(HELP_RESDIR)
cp -f help/help-Info.plist $(HELP_RESDIR)/../Info.plist
cp -f help/help-InfoPlist.strings $(HELP_EN)/InfoPlist.strings
for md in $(HELP_SRCS); do \
./help/md2html help/$$md > $(HELP_EN)/$${md%.md}.html; \
done
hiutil -vg -s en -Caf $(HELP_EN)/Vico.helpindex $(HELP_EN)
touch $(DERIVEDDIR)/help.stamp
HELP_SRC = $(CURDIR)/help
WWW_HELP_DST = $(CURDIR)/help/www
WWW_HELP_EN = $(WWW_HELP_DST)/en
wwwhelp:
rm -rf $(CURDIR)/help/www
mkdir -p $(WWW_HELP_EN)
cp -rf $(HELP_SRC)/shared $(WWW_HELP_DST)
cd $(WWW_HELP_EN) && $(HELP_SRC)/md2html.www $(HELP_SRC)/*.md
syncwwwhelp: wwwhelp
rsync -avr $(WWW_HELP_DST)/ www.vicoapp.com:/var/www/vicoapp.com/help/
synchelp: help
rsync -avr $(HELP_RESDIR)/ www.vicoapp.com:/var/www/vicoapp.com/help
clean:
rm -rf $(OBJDIR) $(APPDIR)
distclean:
rm -rf $(BUILDDIR)