Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 117 lines (96 sloc) 3.333 kb
#!/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
Makefile: configure javascripts/.exclude
./configure
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='';
for filename in `ls -1 javascripts/$platform/*.js | xargs basename`; do
if [ -s javascripts/.exclude ]; then
`grep -q -v $filename javascripts/.exclude` || continue
fi
if [ -f javascripts/$platform/$filename ] && [ -f javascripts/$filename ]; then
platform_srcs="$platform_srcs javascripts/$filename javascripts/$platform/$filename";
fi
done
platform_srcs="javascripts/phonegap.js.base javascripts/iphone/phonegap.js $platform_srcs $(echo javascripts/app/*.js)"
echo lib/$platform/phonegap.js: Makefile $platform_srcs >> Makefile
echo " \$(RM_RF) lib/$platform" >> Makefile
echo " \$(MKPATH) lib/$platform" >> Makefile
echo " \$(RM_F) \$@" >> Makefile
echo " \$(CAT) $platform_srcs > \$@" >> Makefile
echo >> Makefile
done
echo "Run \"make\" to build"
# vim: set ft=shell tabstop=4 noexpandtab:
Jump to Line
Something went wrong with that request. Please try again.