# # Zend Framework # # LICENSE # # This source file is subject to the new BSD license that is bundled # with this package in the file LICENSE.txt. # It is also available through the world-wide-web at this URL: # http://framework.zend.com/license/new-bsd # If you did not receive a copy of the license and are unable to # obtain it through the world-wide-web, please send an email # to license@zend.com so we can send you a copy immediately. # # @copyright Copyright (c) 2006 Zend Technologies USA Inc. (http://www.zend.com) # @license http://framework.zend.com/license/new-bsd New BSD License # # # Makefile - build Zend Framework product and documentation # # Main targets: # dist - produce zip and tarball. # zip - produce zip from staged tree. # tarball - produce tarball from staged tree. # stage - produce staged product tree. # export - get files from subversion. # docbook - build and stage manual from docbook sources. # phpdoc - build and stage API doc using phpDocumentor. # clean - remove staged files. # clean-docbook - remove temp files under docbook sources. # clean-export - remove exported product tree. # # -- parameters you are likely to want to change -- # PHPDOC is the command to run to run phpDocumentor. On Cygwin, # run 'php' with the phpdoc script as the argument, in Windows-style # path format, e.g. "C:/php/phpdoc". On UNIX/Linux you can just run # 'phpdoc' if that script is in your PATH. PHPDOC=php c:/xampp/php/phpdoc # ZF_TAG is the subversion tag to use to export the files. # Typically use 'HEAD' until the tree is tagged for a release # candidate, then use that tag. ZF_TAG=5189 # ZF_VERSION is the release version string to build. This is added # to the VERSION.txt file, and is also used for the name of the # staging directory and the names of the zip and tarball files. ZF_VERSION=1.0.0-RC2 # For LANG, use '*' if you want to build all manual # translations. If you want to build one language, use one of the # names of language directories, e.g. 'en', 'de', etc. You also can # use any file-globbing pattern. LANG=* # Locations of the DocBook DTD and XSL stylesheets DTD_URL=http://framework.zend.com/docbook/xml/4.4/docbookx.dtd XSL_URL=http://framework.zend.com/docbook-xsl/html/chunk.xsl # -- end of parameters you are likely to want to change -- SVN=svn SVN_USER= SVN_PASS= ZF_SVN_URL=http://framework.zend.com/svn/framework/trunk/ ZF_PRODUCTNAME=ZendFramework ZF_EXPORT_DIR=./ZendFramework-export-$(ZF_TAG) GDATA_PRODUCT_NAME=Zend Gdata GDATA_PRODUCTNAME=ZendGdata GDATA_PRODUCT=$(GDATA_PRODUCTNAME)-$(ZF_VERSION) GDATA_EXPORT_DIR=./$(GDATA_PRODUCTNAME)-export-$(ZF_TAG) STAGE_HOME=stage GDATA_STAGE_DIR=$(STAGE_HOME)/$(GDATA_PRODUCT) ZIP=zip GDATA_ZIPBALL=$(GDATA_PRODUCT).zip TAR=tar GDATA_TARBALL=$(GDATA_PRODUCT).tar.gz API_DOC_TITLE_CORE=Zend Gdata API Documentation API_DOC_TITLE_INCUBATOR=Zend Gdata API Incubator Documentation API_DOC_OUTPUT_STYLE=HTML:frames:DOM/earthli .PHONY: clean clean-docbook clean-export dist: export stage zipball tarball zip: zipball zipball: @echo "== CREATING ZIP ARCHIVE ==" (cd $(STAGE_HOME) && $(ZIP) -rq $(GDATA_ZIPBALL) $(GDATA_PRODUCT)) tar: tarball tarball: @echo "== CREATING TAR.GZ ARCHIVE ==" (cd $(STAGE_HOME) && $(TAR) -czf $(GDATA_TARBALL) $(GDATA_PRODUCT)) stage: stage-files stage-docs @echo "$(GDATA_PRODUCT_NAME) Release Candidate $(GDATA_VERSION) (build $(ZF_TAG))" > $(GDATA_STAGE_DIR)/VERSION.txt stage-files: @echo "== STAGING FILES ==" -mkdir -p $(GDATA_STAGE_DIR) @echo "...copying set of files for Zend Gdata distribution..." @(pwd=`pwd` ; cd $(ZF_EXPORT_DIR) && rsync --quiet --archive \ --delete --exclude=.svn --recursive \ --files-from="$$pwd/include-files-gdata" \ ./ $$pwd/$(GDATA_EXPORT_DIR)) @echo "...altering documentation/manual/en/manual.xml.in..." @mv $(GDATA_EXPORT_DIR)/documentation/manual/en/manual.xml.in \ $(GDATA_EXPORT_DIR)/documentation/manual/en/manual.xml.in.orig @awk '{ \ if ($$0 ~ /chapter|title|module_specs|[^h]ref/ && $$0 !~ /[Gg]data|subtitle|Reference Guide|"; } \ else \ { sub(/Zend Framework/, "Zend Gdata", $$0); print; } \ if ($$0 ~ /[Gg]data/) gdata = 1; else gdata = 0; \ }' \ $(GDATA_EXPORT_DIR)/documentation/manual/en/manual.xml.in.orig > \ $(GDATA_EXPORT_DIR)/documentation/manual/en/manual.xml.in @echo "...altering tests/Zend/AllTests.php..." @mv $(GDATA_EXPORT_DIR)/tests/Zend/AllTests.php \ $(GDATA_EXPORT_DIR)/tests/Zend/AllTests-orig.php @awk '{ \ if ($$0 ~ /require_once .Zend|addTest/ && $$0 !~ /[Gg]data/) \ { } \ else \ { print; } \ }' \ $(GDATA_EXPORT_DIR)/tests/Zend/AllTests-orig.php > \ $(GDATA_EXPORT_DIR)/tests/Zend/AllTests.php @echo "...altering README.txt..." @mv $(GDATA_EXPORT_DIR)/README.txt \ $(GDATA_EXPORT_DIR)/README-orig.txt @sed -e 's/Zend Framework/Zend Gdata/' -e 's/ZEND FRAMEWORK/ZEND GDATA/' \ $(GDATA_EXPORT_DIR)/README-orig.txt > \ $(GDATA_EXPORT_DIR)/README.txt @echo "...staging files..." @(pwd=`pwd` ; cd $(GDATA_EXPORT_DIR) && rsync --quiet --archive \ --delete --exclude-from="$$pwd/exclude-files-gdata" ./ $$pwd/$(GDATA_STAGE_DIR)) checkout: export export: @echo "== EXPORTING SVN FILES ==" [ -f "$(ZF_EXPORT_DIR)/VERSION.txt" ] || $(SVN) export -r $(ZF_TAG) --quiet --force --config-dir /tmp $(ZF_SVN_URL) $(ZF_EXPORT_DIR) stage-docs: docbook phpdoc docbook: docbook-core docbook-core: -mkdir -p $(GDATA_STAGE_DIR)/documentation/manual/core @for language in $(GDATA_EXPORT_DIR)/documentation/manual/$(LANG) ; do \ lang=`basename $$language` ; \ echo "== BUILDING AND STAGING END-USER DOCUMENTATION [CORE] (language: $$lang) ==" ; \ ( cd $$language && autoconf && sh ./configure && $(MAKE) -e clean html ) ; \ rsync --archive --delete $$language/html/ $(GDATA_STAGE_DIR)/documentation/manual/core/$$lang ; \ done docbook-incubator: -mkdir -p $(GDATA_STAGE_DIR)/documentation/manual/incubator @for language in $(GDATA_EXPORT_DIR)/incubator/documentation/manual/$(LANG) ; do \ lang=`basename $$language` ; \ echo "== BUILDING AND STAGING END-USER DOCUMENTATION [INCUBATOR] (language: $$lang) ==" ; \ ( cd $$language && autoconf && sh ./configure && $(MAKE) -e clean html ) ; \ rsync --archive --delete $$language/html/ $(GDATA_STAGE_DIR)/documentation/manual/incubator/$$lang ; \ done phpdoc: phpdoc-core phpdoc-core: @echo "== BUILDING AND STAGING API DOCUMENTATION (CORE) ==" -mkdir -p $(GDATA_STAGE_DIR)/documentation/api/core @if [ ! -f $(GDATA_STAGE_DIR)/documentation/api/core/index.html -o `find $(GDATA_STAGE_DIR)/library -newer $(GDATA_STAGE_DIR)/documentation/api/core/index.html 2>/dev/null | wc -l` -gt 0 ] ; then \ $(PHPDOC) --quiet off \ --target $(GDATA_STAGE_DIR)/documentation/api/core \ --directory $(GDATA_STAGE_DIR)/library \ --title "$(API_DOC_TITLE_CORE)" \ --output $(API_DOC_OUTPUT_STYLE) ; \ else \ echo "...core API documentation is up to date." ; \ fi phpdoc-incubator: @echo "== BUILDING AND STAGING API DOCUMENTATION (INCUBATOR) ==" -mkdir -p $(GDATA_STAGE_DIR)/documentation/api/incubator @if [ ! -f $(GDATA_STAGE_DIR)/documentation/api/incubator/index.html -o `find $(GDATA_STAGE_DIR)/library -newer $(GDATA_STAGE_DIR)/documentation/api/incubator/index.html 2>/dev/null | wc -l` -gt 0 ] ; then \ $(PHPDOC) --quiet off \ --target $(GDATA_STAGE_DIR)/documentation/api/incubator \ --directory $(GDATA_STAGE_DIR)/incubator/library \ --title "$(API_DOC_TITLE_INCUBATOR)" \ --output $(API_DOC_OUTPUT_STYLE) ; \ else \ echo "...incubator API documentation is up to date." ; \ fi clean: -rm -rf $(GDATA_STAGE_DIR) -rm -f $(GDATA_ZIPBALL) -rm -f $(GDATA_TARBALL) clean-docbook: for language in $(GDATA_EXPORT_DIR)/documentation/manual/$(LANG)/ ; do \ ( cd $$language && make cleanall ) \ done clean-export: -rm -rf $(GDATA_EXPORT_DIR)