forked from Hammerspoon/hammerspoon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (29 loc) · 1.33 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
VERSION = $(shell defaults read `pwd`/Hammerspoon/Hammerspoon-Info CFBundleVersion)
APPFILE = build/Hammerspoon.app
ZIPFILE = build/Hammerspoon-$(VERSION).zip
PRODUCT_DIR = $(shell xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release -showBuildSettings | sort | uniq | grep " BUILT_PRODUCTS_DIR =" | awk '{ print $$3 }')
$(APPFILE): build $(shell find Hammerspoon -type f)
rm -rf $@
xcodebuild -workspace Hammerspoon.xcworkspace -scheme Release clean build > build/release-build.log
cp -R ${PRODUCT_DIR}/Hammerspoon.app $@
docs: build/Hammerspoon.docset
build/Hammerspoon.docset: build/docs.sqlite build/html
rm -rf $@
cp -R scripts/docs/templates/Hammerspoon.docset $@
mv build/docs.sqlite $@/Contents/Resources/docSet.dsidx
cp build/html/* $@/Contents/Resources/Documents/
tar -czf build/Hammerspoon.tgz -C build Hammerspoon.docset
build/html: build/docs.json
mkdir -p $@
rm -rf $@/*
scripts/docs/bin/genhtml $@ < $<
build/docs.sqlite: build/docs.json
scripts/docs/bin/gensql < $< | sqlite3 $@
build/docs.json: build
find . -type f \( -name '*.lua' -o -name '*.m' \) -not -path '*/sample-extensions/*' -not -path './build/*' -not -path './extensions/.build/*' -exec cat {} + | scripts/docs/bin/gencomments | scripts/docs/bin/genjson > $@
build:
mkdir -p build
clean:
rm -rf build
rm -rf extensions/.build
.PHONY: release clean