home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / www / src / WWW / LineMode / Implementation / CommonMakefile next >
Encoding:
Makefile  |  1993-05-10  |  7.7 KB  |  272 lines

  1. #    Makefile for WorldWideWeb    Line Mode browser (www)
  2. #
  3. #    (c) CERN 1990, 1991 -- see Copyright.html for conditions
  4. #
  5. # This file should be invariant between systems.
  6. #    DEPENDENCIES NOT COMPLETE @@
  7. #
  8. #    make        Compile and link the software (private version)
  9. #    make install    Copy it into the system (implies make)
  10. #    make update    Copy installed version into installed version
  11. #    make uninstall    Unlink installed version from the system
  12. #    make clean    Remove intermediate files
  13. #    make cleanall    Remove intremediate files and products
  14. #    
  15. # Macros required to be defined already for make:
  16. #
  17. # CC        The C compiler
  18. # CFLAGS    Flags for $(CC)
  19. # LFLAGS    Flags for ld
  20. # WWW        Root of WWW source tree
  21. # USELIBDIR    Directory in which libwww.a should be found
  22. #
  23. # Macros needed for make install:
  24. #
  25. # BINDIR    Directory for installed binary
  26. #______________________________________________________________________
  27.  
  28. #  If this env var is set to something else Some makes will use that instead
  29. SHELL = /bin/sh
  30.  
  31. # If this is actually run in a subdirectory.
  32. #
  33. # WWW = ../../..
  34.  
  35. # If it is run in this directory:
  36. #
  37. # WWW = ../..    For [cernlib] build in this directory
  38.  
  39. LM =  $(WWW)/LineMode/Implementation/
  40. LMD = $(WWW)/LineMode/Defaults
  41. CMN = $(WWW)/Library/Implementation/
  42. DEFAULTS = $(WWW)/LineMode/Defaults
  43.  
  44. CFLAGS2 = $(CFLAGS) -I$(CMN) -I$(LM)
  45.  
  46. CERNLIBBIN = $(WWW)/bin
  47.  
  48. #    WTMP is either WWW or /tmp for example. It allows the 
  49. # machine-dependent files to be put in a separate tree so that
  50. #    - The source tree can be read-only
  51. #    - The source tree can be shared across platforms
  52. #
  53. USELIBDIR = $(WTMP)/Library/$(WWW_MACH)
  54. OBJ = $(WTMP)/LineMode/$(WWW_MACH)
  55. BIN = $(WWW)/LineMode/$(WWW_MACH)
  56.  
  57. OE = $(OBJ)/.created
  58.  
  59. WWWLIB = -L$(USELIBDIR) -lwww
  60. OBJS = $(OBJ)/HTBrowse.o $(OBJ)/GridText.o $(OBJ)/DefaultStyles.o
  61. # Final main product
  62. PROD = www
  63.  
  64. SOURCES = $(LM)HTBrowse.c    $(LM)HTBrowse.h \
  65.     $(LM)GridText.c        $(LM)GridText.h \
  66.     $(LM)HTFont.h         $(LM)Version.make\
  67.     $(LM)DefaultStyles.c    $(LM)CommonMakefile
  68.  
  69. SPECIFIC =  \
  70.     $(LM)apollo_m68k/Makefile \
  71.     $(LM)decstation/Makefile \
  72.     $(LM)next/Makefile \
  73.     $(LM)pc-nfs/makefile \
  74.     $(LM)pc-nfs/README \
  75.     $(LM)pc-nfs/topc \
  76.     $(LM)rs6000/Makefile \
  77.     $(LM)sgi/Makefile \
  78.     $(LM)snake/Makefile \
  79.     $(LM)sun3/Makefile \
  80.     $(LM)sun4/Makefile \
  81.     $(LM)unix/Makefile \
  82.     $(LM)vax_ultrix/Makefile \
  83.     $(LM)vax_ultrix_cc/Makefile \
  84.     $(LM)vms/descrip.mms \
  85.     $(LM)vms/setup.com
  86.  
  87. # Bug: This path, if relative, is taken relative to the directory
  88. # in which this makefile is, not the pwd.  This screws up the 
  89. # recursive invocation
  90. include $(ABS)$(LM)Version.make
  91.  
  92. $(BIN)/$(PROD) : $(OBJS) $(USELIBDIR)/libwww.a
  93.     $(CC) -o $(BIN)/$(PROD)_$(VL)  $(OBJS) $(WWWLIB) $(WAISLIB) $(LFLAGS)
  94.     -rm $(BIN)/$(PROD)
  95.     ln -s $(PROD)_$(VL) $(BIN)/$(PROD)
  96.  
  97. $(USELIBDIR)/libwww.a :
  98.     @echo You must get and make the WWWLibrary product first!
  99.     (cd $(WWW)/Library/$(WWW_MACH) && make)
  100.  
  101. lib :
  102.     (cd $(WWW)/Library/$(WWW_MACH) && make)
  103.  
  104.  
  105. #    Make a copy of the binary and documentation on this machine
  106. install :    $(PROD)
  107.     cp $(PROD) $(BINDIR)/$(PROD)
  108.     - mkdir /usr/local
  109.     - mkdir /usr/local/lib
  110.     - mkdir /usr/local/lib/WWW
  111.     cp $(DEFAULTS)/*.html /usr/local/lib/WWW
  112.  
  113. #    Link system to the binary and documentation in this tree
  114.  
  115. link : Works/$(PROD)
  116.     ln -s `pwd`/$(PROD) $(BINDIR)/$(PROD)
  117.     - mkdir /usr/local
  118.     - mkdir /usr/local/lib
  119.     ln -s $(DEFAULTS) /usr/local/lib/WWW
  120.  
  121. uninstall :
  122.     rm $(BINDIR)/$(PROD)
  123.     rm -r /usr/local/lib/WWW
  124.  
  125. #    Clean up everything generatable except final products
  126. #    Including obj directory UNLESS there is anything else in it
  127. clean :
  128.     rm $(OBJ)/.created $(OBJ)/*.o
  129.     -rmdir $(OBJ)
  130.  
  131. #    Clean up everything generatable including final products
  132.  
  133. cleanall : clean
  134.     rm $(PROD)
  135.  
  136. #    Binary release
  137. #
  138. #    Must be done on anonymous FTP server!
  139. #
  140. #  This makefile does not knw how to make $(PROD)_$(VL) so that trying
  141. #  to make binay or asis on a weird machine doesn't try to build $(PROD)!
  142.  
  143. binary : $(PROD)_$(VL)
  144.     -mkdir /pub/www/bin/$(WWW_MACH)
  145.     cp $(PROD)_$(VL) /pub/www/bin/$(WWW_MACH)/$(PROD)_$(VL)
  146.  
  147. #    ASIS installation
  148. #    -----------------
  149. #    Can only happen on an allocated ASIS development machine and
  150. #    with uid of the controlling user for the project.
  151. #
  152. asis : /asis/share/usr.local/lib/WWW/default.html \
  153.     /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD)
  154.     touch asis
  155.     echo ASIS distribution is now up-to-date.
  156.  
  157. /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD) : $(PROD)_$(VL)
  158.     cp $(PROD)_$(VL) /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD)_$(VL)
  159.     rm -f /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD)
  160.     ln -s $(PROD)_$(VL) \
  161.         /asis/specific/$(ASIS_MACH)/usr.local/bin/$(PROD)
  162.  
  163. /asis/share/usr.local/lib/WWW/default.html : $(DEFAULTS)/cern.html
  164.     - mkdir /asis/share/usr.local/lib/WWW
  165.     cp $(DEFAULTS)/*.html /asis/share/usr.local/lib/WWW
  166.     cp $(DEFAULTS)/cern.html /asis/share/usr.local/lib/WWW/default.html
  167.     cp $(DEFAULTS)/default.html /asis/share/usr.local/lib/WWW/top.html
  168.  
  169. #    CERNLIB installation
  170. #    --------------------
  171. #    Assuming the cernlib-style directory structure
  172. #    Warning: Not suitable for machine-shared file structure.
  173. #
  174. cernlib :    $(PROD)
  175.     - mkdir $(CERNLIBBIN)
  176.     cp $(PROD) $(CERNLIBBIN)
  177.  
  178.  
  179. #_________________________________________________________________________    
  180. # Compiling the Objects (Dependenies incomplete)
  181.  
  182. #    Check directory exists
  183. $(OE) :
  184.     -mkdir $(WTMP)
  185.     -mkdir $(WTMP)/LineMode
  186.     -mkdir $(WTMP)/LineMode/$(WWW_MACH)
  187.     touch $(OE)
  188.  
  189. #
  190. $(OBJ)/HTBrowse.o : $(OE) $(LM)HTBrowse.c $(LM)GridText.h $(LM)Version.make \
  191.         $(CMN)HTUtils.h $(CMN)HTAccess.h
  192.     $(CC) -c -o $@ $(CFLAGS2) -DVL=\"$(VL)\" $(LM)HTBrowse.c  
  193.  
  194. $(OBJ)/GridText.o : $(OE) $(LM)GridText.c $(LM)GridText.h\
  195.      $(CMN)HTAnchor.h $(CMN)HTStyle.h
  196.     $(CC) -c -o $@ $(CFLAGS2) $(LM)GridText.c
  197.  
  198. $(OBJ)/DefaultStyles.o : $(OE) $(LM)DefaultStyles.c $(CMN)HTStyle.h
  199.     $(CC) -c -o $@ $(CFLAGS2) $(LM)DefaultStyles.c  
  200.  
  201. #_________________________________________________________________
  202. # For W3 Administrative use only:
  203.  
  204.  
  205. #        W3 Source + documentation release
  206. #        ---------------------------------
  207.  
  208. distribute :  /pub/www/README.txt /pub/www/Copyright.txt
  209.     (cd $(WWW)/.. && WWW=WWW ABS=`pwd`/ make $(MFLAGS) \
  210.         -f WWW/LineMode/Implementation/CommonMakefile \
  211.         /pub/www/src/WWWLineMode_$(VL).tar.Z)
  212.     echo Distribution of Line Mode version $(VC) up to date.
  213.  
  214. # THIS MUST BE BUILT FROM THE DIRECTORY ABOVE WWW ! USE distribute above!
  215. /pub/www/src/WWWLineMode_$(VL).tar.Z : $(SOURCES) $(LMD)/line-mode-guide.txt
  216.     tar cf /pub/www/src/WWWLineMode_$(VL).tar \
  217.         $(SOURCES)  $(LMD)/line-mode-guide.txt \
  218.         $(WWW)/LineMode/*/Makefile $(LM)vms/descrip.mms
  219.     compress /pub/www/src/WWWLineMode_$(VL).tar
  220.  
  221.  
  222. #        Hypertext supplied in text format
  223. #        ---------------------------------
  224.  
  225. $(WWW)/README.txt : $(WWW)/../README.html
  226.     www -n -p66 http://info.cern.ch/hypertext/README.html \
  227.         > $(WWW)/README.txt
  228. /pub/www/README.txt : $(WWW)/README.txt
  229.     cp $(WWW)/README.txt /pub/www/README.txt
  230.  
  231. $(WWW)/Copyright.txt : $(WWW)/../Copyright.html
  232.     www -n -p66 http://info.cern.ch/hypertext/Copyright.html \
  233.         > $(WWW)/Copyright.txt
  234. /pub/www/Copyright.txt : $(WWW)/Copyright.txt
  235.     cp $? $@
  236.  
  237. #    Line Mode Manual
  238. #
  239. QUICKGUIDE = \
  240.     $(LMD)/QuickGuide.html \
  241.     $(LMD)/Commands.html \
  242.         $(LMD)/SourceExamples.html \
  243.     $(LMD)/CommandLine.html \
  244.     $(LMD)/Shortcuts.html \
  245.         $(LMD)/VMS_Shortcuts.html \
  246.     $(LMD)/Installation.html \
  247.         $(LMD)/Installation_VMS.html \
  248.         $(LMD)/Installation_VMS_NewTCP.html \
  249.         $(LMD)/Distribution.html \
  250.         $(LMD)/Porting.html \
  251.         $(LMD)/MachineTypes.html \
  252.         $(LMD)/InstallNotSU.html \
  253.         $(LMD)/Path.html \
  254.         $(LMD)/LoginScript.html \
  255.     $(LMD)/Customisation.html \
  256.         $(LMD)/EnvVariables.html \
  257.         $(LMD)/GlobalV.html \
  258.         $(LMD)/NewsServer.html \
  259.     $(LMD)/Bugs.html \
  260.     $(LMD)/Features.html
  261.  
  262. doc : /pub/www/doc/line-mode-guide.txt
  263.     echo line mode browser guide exists.
  264.  
  265. /pub/www/doc/line-mode-guide.txt : $(LMD)/line-mode-guide.txt
  266.     cp $? $@
  267.  
  268. $(LMD)/line-mode-guide.txt : $(QUICKGUIDE)
  269.     -rm $@
  270.     for i in $(QUICKGUIDE) ; do www -n -na -p66 $$i >> $@; done
  271.  
  272.