This repository has been archived by the owner on Oct 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
101 lines (79 loc) · 2.87 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
PROJECT = touchui
VERSION_MAJOR = 1.8
# The following is set in jenkins, for local builds, we get version 1.6.x while on jenkins we get e.g: 1.6.99
BUILDNUMBER=x
VERSION=$(VERSION_MAJOR).$(BUILDNUMBER)
BUILD = local@$(shell hostname) $(shell date)
GITREV = $(shell git show-ref --heads --hash)
DSTDIR = build/$(PROJECT)
#SDK = /home/felfert/Projects/GRAU/sencha/touch-2.2.0
SDK = /home/awagner/bin/Sencha/Complete/1.0.5.1/touch-2.3.1
YUIJAR = tools/yuicompressor-2.4.7.jar
SENCHA_CDN = https://extjs.cachefly.net/touch/sencha-touch-2.2.1/
LINK_SDK = ln -s $(SDK) touch
UNLINK_SDK = rm -f touch
PHANTOMJS = phantomjs
BASEURL = http://localhost/gds2/touchclient
SOURCES=$(shell find app 3rdparty -name "*.js") generated/AppVersion.js agorum.js app.js
TARGETS=$(addprefix $(DSTDIR)/,$(SOURCES)) $(DSTDIR)/index.html
ifeq ($(DEBUG),1)
YUI = cat >
DBGSUFFIX=-debug
else
YUI = java -jar $(YUIJAR) --type js -o
DBGSUFFIX=
endif
all: jasmine jslint dstdir resources $(TARGETS) $(DSTDIR)/sencha-touch-all$(DBGSUFFIX).js
$(DSTDIR)/sencha-touch-all$(DBGSUFFIX).js: $(SDK)/sencha-touch-all$(DBGSUFFIX).js
cp $^ $@
$(DSTDIR)/index.html: index.html
sed -e 's/@DEBUG@/$(DBGSUFFIX)/g' index.html > $(DSTDIR)/index.html
$(DSTDIR)/%.js: %.js
@mkdir -p `dirname $@`
@if echo $^|grep -q min.js ; then \
echo Copy $^ " => " $@ ; \
cp $^ $@ ; \
else \
echo Compress $^ " => " $@ ; \
cat $^ | $(YUI) $@ ; \
fi
debug:
$(MAKE) DEBUG=1 all
dist: clean all package
package:
echo VERSION=$(VERSION) > version.properties
$(MAKE) VERSION=$(VERSION) -C packaging dist
distnoupload: clean jslint dstdir resources $(TARGETS) $(DSTDIR)/sencha-touch-all$(DBGSUFFIX).js
echo VERSION=$(VERSION) > version.properties
$(MAKE) VERSION=$(VERSION) -C packaging clean build
missing: generated/AppVersion.js
generated:
@mkdir -p generated
generated/AppVersion.js: generated
@echo "Ext.define('generated.AppVersion',{" > $@
@echo "'version':'$(VERSION)','build':'$(BUILD)','gitrev':'$(GITREV)'" >> $@
@echo "});" >> $@
dstdir:
mkdir -p $(DSTDIR)
resources: dstdir $(DSTDIR)/css/app.css
rsync -rl images $(DSTDIR)
rsync -r $(SDK)/resources/images $(SDK)/resources/css $(DSTDIR)
$(DSTDIR)/css/app.css: css/*.css
mkdir -p $(DSTDIR)/css
cat $^ | java -jar $(YUIJAR) --type css -o $@
jslint: $(SOURCES)
$(PHANTOMJS) app-test/phantomlint/Tests-Runner.js
jasmine: $(SOURCES)
$(LINK_SDK)
rm -f jasmine_success
$(PHANTOMJS) app-test/lib/phantomjs-testrunner.js $(BASEURL)/run-tests.html && touch jasmine_success || true
$(UNLINK_SDK)
test -f jasmine_success && rm -f jasmine_success || exit 1
clean:
rm -rf build generated $(PROJECT)*.tar.gz
rm -f app-test/results/TEST*
rm -f app-test/results/touchclient-lint*
$(UNLINK_SDK)
deploy-fritz: clean dstdir resources $(TARGETS) $(DSTDIR)/sencha-touch-all$(DBGSUFFIX).js
rsync -cr --del --inplace --progress build/$(PROJECT) www.fritz-elfert.de:fritz/
.PHONY: generated/AppVersion.js