home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / cnews.tar / makefile < prev    next >
Makefile  |  1995-04-27  |  4KB  |  149 lines

  1. # things that just might have to be changed
  2. MAKE=make
  3.  
  4. # Do not mess with the following; configuration is done by other means.
  5. # There are some complex little dances done because this makefile must
  6. # be operational before the syntax of makefile-include is known.  The
  7. # makefile in conf, in particular, is heavily interwoven with this one.
  8. LIBDIRS=libbig libc libcnews libdbz libfake libsmall libstdio
  9. PDIRS=util batch conf ctl expire explode inject input maint \
  10.     nov readnews relay
  11. UIDIRS=inject maint
  12. RDIRS=$(PDIRS)
  13. SLOWRDIRS=libdbz
  14. INALL=conf/inall
  15. ROPT=
  16.  
  17. # System V bug fix
  18. SHELL=/bin/sh
  19.  
  20. all:    needquiz patchchores msub sub mx libcnews.a pgms
  21.     : everything built successfully
  22.  
  23. lib:    libcnews.a
  24.  
  25. libcnews.a:    needquiz msub sub mx conf/liblist
  26.     $(INALL) "$(MAKE)" `cat conf/liblist`
  27.  
  28. freshlib:
  29.     rm -f libcnews.a conf/liblist
  30.     $(MAKE) lib
  31.  
  32. pgms:    needquiz msub sub mx libcnews.a
  33.     $(INALL) "$(MAKE)" $(PDIRS)
  34.     : programs built successfully
  35.  
  36. install:    needquiz
  37.     $(INALL) "$(MAKE) install" $(PDIRS)
  38.     : 'all programs installed!'
  39.     : 'but input/newsspool needs its ownership and permissions changed'
  40.  
  41. setup:        needquiz
  42.     $(INALL) "$(MAKE) setup" $(PDIRS)
  43.     cd conf ; $(MAKE) versetup
  44.  
  45. ui:    needquiz
  46.     $(INALL) "$(MAKE) ui" $(UIDIRS)
  47.     : 'user interface installed'
  48.  
  49. readpostcheck:    needquiz
  50.     $(INALL) "$(MAKE) readpostcheck" readnews
  51.     : 'readnews, postnews, checknews installed'
  52.  
  53. cmp:    needquiz
  54.     $(INALL) "$(MAKE) cmp" $(PDIRS)
  55.     : 'no worrisome differences found'
  56.  
  57. cmpok:
  58.     $(INALL) "$(MAKE) cmp CMPOPT=-i" $(PDIRS)
  59.  
  60. # conf/makeinc and conf/substitutions depend on quiz and conf/useanswers too,
  61. # but including them here would defeat the don't-touch-if-unchanged trick in
  62. # conf/useanswers which avoids spurious re-runs of subst.
  63. include/config.make:    quiz conf/useanswers
  64.     : "you must run (or re-run) quiz first -- see README.install"
  65.     @false
  66.  
  67. needquiz:    include/config.make
  68.  
  69. msub:    conf/msubsts.done
  70.  
  71. conf/msubsts.done:    conf/makefilelist conf/makeinc conf/subst
  72.     sh conf/subst -f conf/makeinc `cat conf/makefilelist`
  73.     touch $@
  74.  
  75. sub:    conf/substs.done
  76.  
  77. conf/substs.done:    conf/subst.all conf/substitutions conf/subst
  78.     sh conf/subst -f conf/substitutions `cat conf/subst.all`
  79.     touch $@
  80.  
  81. mx:    conf/mx.done
  82.  
  83. conf/mx.done:    msub include/config.make
  84.     : A mysterious fatal error here probably means you gave quiz the
  85.     : wrong answer when it asked you how to do an include in a makefile.
  86.     cd conf ; make mx
  87.     touch $@
  88.  
  89. small:
  90.     echo "include libc libcnews $(DBZ) libfake libsmall" >conf/liblist
  91.  
  92. big:
  93.     echo "include libc libcnews $(DBZ) libfake libbig" >conf/liblist
  94.  
  95. stdio:
  96.     cd libstdio ; $(MAKE) r $(ROPT) || ( $(MAKE) clean ; exit 1 )
  97.     : and only if that succeeded...
  98.     cd libstdio ; $(MAKE) rclean
  99.     echo "libstdio" >>conf/liblist
  100.  
  101. ourstdio:
  102.     : "Find out if our stdio speedups will work on your system..."
  103.     -$(MAKE) stdio
  104.     : "If that failed, don't panic -- the makefiles will cope.  It just"
  105.     : "means that the stdio speedups don't work on this system."
  106.     sleep 5
  107.  
  108. sysstdio:
  109.  
  110. conf/liblist:    include/config.make
  111.     cd conf ; $(MAKE) liblist
  112.  
  113. patchchores:
  114.     : if this fails, you have not installed all parts of a multi-part patch
  115.     test " `cat conf/versionname | sed 's/^[^.]*\..//'`" = " " ;
  116.     : delete files obsoleted by patches
  117.     rm -f `cat conf/deadfiles`
  118.  
  119. r:
  120.     $(INALL) "$(MAKE) r $(ROPT) && $(MAKE) rclean" $(RDIRS)
  121.     : leave libdbz to last because its regression test is rather slow
  122.     $(INALL) "$(MAKE) r $(ROPT) && $(MAKE) rclean" $(SLOWRDIRS)
  123.     : 'all tests successful!'
  124.     : 'either you or newsmaster should have mail from the "report" test'
  125.  
  126. tidy:
  127.     : 'if this bombs messily, you probably did a "make spotless" already'
  128.     $(INALL) "$(MAKE) clean" $(LIBDIRS) $(PDIRS)
  129.  
  130. clean:    tidy
  131.     $(INALL) "$(MAKE) clean" include
  132.     rm -f libcnews.a
  133.  
  134. veryclean:    clean
  135.     rm -f conf/*.done conf/liblist 
  136.  
  137. spotless:
  138.     -$(MAKE) veryclean
  139.     rm -f include/config.make conf/makeinc conf/substitutions
  140.  
  141. sterile:    spotless
  142.     rm -f conf/quiz.def
  143.  
  144. # this is strictly for development use
  145. .DEFAULT:
  146.     : if you see this, you are doing something wrong -- the following
  147.     : is strictly for development use
  148.     $(MAKE) -f mfile $@
  149.