home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / support / makefile < prev    next >
Makefile  |  1994-05-14  |  3KB  |  92 lines

  1. # This Makefile helps build and manage the BBS support utilities
  2. # and other files.
  3.  
  4. # VOLNAME =    `pwd | sed -e 's%^/%%' -e 's%/.*%%'`
  5. VOLNAME =    FreshFish-May94
  6.  
  7. CC =        gcc
  8. CFLAGS =    -O -DSEPARATE_GNU
  9.  
  10. SOURCEFILES =    symlinks.c strcasecmp.c
  11. DISTFILES =    $(SOURCEFILES) Makefile
  12.  
  13. # The default thing to make.
  14.  
  15. all :        symlinks PV.list Archives view1.lha
  16.  
  17. # This target builds "Archives", which is an accumulated summary of all
  18. # of the archives on this CD under the BBS directory, for which a product
  19. # info file is supplied.  I.E. it is the list of things which are suitable
  20. # for making available for BBS or FTP access transfer as a single file unit.
  21. # This isn't used for anything else by this makefile, it is just for the
  22. # user's consumption.
  23.  
  24. Archives :
  25.         pitool -b -f - /$(VOLNAME)/BBS | sort >Archives
  26.  
  27. # This target builds "PV.list", which is a file containing one line for
  28. # every archive on this CD under the BBS directory, where each line
  29. # consists of the full pathname to the archive, followed by the version
  30. # number of that material (if known).  It can be fed to "symlinks" to build
  31. # symbolic links to each archive and associated product info file on the CD.
  32.  
  33. PV.list :
  34.         pitool -b -F "%P %V\n" -f - /$(VOLNAME)/BBS | sort >PV.list
  35.  
  36. # Build the tool that can be used to make symbolic links, or to build
  37. # a script that can be run later to make symbolic links.
  38.  
  39. symlinks :    symlinks.o strcasecmp.o
  40.         $(CC) -o symlinks symlinks.o
  41.  
  42. symlinks.o :    symlinks.c
  43.         $(CC) -c $(CFLAGS) symlinks.c
  44.  
  45. strcasecmp.o :    strcasecmp.c
  46.         $(CC) -c $(CFLAGS) strcasecmp.c
  47.  
  48. # Build the lha archive for "view 1".
  49.  
  50. VIEW1_FILES =    view1.script pitool symlinks PV.list view1desc.lha \
  51.         view1.links
  52.  
  53. view1.lha :    $(VIEW1_FILES)
  54.         rm -f view1.lha
  55.         lha -mraxeq a view1.lha $(VIEW1_FILES)
  56.  
  57. view1.links :    PV.list symlinks
  58.         symlinks -V1 -s <PV.list >view1.links
  59.  
  60. # Build the archive of description files.  This can take an hour or more,
  61. # and is hard to abort once started.  It is intended to be manually run
  62. # in a scratch area with "make bbsfiles".
  63.  
  64. bbsfiles :    PV.list symlinks pitool links links/bbsfiles
  65.         (cd links ; rm -f view1desc.lha)
  66.         (cd links ; lha -mraxeq -ibbsfiles a view1desc.lha)
  67.         mv links/view1desc.lha view1desc.lha
  68.  
  69. links :
  70.         rm -rf links
  71.         mkdir links
  72.         (cd links ; ../symlinks -V1 <../PV.list)
  73.  
  74. links/bbsfiles :
  75.         (cd links ; rm -f */files.bbs)
  76.         (cd links ; ../pitool -b .)
  77.         (cd links ; find . -name files.bbs -print >/tmp/bbsfiles)
  78.         (cd links ; sed "s:^./::" </tmp/bbsfiles >bbsfiles)
  79.         (cd links ; for bbsfile in `cat bbsfiles` ; do \
  80.                 sort <$$bbsfile >/tmp/junkfile ; \
  81.                 cp /tmp/junkfile $$bbsfile ; \
  82.                 done)
  83.  
  84. # Standard stuff that every Makefile should have.
  85.  
  86. clean :
  87.         rm -f *.o *! *~
  88.         rm -rf links
  89.  
  90. clobber :    clean
  91.         rm -f symlinks Archives view1.links PV.list view1.lha
  92.