| 1 |
# Makefile for NEdit text editor documentation |
| 2 |
# |
| 3 |
# $Id: Makefile,v 1.6 2003/11/24 17:41:34 edg Exp $ |
| 4 |
# |
| 5 |
# NEdit help documentation and internal help code using one common |
| 6 |
# source, help.etx, a Structure Enhanced TEXT document. |
| 7 |
# |
| 8 |
.SUFFIXES: .man .pod |
| 9 |
|
| 10 |
instructions: |
| 11 |
@ echo "" |
| 12 |
@ echo "This make file is intended for NEdit developers only." |
| 13 |
@ echo "" |
| 14 |
@ echo "It uses a perl program (setext) to extract the various forms" |
| 15 |
@ echo "of the NEdit help documentation and internal help code using" |
| 16 |
@ echo "one common source, help.etx, a Structure Enhanced TEXT document." |
| 17 |
@ echo "" |
| 18 |
@ echo "Additionally, it generates the nedit and nc man pages." |
| 19 |
@ echo "To generate those you need to have perl and pod2man installed." |
| 20 |
@ echo "" |
| 21 |
@ echo "The following are the main targets which generate files for" |
| 22 |
@ echo "NEdit development. They are:" |
| 23 |
@ echo "" |
| 24 |
@ echo " help - generates NEdit help code (help_topic.h, help_data.h)" |
| 25 |
@ echo " doc - generates various forms of NEdit documentation" |
| 26 |
@ echo " man - generates the nedit and nc man pages" |
| 27 |
@ echo " all - generates all the files" |
| 28 |
@ echo "" |
| 29 |
@ echo "Remember to specify the VERSION macro on the make command" |
| 30 |
@ echo "or as an environment variable so that the NEdit version" |
| 31 |
@ echo "gets placed appropriately. For example, the following" |
| 32 |
@ echo "command creates all the files for NEdit version 5.3" |
| 33 |
@ echo "" |
| 34 |
@ echo " make VERSION='NEdit 5.3' all" |
| 35 |
@ echo "" |
| 36 |
@ echo "When the version is not specified, the default value will" |
| 37 |
@ echo "be 'NEdit release of <currentDate>'" |
| 38 |
@ echo "" |
| 39 |
|
| 40 |
.version: |
| 41 |
@ if [ "$(VERSION)" = "" ]; then \ |
| 42 |
echo "NEdit release of `date +'%b %e, %Y'`" > .version; \ |
| 43 |
else \ |
| 44 |
echo "$(VERSION)" > .version; \ |
| 45 |
fi |
| 46 |
help: ../source/help_topic.h ../source/help_data.h setext |
| 47 |
|
| 48 |
../source/help_topic.h ../source/help_data.h: .version help.etx setext |
| 49 |
@ echo "Creating NEdit help code `cat .version`" |
| 50 |
@ ./setext -m -v version="`cat .version`" help.etx |
| 51 |
@ mv -f help_topic.h ../source |
| 52 |
@ mv -f help_data.h ../source |
| 53 |
|
| 54 |
nedit.html: .version help.etx setext |
| 55 |
@ echo "Creating NEdit HTML documentation..." |
| 56 |
@ ./setext -v version="`cat .version`" help.etx nedit.html |
| 57 |
|
| 58 |
html/nedit.html: .version help.etx setext |
| 59 |
@ echo "Creating NEdit HTML website documentation..." |
| 60 |
@ if [ ! -d html ]; then mkdir html; fi |
| 61 |
@ if [ -d html ]; then \ |
| 62 |
cd html; \ |
| 63 |
../setext -S -v version="`cat ../.version`" ../help.etx nedit.html; \ |
| 64 |
else \ |
| 65 |
echo "** Unable to create html directory to hold NEdit documentation"; \ |
| 66 |
fi |
| 67 |
|
| 68 |
nedit.doc: .version help.etx setext |
| 69 |
@ echo "Creating NEdit plain text documenation..." |
| 70 |
@ ./setext -c NEDITDOC -v version="`cat .version`" help.etx nedit.doc |
| 71 |
|
| 72 |
nc.man: .version |
| 73 |
nedit.man: .version |
| 74 |
.pod.man: |
| 75 |
@ echo "Creating $* man page..." |
| 76 |
@ which pod2man > /dev/null 2>&1 || ( echo "Sorry, you need pod2man." && exit 1 ) |
| 77 |
@ pod2man --release="`cat .version`" --center="NEdit documentation" $*.pod > $@ |
| 78 |
|
| 79 |
doc: .version nedit.doc nedit.html html/nedit.html |
| 80 |
|
| 81 |
man: .version nedit.man nc.man |
| 82 |
|
| 83 |
all: help doc man |
| 84 |
|
| 85 |
clean: |
| 86 |
@ echo "Removing generated NEdit documentation..." |
| 87 |
@ rm -rf help nedit.html html nedit.doc .version nedit.man nc.man |
| 88 |
|
| 89 |
# |
| 90 |
# FAQ targets. Requires an XSLT parser and processor, such as Java with the |
| 91 |
# XP and XT packages (http://www.jclark.com/xml/) |
| 92 |
# Override the XSLT variable at the command line as follows: |
| 93 |
# |
| 94 |
# make XSLT=<command to process the xsl files> faq |
| 95 |
# |
| 96 |
# Example: make XSLT="java -classpath xp.jar:xt.jar com.jclark.xsl.sax.Driver" faq |
| 97 |
# |
| 98 |
XSLT=undefined |
| 99 |
|
| 100 |
faq: check_xsl faq.txt html/faq/index.shtml |
| 101 |
|
| 102 |
faq.txt: faq.xml faq-txt.xsl faq-txt-pass2.xsl faq-txt.awk |
| 103 |
@ echo Building FAQ - text version |
| 104 |
@ rm -f faq-txt.html faq-txt-tmp.txt faq.txt |
| 105 |
@ ${XSLT} faq.xml faq-txt.xsl faq-txt.html |
| 106 |
@ ${XSLT} faq-txt.html faq-txt-pass2.xsl faq-txt-tmp.txt |
| 107 |
@ awk -f faq-txt.awk < faq-txt-tmp.txt > faq.txt |
| 108 |
@ rm -f faq-txt-tmp.txt |
| 109 |
|
| 110 |
html/faq/index.shtml: faq.xml faq-txt.xsl |
| 111 |
@ echo Building FAQ - HTML version |
| 112 |
@ rm -f html/faq/*.shtml |
| 113 |
@ if [ ! -d html ]; then mkdir html; fi |
| 114 |
@ if [ ! -d html/faq ]; then mkdir html/faq; fi |
| 115 |
@ ${XSLT} faq.xml faq.xsl html/faq/index.shtml |
| 116 |
|
| 117 |
check_xsl: |
| 118 |
@ if [ "x${XSLT}" = "xundefined" ]; \ |
| 119 |
then\ |
| 120 |
echo "To rebuild the FAQ, an XSLT parser and processer are required.";\ |
| 121 |
echo "For instance, a Java runtime environment and the XT and XP";\ |
| 122 |
echo "packages (http://www.jclark.com/xml/) can be used.";\ |
| 123 |
echo "Then type:";\ |
| 124 |
echo "";\ |
| 125 |
echo " make XSLT=<command to process the xsl files> faq";\ |
| 126 |
echo "";\ |
| 127 |
echo "For instance:";\ |
| 128 |
echo "";\ |
| 129 |
echo " make XSLT=\"java -classpath xp.jar:xt.jar com.jclark.xsl.sax.Driver\" faq";\ |
| 130 |
echo "";\ |
| 131 |
exit 1;\ |
| 132 |
fi |
| 133 |
|
| 134 |
FAQFILES = faq-txt.html faq-txt.xsl faq-txt-pass2.xsl faq-txt.awk\ |
| 135 |
faq-txt.dtd README.FAQ faq.txt Makefile faq.xml faq.xsl\ |
| 136 |
faq.dtd |
| 137 |
faq-dist: |
| 138 |
@ echo "Building faq.tar.gz";\ |
| 139 |
rm -f faq.tar.gz;\ |
| 140 |
DISTFILES="${FAQFILES} `ls html/faq/*.shtml`";\ |
| 141 |
tar cv $${DISTFILES} | gzip -c > faq.tar.gz;\ |
| 142 |
echo "Building faq.zip";\ |
| 143 |
rm -f faq.zip;\ |
| 144 |
zip faq.zip $${DISTFILES};\ |