home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / docs / lovelace / makefile < prev    next >
Encoding:
Makefile  |  1995-12-08  |  4.1 KB  |  134 lines

  1. # This makefile automates generating Lovelace tutorial files
  2. # from its source files (.les) files.
  3.  
  4. # It is unabashedly Unix-dependent, though translating it to some
  5. # other system (like MS-DOS) shouldn't be too hard if desired.
  6. # It's intended for my (David A. Wheeler's) personal use,
  7. # but I'm including it in the distribution since it might be useful.
  8.  
  9. # Definitions of generic lesson-generating rules.
  10.  
  11. # The "-s" option in mklesson generates short filename extensions
  12. # (.htm instead of .html):
  13.  
  14. MKLESSON=mklesson -s
  15.  
  16. .les.tim:
  17.     $(MKLESSON) $<
  18.  
  19. SUFFIXES += .tim .les
  20.  
  21. .SUFFIXES : $(SUFFIXES)
  22.  
  23. # Makefile variable definitions for file generation.
  24.  
  25. OBJECT_FILES = lesson1.tim lesson2.tim lesson3.tim lesson4.tim \
  26.                lesson5.tim lesson6.tim lesson7.tim lesson8.tim \
  27.                lesson9.tim lesson10.tim lesson11.tim lesson12.tim \
  28.                lesson13.tim lesson14.tim lesson15.tim lesson16.tim \
  29.                lesson17.tim
  30.  
  31. # Lesson 18 is _NOT_ listed in OBJECT_FILES because it's generated
  32. # while generating program "Small".
  33. # However, the source file (lesson18.les) _is_ included in Lovelace.
  34.  
  35. MKLESSON_FILES = readme gpl lgpl userg.htm mklesson template default \
  36.               formattm.htm formatmk.txt blank.les new_sect \
  37.               previous.gif next.gif up.gif tinyhome.gif \
  38.               skip1-1.htm txt-temp makefile
  39.  
  40. # File name of the "last lesson" (i.e. the lesson/section that doesn't exist)
  41. LAST_LESSON = s19-1.htm
  42.  
  43.  
  44. # Rules for file generation; default is "all".
  45.  
  46. # Comments to myself:
  47. # Before running this command "for real", regenerate all files for
  48. # program Small, and from the Small directory "make install".
  49. # This will place Small results into the Lovelace files.
  50. # To everyone else this will make no difference, since Small is distributed
  51. # as part of Lovelace.
  52.  
  53. # Note all the checking systems;
  54. # weblint looks for HTML errors, hspell for spelling errors, and
  55. # gcc calls GNAT to check for Ada syntax errors.
  56. # Perhaps later I'll add "-gnatg" and explicitly use GNAT style.
  57.  
  58. all: $(OBJECT_FILES) comments.htm
  59.     echo "Make sure you've install the program Small files."
  60.     cp fini.htm $(LAST_LESSON)
  61.     chmod ugo+r [a-z]*
  62.     weblint -e bad-link,mailto-link,upper-case \
  63.                 -d heading-order,empty-container -x netscape *.htm
  64.     hspell -x comments.htm *.htm
  65.     gcc -c -gnatc -gnatk8 *.adb *.ads
  66.  
  67. comments.htm: comments.hd COMMENTS comments.tl
  68.     mkcomm
  69.  
  70. clean:
  71.     echo > ,temp.BAK
  72.     rm *.BAK 
  73.  
  74. really_clean: clean
  75.     rm *.tim
  76.     rm s[1-9]-[1-9f].htm s[1-9][1-9]-[1-9f].htm
  77.     rm s[1-9]-[1-9f]r[1-9].htm s[1-9][1-9]-[1-9f]r[1-9].htm
  78.  
  79. print:
  80.     lprpr *.les &
  81.  
  82.  
  83. # Eventually add a "make check" entry, to perform a
  84. # weblint, spellcheck, and a clean-compilation check.
  85.  
  86. # There's an implied order here:
  87. # 1. Edit version files (lversion.htm, lovelace.htm, and version).
  88. # 2. "make ci_all" to check in all local files.
  89. # 3. "make distribute" to create the .zip, .tar.gz, and the WWW version.
  90. # The distribution files do not contain old versions of
  91. # documents (i.e. my RCS and OLD directories are not sent on).
  92.  
  93.  
  94. # Check in every file in the (local) RCS directory.
  95.  
  96. ci_all:
  97.     echo "You should have already edited these files:"
  98.     echo "Files: version, lovelace.htm, lversion.htm"
  99.     echo "Checking in all RCS files."
  100.     ci -l RCS/*
  101.     echo "Version Number is:"
  102.     cat < version
  103.     echo "If all's okay, execute this and make distribute:"
  104.     echo 'rcs -Nversion: RCS/*'
  105.     echo "Where version is Lversion.number (without the period)"
  106.  
  107. # "ci_all" doesn't do the rcs command because it's easy to
  108. # forget to upgrade all the version files.
  109.  
  110.  
  111. distribute: clean
  112.     rm -f stats
  113.     lcount > stats
  114.     chmod ugo+r [a-z]*
  115.     rm -f lovelace.zip lovelace.tar.gz
  116.     zip -9 lovelace.zip [a-z]* -x `cat exclude`
  117.     tar cvfX - exclude [a-z]* > lovelace.tar
  118.     gzip --best lovelace.tar
  119.     rm -f mklesson.tar.gz mklesson.zip
  120.     zip -9 mklesson.zip $(MKLESSON_FILES) -x `cat exclude`
  121.     tar cvf - $(MKLESSON_FILES) > mklesson.tar
  122.     gzip mklesson.tar
  123.     chmod ugo+r *.zip *.gz
  124.     rm -fr CELLO
  125.     mkdir CELLO
  126.     cp -p JUST_CELLO/* CELLO
  127.     cp -p [a-z]* CELLO
  128.     cd CELLO; zip -9 LV-CELLO.zip [a-z]* -x `cat exclude`
  129.     mv CELLO/LV-CELLO.zip .
  130.     rm -fr CELLO
  131.     tar cvf - WWW_install [a-z]* > WWW_LOVELACE.tar
  132.     chmod a+r WWW_LOVELACE.tar
  133.  
  134.