home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / viewkit / xcontact / onlineHelp / Makefile next >
Encoding:
Makefile  |  1994-08-02  |  5.3 KB  |  156 lines

  1. #!smake
  2. # Makefile for making an xhelp book
  3. #
  4. # To build the xhelp book issue the command 'make xhelp'.
  5. # To build the inst images for the book issue the command 'make images'.
  6. #
  7. # The TITLE Variable
  8. #
  9. # TITLE defines the short title of the book and should be a representative
  10. # name for the application the help documents.  The XHELP SGML file will
  11. # be then be called ${TITLE}.sgm.
  12. #
  13. # This title must be a valid directory name and not contain any special
  14. # characters - like '.'  Do not have a trailing space on the TITLE line.
  15. #
  16. # TITLE = SiliconSurf
  17.  
  18. TITLE  = XContactHelp
  19.  
  20. # The FULL_TITLE Variable
  21. #
  22. # FULL_TITLE defines the full title for the help book as it should appear
  23. # next to the icon on an InSight bookshelf.
  24. #
  25. # FULL_TITLE = Silicon Surf Help Book
  26.  
  27. FULL_TITLE = XContact Help Book
  28.  
  29. # The VERSION Variable
  30. #
  31. # VERSION defines the version number for this release of the product
  32. # and is displayed when the 'Product Info' item off the 'Help' menu is
  33. # selected.
  34. #
  35. # VERSION = 1.0
  36.  
  37. VERSION = 1.0
  38.  
  39. # The HIDDEN Variable
  40. #
  41. # HIDDEN defines whether this book will be displayed when this book
  42. # is accessed via the InSight library browser rather than the SGIHelp
  43. # browser from the application. The default is to keep the book hidden.
  44. # To change from the default uncomment the following line:
  45. #
  46. #HIDDEN = FALSE
  47.  
  48. include  ${ROOT}/usr/include/make/commonhelpdefs
  49.  
  50. BOOKSHELF = /usr/share/Insight/library/SGI_bookshelves/Help
  51. BOOKDIR = books/XContactHelp
  52. HELPCARDSIDBTAG = xcontact.books.help
  53. HELPDBDIR = /usr/share/Insight/library/SGI_bookshelves/Help
  54.  
  55. default xhelp: mk_help copy_figures
  56.  
  57. clobber:
  58.     touch booklist.txt books
  59.     /bin/rm -r booklist.txt* books
  60.  
  61. install:${BOOKDIR} xhelp
  62.     @echo "Installing Help Cards..."
  63.     /bin/rm -r $(BOOKDIR)/*.dtd $(BOOKDIR)/*.sgm $(BOOKDIR)/styles
  64.     /bin/cp -r /usr/share/Insight/XHELP/styles $(BOOKDIR)
  65.     /bin/chmod 0644 $(BOOKDIR)/styles/*
  66.     /bin/mv booklist.txt $(BOOKDIR)
  67.     find $(BOOKDIR) -type f -exec \
  68.       $(INSTALL) -idb $(HELPCARDSIDBTAG) -F $(HELPDBDIR) -m 644 '{}' \;
  69.     $(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
  70.     @echo "Done."
  71.  
  72.  
  73. #    Common rules for making xhelp book
  74.  
  75.  
  76. ${BOOKDIR}::
  77.     @if [ ! -d ${BOOKDIR} ] ; then mkdir -p ${BOOKDIR}; fi
  78.  
  79. ${BOOKDIR}/${BOOK}.sgm: ${HELP_FILE} ${BOOKDIR}
  80.     @${RM} -f ${BOOKDIR}/${BOOK}.sgm;    
  81.     @${CP} ${HELP_FILE} ${BOOKDIR}/${BOOK}.sgm
  82.  
  83. # notice that any tdr files less than 37 in length are being removed
  84. mk_help: prep_book
  85.     @(EBTRC=${EBTRC}; TOOLROOT=${ITOOLROOT}; export EBTRC TOOLROOT; \
  86.         ${MKHELP} -col . ${BOOK})
  87.     -@${RM} -f `${LS} -l ${BOOKDIR}/ebt/*.tdr | ${AWK} '{if ($$5 < 37) print $$9}'`
  88.  
  89. prep_book: ${BOOKDIR}/${BOOK}.sgm
  90.     @if [ ! -d ${BOOKDIR}/ebt ] ; then \
  91.         mkdir -p ${BOOKDIR}/ebt; fi
  92.     @if [ ! -d ${BOOKDIR}/index ] ; then \
  93.         mkdir -p ${BOOKDIR}/index; fi
  94.     @if [ ! -f ${BOOKDIR}/${BOOK}.dtd ] ; then \
  95.         ln -s ${XHELP_LIB}/dtd/XHELP.dtd ${BOOKDIR}/${BOOK}.dtd; \
  96.     fi
  97.     @if [ ! -d  ${BOOKDIR}/styles ] ; then \
  98.         ln -s ${XHELP_LIB}/styles ${BOOKDIR}/styles; \
  99.     fi
  100.     @if [ -f booklist.txt ] ; then \
  101.         ${MV} booklist.txt booklist.txt.old; \
  102.     fi
  103.     @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
  104.  
  105. copy_figures:
  106.     @if [ -d online ] ; then \
  107.         if [ ! -d ${BOOKDIR}/figures ] ; then \
  108.         mkdir -p ${BOOKDIR}/figures; fi ; \
  109.         ${RM} -f ${BOOKDIR}/figures/* ; \
  110.         (cd online; for i in *; do \
  111.         ${CP} $$i ../${BOOKDIR}/figures/$$i ;\
  112.         done; cd ..) ; \
  113.     elif [ -d figures ] ; then \
  114.         if [ ! -d ${BOOKDIR}/figures ] ; then \
  115.         mkdir -p ${BOOKDIR}/figures; fi ; \
  116.         ${RM} -f ${BOOKDIR}/figures/* ; \
  117.         (cd figures; for i in *; do \
  118.         ${CP} $$i ../${BOOKDIR}/figures/$$i ;\
  119.         done; cd ..) ; \
  120.     fi
  121.  
  122.  
  123. # make images for this book
  124. images: xhelp
  125.     @RAWIDB=$(IDBFILE); export RAWIDB ; \
  126.         if [ -f $$RAWIDB ] ; then mv $$RAWIDB $$RAWIDB.prev ; fi ; \
  127.         echo "RAWIDB=$$RAWIDB SRC=$(SRC) $(MAKE) install" ; \
  128.         $(MAKE) SRC=$(SRC) install
  129.     @newvnum=`${MKVNUM} -r "102" -b ""  -t "0" -f ""` ; \
  130.     echo "$$newvnum" > .version_number; \
  131.     echo "$$newvnum" | sed -e "s/...\(.....\)../\1/" > .alpha_number; \
  132.     ${SHOWVNUM} $$newvnum ; \
  133.     VERSION=`cat .version_number` ; \
  134.     if [ ! -d images ]; then mkdir images; fi; \
  135.     (cd images; rm -f *) ; \
  136.     USESPEC=spec; \
  137.     echo "\nderiving name of product to generate from spec file\n"; \
  138.     RAWIDB=$(IDBFILE); export RAWIDB ; \
  139.     USEALLIMAGES=`${SPECPROD} $$USESPEC`; \
  140.     echo "\nderiving file finalidb from file $(RAWIDB)\n"; \
  141.     sort +4 -5 $$RAWIDB -o finalidb; \
  142.     echo "${GENDIST} -verbose -all -root /"; \
  143.     echo "\t-source `pwd` -idb finalidb"; \
  144.     echo "\t-spec $$USESPEC -dist images $$USEALLIMAGES"; \
  145.     ${GENDIST} -verbose -all -root / -source `pwd` \
  146.         -idb finalidb -spec $$USESPEC -dist images $$USEALLIMAGES
  147.  
  148. # Remove the files in the 'books' sub directory and the image files.
  149. clean::
  150.     ${RM} -rf ${BOOKDIR}/ebt ${BOOKDIR}/index ${BOOKDIR}/styles
  151.     ${RM} -rf ${BOOKDIR}/entities ${BOOKDIR}/figures
  152.     ${RM} -f ${BOOKDIR}/${BOOK}.dtd ${BOOKDIR}/${BOOK}.sgm
  153.     ${RMDIR} ${BOOKDIR} books
  154.     ${RM} -f booklist.txt* finalidb .version_number IDB.prev
  155.     ${RM} -rf images
  156.