forked from sintaxi/phonegap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·105 lines (86 loc) · 2.73 KB
/
configure
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
#!/bin/sh
PLATFORMS="iphone blackberry android"
echo "Building PhoneGap Makefile"
[ -f Makefile ] && cp Makefile Makefile.old
DOXYGEN=
if [ -d /Applications/Doxygen.app ]; then
DOXYGEN=/Applications/Doxygen.app/Contents/Resources/doxygen
else
for file in $(locate doxygen | grep -E '/doxygen$'); do
if [ -x $file ] && [ -f $file ]; then
DOXYGEN=$file
break
fi
done
if [ "x$DOXYGEN" = "x" ]; then
echo "No Doxygen found; fetch it from http://www.doxygen.org/ and install it in /Applications"
DOXYGEN=
fi
fi
cat > Makefile <<EOF
SHELL = /bin/sh
CHMOD = chmod
CP = cp
MV = mv
NOOP = \$(SHELL) -c true
RM_F = rm -f
RM_RF = rm -rf
TEST_F = test -f
TOUCH = touch
UMASK_NULL = umask 0
DEV_NULL = > /dev/null 2>&1
MKPATH = mkdir -p
CAT = cat
MAKE = make
OPEN = open
ECHO = echo
ECHO_N = echo -n
JAVA = java
DOXYGEN = $DOXYGEN
IPHONE_DOCSET_TMPDIR = docs/iphone/tmp
all :: $PLATFORMS docs
clean :: clean_docs clean_libs
clean_docs:
-\$(RM_RF) docs/javascript
-\$(RM_RF) docs/iphone
clean_libs:
-\$(RM_RF) lib
iphone/www/phonegap.js: lib/iphone/phonegap-min.js
\$(CP) lib/iphone/phonegap-min.js \$@
docs :: javascript_docs iphone_docs
EOF
if [ "x$DOXYGEN" != "x" ]; then
cat >> Makefile <<EOF
iphone_docs: iphone/doxygen.cfg
\$(DOXYGEN) iphone/doxygen.cfg
-\$(RM_RF) \$(IPHONE_DOCSET_TMPDIR)
\$(MKPATH) \$(IPHONE_DOCSET_TMPDIR)
\$(CP) iphone/doxygen.cfg \$(IPHONE_DOCSET_TMPDIR)/doxygen.cfg
\$(ECHO) "OUTPUT_DIRECTORY = docs/iphone/PhoneGap.docset" >> \$(IPHONE_DOCSET_TMPDIR)/doxygen.cfg
\$(ECHO) "GENERATE_DOCSET = YES" >> \$(IPHONE_DOCSET_TMPDIR)/doxygen.cfg
\$(DOXYGEN) \$(IPHONE_DOCSET_TMPDIR)/doxygen.cfg
\$(MAKE) -C docs/iphone/PhoneGap.docset/html install
\$(OPEN) ~/Library/Developer/Shared/Documentation/DocSets/org.phonegap.PhoneGap.docset
EOF
else
echo iphone_docs: >> Makefile
fi
echo javascript_docs :: javascripts/*.js >> Makefile
echo " \$(JAVA) -jar util/jsdoc-toolkit/jsrun.jar util/jsdoc-toolkit/app/run.js -a -d=docs/javascript -t=util/jsdoc-toolkit/templates/jsdoc " javascripts/*.js >> Makefile
for platform in $PLATFORMS; do
cat >> Makefile <<EOF
$platform: lib/$platform/phonegap-min.js
lib/$platform/phonegap-min.js: lib/$platform/phonegap.js
\$(JAVA) -jar util/yuicompressor-2.4.2.jar --charset UTF-8 -o \$@ lib/$platform/phonegap.js
EOF
platform_srcs="javascripts/phonegap.js.base javascripts/*.js javascripts/$platform/*.js"
echo lib/$platform/phonegap.js: $platform_srcs >> Makefile
echo " \$(RM_RF) lib/$platform" >> Makefile
echo " \$(MKPATH) lib/$platform" >> Makefile
echo " \$(RM_F) \$@" >> Makefile
for file in $( echo $platform_srcs ); do
echo " \$(CAT) $file >> \$@" >> Makefile
done
done
echo "Run \"make\" to build"
# vim: set ft=shell tabstop=4 noexpandtab: