home *** CD-ROM | disk | FTP | other *** search
Makefile | 1994-08-02 | 5.3 KB | 156 lines |
- #!smake
- # Makefile for making an xhelp book
- #
- # To build the xhelp book issue the command 'make xhelp'.
- # To build the inst images for the book issue the command 'make images'.
- #
- # The TITLE Variable
- #
- # TITLE defines the short title of the book and should be a representative
- # name for the application the help documents. The XHELP SGML file will
- # be then be called ${TITLE}.sgm.
- #
- # This title must be a valid directory name and not contain any special
- # characters - like '.' Do not have a trailing space on the TITLE line.
- #
- # TITLE = SiliconSurf
-
- TITLE = XContactHelp
-
- # The FULL_TITLE Variable
- #
- # FULL_TITLE defines the full title for the help book as it should appear
- # next to the icon on an InSight bookshelf.
- #
- # FULL_TITLE = Silicon Surf Help Book
-
- FULL_TITLE = XContact Help Book
-
- # The VERSION Variable
- #
- # VERSION defines the version number for this release of the product
- # and is displayed when the 'Product Info' item off the 'Help' menu is
- # selected.
- #
- # VERSION = 1.0
-
- VERSION = 1.0
-
- # The HIDDEN Variable
- #
- # HIDDEN defines whether this book will be displayed when this book
- # is accessed via the InSight library browser rather than the SGIHelp
- # browser from the application. The default is to keep the book hidden.
- # To change from the default uncomment the following line:
- #
- #HIDDEN = FALSE
-
- include ${ROOT}/usr/include/make/commonhelpdefs
-
- BOOKSHELF = /usr/share/Insight/library/SGI_bookshelves/Help
- BOOKDIR = books/XContactHelp
- HELPCARDSIDBTAG = xcontact.books.help
- HELPDBDIR = /usr/share/Insight/library/SGI_bookshelves/Help
-
- default xhelp: mk_help copy_figures
-
- clobber:
- touch booklist.txt books
- /bin/rm -r booklist.txt* books
-
- install:${BOOKDIR} xhelp
- @echo "Installing Help Cards..."
- /bin/rm -r $(BOOKDIR)/*.dtd $(BOOKDIR)/*.sgm $(BOOKDIR)/styles
- /bin/cp -r /usr/share/Insight/XHELP/styles $(BOOKDIR)
- /bin/chmod 0644 $(BOOKDIR)/styles/*
- /bin/mv booklist.txt $(BOOKDIR)
- find $(BOOKDIR) -type f -exec \
- $(INSTALL) -idb $(HELPCARDSIDBTAG) -F $(HELPDBDIR) -m 644 '{}' \;
- $(INSTALL) -idb '$(HELPCARDSIDBTAG) exitop("\$$rbase/usr/share/Insight/lib/addBooklist \$$rbase${BOOKSHELF} \$$rbase${BOOKSHELF}/${BOOKDIR}/booklist.txt")' -F /usr/share/help -m 644 XContact.helpmap
- @echo "Done."
-
-
- # Common rules for making xhelp book
-
-
- ${BOOKDIR}::
- @if [ ! -d ${BOOKDIR} ] ; then mkdir -p ${BOOKDIR}; fi
-
- ${BOOKDIR}/${BOOK}.sgm: ${HELP_FILE} ${BOOKDIR}
- @${RM} -f ${BOOKDIR}/${BOOK}.sgm;
- @${CP} ${HELP_FILE} ${BOOKDIR}/${BOOK}.sgm
-
- # notice that any tdr files less than 37 in length are being removed
- mk_help: prep_book
- @(EBTRC=${EBTRC}; TOOLROOT=${ITOOLROOT}; export EBTRC TOOLROOT; \
- ${MKHELP} -col . ${BOOK})
- -@${RM} -f `${LS} -l ${BOOKDIR}/ebt/*.tdr | ${AWK} '{if ($$5 < 37) print $$9}'`
-
- prep_book: ${BOOKDIR}/${BOOK}.sgm
- @if [ ! -d ${BOOKDIR}/ebt ] ; then \
- mkdir -p ${BOOKDIR}/ebt; fi
- @if [ ! -d ${BOOKDIR}/index ] ; then \
- mkdir -p ${BOOKDIR}/index; fi
- @if [ ! -f ${BOOKDIR}/${BOOK}.dtd ] ; then \
- ln -s ${XHELP_LIB}/dtd/XHELP.dtd ${BOOKDIR}/${BOOK}.dtd; \
- fi
- @if [ ! -d ${BOOKDIR}/styles ] ; then \
- ln -s ${XHELP_LIB}/styles ${BOOKDIR}/styles; \
- fi
- @if [ -f booklist.txt ] ; then \
- ${MV} booklist.txt booklist.txt.old; \
- fi
- @echo '<BOOK name="${TITLE}" alias="${FULL_TITLE}" type="generic" hide="${HIDDEN}" version="${VERSION}" srchres="0" srchtags="TITLE:Titles;CAPTION,FIGURE:Figure Captions:1;CAPTION,TABLE:Table Captions:1;TABLE:Tables;CODE EXAMPLE:Code Examples">' > booklist.txt
-
- copy_figures:
- @if [ -d online ] ; then \
- if [ ! -d ${BOOKDIR}/figures ] ; then \
- mkdir -p ${BOOKDIR}/figures; fi ; \
- ${RM} -f ${BOOKDIR}/figures/* ; \
- (cd online; for i in *; do \
- ${CP} $$i ../${BOOKDIR}/figures/$$i ;\
- done; cd ..) ; \
- elif [ -d figures ] ; then \
- if [ ! -d ${BOOKDIR}/figures ] ; then \
- mkdir -p ${BOOKDIR}/figures; fi ; \
- ${RM} -f ${BOOKDIR}/figures/* ; \
- (cd figures; for i in *; do \
- ${CP} $$i ../${BOOKDIR}/figures/$$i ;\
- done; cd ..) ; \
- fi
-
-
- # make images for this book
- images: xhelp
- @RAWIDB=$(IDBFILE); export RAWIDB ; \
- if [ -f $$RAWIDB ] ; then mv $$RAWIDB $$RAWIDB.prev ; fi ; \
- echo "RAWIDB=$$RAWIDB SRC=$(SRC) $(MAKE) install" ; \
- $(MAKE) SRC=$(SRC) install
- @newvnum=`${MKVNUM} -r "102" -b "" -t "0" -f ""` ; \
- echo "$$newvnum" > .version_number; \
- echo "$$newvnum" | sed -e "s/...\(.....\)../\1/" > .alpha_number; \
- ${SHOWVNUM} $$newvnum ; \
- VERSION=`cat .version_number` ; \
- if [ ! -d images ]; then mkdir images; fi; \
- (cd images; rm -f *) ; \
- USESPEC=spec; \
- echo "\nderiving name of product to generate from spec file\n"; \
- RAWIDB=$(IDBFILE); export RAWIDB ; \
- USEALLIMAGES=`${SPECPROD} $$USESPEC`; \
- echo "\nderiving file finalidb from file $(RAWIDB)\n"; \
- sort +4 -5 $$RAWIDB -o finalidb; \
- echo "${GENDIST} -verbose -all -root /"; \
- echo "\t-source `pwd` -idb finalidb"; \
- echo "\t-spec $$USESPEC -dist images $$USEALLIMAGES"; \
- ${GENDIST} -verbose -all -root / -source `pwd` \
- -idb finalidb -spec $$USESPEC -dist images $$USEALLIMAGES
-
- # Remove the files in the 'books' sub directory and the image files.
- clean::
- ${RM} -rf ${BOOKDIR}/ebt ${BOOKDIR}/index ${BOOKDIR}/styles
- ${RM} -rf ${BOOKDIR}/entities ${BOOKDIR}/figures
- ${RM} -f ${BOOKDIR}/${BOOK}.dtd ${BOOKDIR}/${BOOK}.sgm
- ${RMDIR} ${BOOKDIR} books
- ${RM} -f booklist.txt* finalidb .version_number IDB.prev
- ${RM} -rf images
-