|
| 1 | +# +----------------------------------------------------------------------+ |
| 2 | +# | PHP Version 5.1 | |
| 3 | +# +----------------------------------------------------------------------+ |
| 4 | +# | Copyright (c) 1999-2006 The PHP Group | |
| 5 | +# +----------------------------------------------------------------------+ |
| 6 | +# | This source file is subject to version 3.0.1 of the PHP license, | |
| 7 | +# | that is bundled with this package in the file LICENSE and is | |
| 8 | +# | available online at http://www.php.net/license/3_0_1.txt. | |
| 9 | +# | If you did not receive a copy of the PHP license and are unable to | |
| 10 | +# | obtain it through the world wide web, please send a note to | |
| 11 | +# | [email protected] so we can mail you a copy immediately | |
| 12 | +# +----------------------------------------------------------------------+ |
| 13 | +# | Authors: James Moore <[email protected]>, Steph Fox <[email protected]> | |
| 14 | +# +----------------------------------------------------------------------+ |
| 15 | + |
| 16 | +# |
| 17 | +# $Id$ |
| 18 | +# |
| 19 | + |
| 20 | +# |
| 21 | +# Paths |
| 22 | +# |
| 23 | +STYLESHEET_DIR = @STYLESHEET_DIR@ |
| 24 | +SCRIPT_DIR = @SCRIPT_DIR@ |
| 25 | +MANUAL = @MANUAL@ |
| 26 | +LANG = @LANG@ |
| 27 | +BUILD = build/@LANG@ |
| 28 | +BUILD_TEST = testbuild |
| 29 | +HISTORY = @HISTORY@ |
| 30 | + |
| 31 | +# |
| 32 | +# Programs and scripts |
| 33 | +# |
| 34 | +XSLTPROC = @XSLTPROC@ |
| 35 | +PHP = @PHP@ |
| 36 | +HIGHLIGHT = $(SCRIPT_DIR)/highlight.php |
| 37 | +SPLIT = $(SCRIPT_DIR)/distribute_html.php |
| 38 | +IMAGES = $(SCRIPT_DIR)/copy_images.php |
| 39 | +TMP = $(BUILD_TEST)/temp.php |
| 40 | +TS = @TS@ |
| 41 | + |
| 42 | +# |
| 43 | +# Default Rule |
| 44 | +# |
| 45 | +all: html |
| 46 | + |
| 47 | +# |
| 48 | +# Build Aliases |
| 49 | +# |
| 50 | +bigmanual.html: $(BUILD)/bigmanual.html |
| 51 | +html: $(BUILD)/html/index.html |
| 52 | +phpweb: $(BUILD)/php/index.php |
| 53 | +mtoc: $(BUILD_TEST)/mtoc.xml |
| 54 | +test: $(BUILD_TEST)/index.html |
| 55 | +updates: $(BUILD_TEST)/updates-$(LANG).php |
| 56 | + |
| 57 | +mirror-files: $(BUILD)/bigmanual.html.gz \ |
| 58 | + $(BUILD)/php_gtk_manual_$(LANG).tar.bz2 \ |
| 59 | + $(BUILD)/php_gtk_manual_$(LANG).tar.gz \ |
| 60 | + $(BUILD)/php_gtk_manual_$(LANG).zip |
| 61 | + |
| 62 | +# |
| 63 | +# Dependency Aliases |
| 64 | +# |
| 65 | +html = $(STYLESHEET_DIR)/html.xsl |
| 66 | +chunk = $(STYLESHEET_DIR)/chunk.xsl |
| 67 | +phpweb = $(STYLESHEET_DIR)/phpweb.xsl |
| 68 | +docbook = $(STYLESHEET_DIR)/docbook.xsl |
| 69 | +updates = $(STYLESHEET_DIR)/updates.xsl |
| 70 | + |
| 71 | +# |
| 72 | +# Make Rules |
| 73 | +# |
| 74 | +$(BUILD)/bigmanual.html: $(SCRIPT_DIR)/manual.xml |
| 75 | + @mkdir -p $(BUILD) |
| 76 | + $(XSLTPROC) --xinclude $(docbook) $(SCRIPT_DIR)/manual.xml > $(BUILD)/bigmanual.html |
| 77 | + |
| 78 | +$(BUILD)/html/index.html: scripts/manual.xml |
| 79 | + @mkdir -p $(BUILD)/html |
| 80 | + $(XSLTPROC) --param base.dir "'$(BUILD)/html/'" --xinclude $(chunk) $(SCRIPT_DIR)/manual.xml |
| 81 | + $(PHP) $(SPLIT) $(BUILD)/html |
| 82 | + $(PHP) $(IMAGES) $(BUILD)/html |
| 83 | + |
| 84 | +$(BUILD)/php/index.php: scripts/manual.xml |
| 85 | + @mkdir -p $(BUILD)/php |
| 86 | + $(XSLTPROC) --param base.dir "'$(BUILD)/php/'" --xinclude $(phpweb) $(SCRIPT_DIR)/manual.xml |
| 87 | + $(PHP) $(HIGHLIGHT) php $(BUILD)/php |
| 88 | + $(PHP) $(IMAGES) $(BUILD)/php |
| 89 | + |
| 90 | +$(BUILD)/bigmanual.html.gz: $(BUILD)/bigmanual.html |
| 91 | + @mkdir -p $(BUILD) |
| 92 | + gzip -c -9 $< > $@ |
| 93 | + |
| 94 | +$(BUILD)/php_gtk_manual_$(LANG).tar.bz2: $(BUILD)/html/index.html |
| 95 | + (cd $(BUILD); tar -cf - html) | bzip2 -9 > $@ |
| 96 | + |
| 97 | +$(BUILD)/php_gtk_manual_$(LANG).tar.gz: $(BUILD)/html/index.html |
| 98 | + (cd $(BUILD); tar -c html) | gzip -9 > $@ |
| 99 | + |
| 100 | +$(BUILD)/php_gtk_manual_$(LANG).zip: $(BUILD)/html/index.html |
| 101 | + (cd $(BUILD); zip -q -r -9 - html) > $@ |
| 102 | + |
| 103 | +$(BUILD_TEST)/index.html: $(SCRIPT_DIR)/testmanual.xml |
| 104 | + @mkdir -p $(BUILD_TEST) |
| 105 | + $(XSLTPROC) --param base.dir --xinclude "'$(BUILD_TEST)/'" $(chunk) $(SCRIPT_DIR)/testmanual.xml |
| 106 | + |
| 107 | +$(BUILD_TEST)/mtoc.xml: $(SCRIPT_DIR)/mtoc.xml |
| 108 | + @mkdir -p $(BUILD_TEST) |
| 109 | + $(XSLTPROC) --param base.dir --xinclude "'$(BUILD_TEST)/'" $(chunk) $(SCRIPT_DIR)/mtoc.xml |
| 110 | + |
| 111 | +$(BUILD_TEST)/updates-$(LANG).php: $(SCRIPT_DIR)/testclasses.xml |
| 112 | + @mkdir -p $(BUILD_TEST) |
| 113 | + $(XSLTPROC) $(updates) $(SCRIPT_DIR)/testmanual.xml > $(TMP) |
| 114 | + @cat $(TMP) | sed -e 's/ \[en\]//;s/\"\"/"$(TS)"/;/php/!d;s/^ *//' > $(BUILD_TEST)/updates-new.php |
| 115 | + @if test -f $(HISTORY)/updates-$(LANG).php; then \ |
| 116 | + cp $(HISTORY)/updates-$(LANG).php $@; \ |
| 117 | + $(PHP) $(SCRIPT_DIR)/merge_updates.php $(BUILD_TEST)/updates-new.php $@; \ |
| 118 | + else \ |
| 119 | + mv $(BUILD_TEST)/updates-new.php $@; \ |
| 120 | + fi |
| 121 | + @rm -f $(TMP) |
| 122 | + |
| 123 | +# |
| 124 | +# Clean Rules |
| 125 | +# |
| 126 | +clean: |
| 127 | + rm -rf $(BUILD) |
| 128 | + rm -rf autom4te.cache |
| 129 | + rm -f config.status config.log configure Makefile |
| 130 | + rm -f $(MANUAL)/chapters.ent |
| 131 | + rm -f $(SCRIPT_DIR)/manual.xml $(SCRIPT_DIR)/genchapterents.php $(SCRIPT_DIR)/update.xsl |
| 132 | + |
| 133 | +distclean: clean |
| 134 | + rm -f Makefile $(SCRIPT_DIR)/manual.xml configure |
| 135 | + rm -f config.cache config.log config.status version.ent |
| 136 | + cd $(SCRIPT_DIR); rm -f genchapterents.php |
| 137 | + cd $(STYLESHEET_DIR); rm -f phpweb.xsl |
| 138 | + rm -rf $(BUILD_TEST) |
| 139 | + |
| 140 | +cvsclean: |
| 141 | + @for i in `find . -name .cvsignore`; do \ |
| 142 | + (cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore` || true); \ |
| 143 | + done |
0 commit comments