forked from CommandPost/CommandPost-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (51 loc) · 2.11 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
VERSION = $(shell defaults read `pwd`/Hammerspoon/CommandPost-Info CFBundleVersion)
APPFILE = build/CommandPost.app
ZIPFILE = build/CommandPost-$(VERSION).zip
SCHEME = Hammerspoon
CONFIGURATION = Debug
DOCS_SEARCH_DIRS = Hammerspoon/ extensions/
all: $(APPFILE)
release: SCHEME = Release
release: CONFIGURATION = Release
release: all
$(APPFILE): PRODUCT_DIR = $(shell xcodebuild -workspace Hammerspoon.xcworkspace -scheme $(SCHEME) -configuration $(CONFIGURATION) -showBuildSettings | sort | uniq | grep " BUILT_PRODUCTS_DIR =" | awk '{ print $$3 }')
$(APPFILE): build $(shell find Hammerspoon -type f)
echo "Building CommandPost in $(CONFIGURATION) configuration"
rm -rf $@
xcodebuild -workspace Hammerspoon.xcworkspace -scheme $(SCHEME) -configuration $(CONFIGURATION) clean build > build/$(CONFIGURATION)-build.log
cp -R ${PRODUCT_DIR}/CommandPost.app $@
cp -R ${PRODUCT_DIR}/CommandPost.app.dSYM build/
cp -R ${PRODUCT_DIR}/LuaSkin.framework.dSYM build/
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 $@/*
cp scripts/docs/templates/docs.css $@
cp scripts/docs/templates/jquery.js $@
cp build/docs.json $@
cp build/docs_index.json $@
scripts/docs/bin/build_docs.py -o build/ --html $(DOCS_SEARCH_DIRS)
scripts/docs/bin/build_docs.py -o build/ --markdown $(DOCS_SEARCH_DIRS)
build/html/LuaSkin:
headerdoc2html -u -o $@ LuaSkin/LuaSkin/Skin.h
resolveLinks $@
mv $@/Skin_h/* $@
rmdir $@/Skin_h
build/docs.sqlite: build/docs.json
scripts/docs/bin/build_docs.py -o build/ --sql $(DOCS_SEARCH_DIRS)
build/docs.json: build
scripts/docs/bin/build_docs.py -o build/ --json $(DOCS_SEARCH_DIRS)
build:
mkdir -p build
clean:
rm -rf build/
rm -rf LuaSkin.framework
clean-docs:
rm -fr build/Hammerspoon.docset build/Hammerspoon.tgz build/html build/docs.json build/docs.sqlite
.PHONY: all release clean clean-docs