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 echo "$(VERSION)" > xnedit-release ; \
56 fi
57
58
59 xnedit.html: .version help.etx setext
60 @ echo "Creating XNEdit HTML documentation..."
61 @ ./setext -v version="`cat .version`" help.etx xnedit.html
62
63 html/xnedit.html: .version help.etx setext
64 @ echo "Creating XNEdit HTML website documentation..."
65 @ if [ ! -d html ]; then mkdir html; fi
66 @ if [ -d html ]; then \
67 cd html; \
68 ../setext -S -v version="`cat ../.version`" ../help.etx xnedit.html; \
69 else \
70 echo "** Unable to create html directory to hold XNEdit documentation"; \
71 fi
72
73 xnedit.txt: .version help.etx setext
74 @ echo "Creating XNEdit plain text documenation..."
75 @ ./setext -c NEDITDOC -v version="`cat .version`" help.etx xnedit.txt
76
77 xnc.man: .version
78 xnedit.man: .version
79 .pod.man:
80 @ echo "Creating $* man page..."
81 @ which pod2man > /dev/null 2>&1 || ( echo "Sorry, you need pod2man." && exit 1 )
82 @ pod2man --release="`cat .version`" --center="XNEdit documentation" $*.pod > $@
83
84 doc: .version xnedit.txt xnedit.html html/xnedit.html
85
86 man: .version xnedit.man xnc.man
87
88 all: help doc man
89
90 clean:
91 @ echo "Removing generated XNEdit documentation..."
92 @ rm -rf help xnedit.html html xnedit.txt .version xnedit.man xnc.man
93
94