UNIXworkcode

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='XNEdit 1.5' all" 35 @ echo "" 36 @ echo "When the version is not specified, the default value will" 37 @ echo "be 'XNEdit rev <gitRev>'" 38 @ echo "" 39 40 .version: 41 @ if [ "$(VERSION)" = "" ]; then \ 42 ./generate_version.sh > .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 XNEdit 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 @ if [ ! -z "$(VERSION)" ]; then \ 54 echo "#define XNEDIT_IS_RELEASE" >> ../source/help_data.h ; \ 55 fi 56 57 xnedit.html: .version help.etx setext 58 @ echo "Creating XNEdit HTML documentation..." 59 @ ./setext -v version="`cat .version`" help.etx xnedit.html 60 61 html/xnedit.html: .version help.etx setext 62 @ echo "Creating XNEdit HTML website documentation..." 63 @ if [ ! -d html ]; then mkdir html; fi 64 @ if [ -d html ]; then \ 65 cd html; \ 66 ../setext -S -v version="`cat ../.version`" ../help.etx xnedit.html; \ 67 else \ 68 echo "** Unable to create html directory to hold XNEdit documentation"; \ 69 fi 70 71 xnedit.txt: .version help.etx setext 72 @ echo "Creating XNEdit plain text documenation..." 73 @ ./setext -c NEDITDOC -v version="`cat .version`" help.etx xnedit.txt 74 75 xnc.man: .version 76 xnedit.man: .version 77 .pod.man: 78 @ echo "Creating $* man page..." 79 @ which pod2man > /dev/null 2>&1 || ( echo "Sorry, you need pod2man." && exit 1 ) 80 @ pod2man --release="`cat .version`" --center="XNEdit documentation" $*.pod > $@ 81 82 doc: .version xnedit.txt xnedit.html html/xnedit.html 83 84 man: .version xnedit.man xnc.man 85 86 all: help doc man 87 88 clean: 89 @ echo "Removing generated XNEdit documentation..." 90 @ rm -rf help xnedit.html html xnedit.txt .version xnedit.man xnc.man 91 92