home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / SPIDER / MASTER / WEBMAKEF < prev    next >
Encoding:
Text File  |  1990-01-22  |  4.6 KB  |  146 lines

  1. # Copyright 1989 by Norman Ramsey, Odyssey Research Associates.
  2. # To be used for research purposes only.
  3. # For more information, see file COPYRIGHT in the parent directory.
  4.  
  5. HOME=/u/nr#            # Make no longer inherits environment vars
  6.  
  7. THETANGLE=tangle
  8. THEWEAVE=weave
  9. SPIDER=any.spider
  10. #
  11. DVI=dvi
  12. CFLAGS=-DDEBUG -g -DSTAT
  13.  
  14. # CPUTYPE is a grim hack that attempts to solve the problem of multiple
  15. # cpus sharing a file system.  In my environment I have to have different
  16. # copies of object and executable for vax, sun3, next, iris, and other 
  17. # cpu types.  If you will be using Spidery WEB in a homogenous processor
  18. # environment, you can just set CPUTYPE to a constant, or eliminate it 
  19. # entirely.  
  20. #
  21. # In my environment, the 'cputype' program returns a string that
  22. # describes the current processor.  That means that the easiest thing
  23. # for you to do is to define a 'cputype' program that does something
  24. # sensible.  A shell script that says 'echo "vax"' is fine.
  25.  
  26. CPUTYPE=`cputype`
  27.  
  28. # Change the following three directories to match your installation
  29. #
  30. # the odd placement of # is to prevent any trailing spaces from slipping in
  31.  
  32. WEBROOT=$(HOME)/web/src#     # root of the WEB source distribution
  33. DEST=$(HOME)/bin/$(CPUTYPE)#         # place where the executables go
  34. MACROS=$(HOME)/tex/macros/web#     # place where the macros go
  35.  
  36. MASTER=$(WEBROOT)/master#     # master source directory
  37. OBDIR=$(MASTER)/$(CPUTYPE)#    # common object files
  38.  
  39. TANGLESRC=tangle
  40. CTANGLE=ceetangle -I$(MASTER)
  41. CWEAVE=ceeweave -I$(MASTER)
  42. AWKTANGLE=awktangle -I$(MASTER)
  43. COMMONOBJS=$(OBDIR)/common.o $(OBDIR)/pathopen.o
  44. COMMONC=$(MASTER)/common.c $(MASTER)/pathopen.c
  45. COMMONSRC=$(COMMONC) $(MASTER)/spider.awk
  46.  
  47.  
  48.  
  49. # Our purpose is to make tangle and weave
  50.  
  51. web: tangle weave
  52.  
  53. tangle: $(COMMONOBJS) $(TANGLESRC).o
  54.     $(CC) $(CFLAGS) -o $(DEST)/$(THETANGLE) $(COMMONOBJS) $(TANGLESRC).o
  55.  
  56. weave: $(COMMONOBJS) weave.o
  57.     $(CC) $(CFLAGS) -o $(DEST)/$(THEWEAVE) $(COMMONOBJS) weave.o
  58.  
  59.  
  60. source: $(TANGLESRC).c $(COMMONSRC) # make tangle.c and common src, then clean
  61.     if [ -f WebMakefile ]; then exit 1; fi  # don't clean the master!
  62.     if [ -f spiderman.tex ]; then exit 1; fi # don't clean the manual
  63.     -rm -f tangle.web weave.* common.* # remove links that may be obsolete
  64.     -rm -f *.unsorted *.list grammar.web outtoks.web scraps.web 
  65.     -rm -f cycle.test spider.slog
  66.     -rm -f *.o *.tex *.toc *.dvi *.log *.makelog *~ *.wlog *.printlog
  67.  
  68. # Here is how we make the common stuff
  69.  
  70. $(MASTER)/common.c: $(MASTER)/common.web # no change file
  71.     $(CTANGLE) $(MASTER)/common 
  72.  
  73. $(OBDIR)/common.o: $(MASTER)/common.c $(OBDIR)
  74.     $(CC) $(CFLAGS) -c $(MASTER)/common.c
  75.     mv common.o $(OBDIR)
  76.  
  77.  
  78. $(MASTER)/pathopen.c: $(MASTER)/pathopen.web # no change file
  79.     $(CTANGLE) $(MASTER)/pathopen 
  80.     mv pathopen.h $(MASTER)
  81.  
  82. $(OBDIR)/pathopen.o: $(MASTER)/pathopen.c $(OBDIR)
  83.     $(CC) $(CFLAGS) -c $(MASTER)/pathopen.c
  84.     mv pathopen.o $(OBDIR)
  85.  
  86. $(OBDIR):
  87.     if /bin/test ! -d $(OBDIR) ; then mkdir $(OBDIR) ; fi
  88.  
  89. ## Now we make the tangle and weave source locally
  90.  
  91. $(TANGLESRC).c: $(MASTER)/$(TANGLESRC).web $(MASTER)/common.h grammar.web
  92.     -/bin/rm -f $(TANGLESRC).web
  93.     ln $(MASTER)/$(TANGLESRC).web $(TANGLESRC).web
  94. #    chmod -w $(TANGLESRC).web
  95.     $(CTANGLE) $(TANGLESRC)
  96.  
  97. weave.c: $(MASTER)/weave.web $(MASTER)/common.h grammar.web 
  98.     -/bin/rm -f weave.web
  99.     ln $(MASTER)/weave.web weave.web
  100. #    chmod -w weave.web
  101.     $(CTANGLE) weave 
  102.  
  103. ## Here's where we run SPIDER to create the source
  104.  
  105. grammar.web: $(MASTER)/cycle.awk $(MASTER)/spider.awk $(SPIDER)
  106.     echo "date" `date` | cat - $(SPIDER) | awk -f $(MASTER)/spider.awk
  107.     cat $(MASTER)/transcheck.list trans_keys.unsorted | awk -f $(MASTER)/transcheck.awk
  108.     awk -f $(MASTER)/cycle.awk < cycle.test
  109.     sort *.unsorted | awk -f $(MASTER)/nodups.awk
  110.     mv *web.tex $(MACROS)
  111.  
  112. ## We might have to make spider first.
  113.  
  114. $(MASTER)/spider.awk: $(MASTER)/spider.web
  115.     $(AWKTANGLE) $(MASTER)/spider
  116.     mv cycle.awk nodups.awk transcheck.awk $(MASTER)
  117.     rm junk.list
  118.  
  119.  
  120. # $(MASTER)/cycle.awk: $(MASTER)/cycle.web # making spider also makes cycle
  121. #     $(AWKTANGLE) $(MASTER)/cycle
  122.  
  123.  
  124. # This cleanup applies to every language
  125.  
  126. clean:
  127.     if [ -f WebMakefile ]; then exit 1; fi # don't clean the master!
  128.     if [ -f spiderman.tex ]; then exit 1; fi # don't clean the manual
  129.     -rm -f tangle.* weave.* common.* # remove links that may be obsolete
  130.     -rm -f *.unsorted *.list grammar.web outtoks.web scraps.web 
  131.     -rm -f cycle.test spider.slog
  132.     -rm -f *.c *.o *.tex *.toc *.dvi *.log *.makelog *~ *.wlog *.printlog
  133.  
  134.  
  135.  
  136. # booting the new distribution
  137. boot:
  138.     cd ../master; rm -f *.o; for i in $(COMMONC); do \
  139.         $(CC) $(CFLAGS) -c $$i; \
  140.         mv *.o $(OBDIR) ; \
  141.     done; cd ../c
  142.     $(CC) $(CFLAGS) -c $(TANGLESRC).c; \
  143.     $(CC) $(CFLAGS) -o $(DEST)/$(THETANGLE) $(COMMONOBJS) $(TANGLESRC).o
  144.  
  145.  
  146.