#!/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 < /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 <> \$(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 <> 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: