home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / trn / part03 / Makefile.SH < prev    next >
Encoding:
Makefile  |  1991-12-02  |  6.7 KB  |  219 lines

  1. case $CONFIG in
  2.     '') . ./config.sh ;;
  3. esac
  4. echo "Extracting Makefile (with variable substitutions)"
  5. $cat >Makefile <<!GROK!THIS!
  6. # $Id: Makefile.SH,v 4.4.2.1 1991/12/01 18:05:42 sob PATCH_2 sob $
  7. #
  8. # This software is Copyright 1991 by Stan Barber. 
  9. #
  10. # Permission is hereby granted to copy, reproduce, redistribute or otherwise
  11. # use this software as long as: there is no monetary profit gained
  12. # specifically from the use or reproduction of this software, it is not
  13. # sold, rented, traded or otherwise marketed, and this copyright notice is
  14. # included prominently in any copy made. 
  15. #
  16. # The author make no claims as to the fitness or correctness of this software
  17. # for any use whatsoever, and it is provided as is. Any use of this software
  18. # is at the user's own risk. 
  19. #
  20. # $Log: Makefile.SH,v $
  21. # Revision 4.4.2.1  1991/12/01  18:05:42  sob
  22. # Changed clientlib to be built in the rn tree instead of the nntp tree.
  23. #
  24. # Revision 4.4.1.1  1991/09/25  19:38:08  sob
  25. # Changed some install directives
  26. #
  27. # Revision 4.4  1991/09/09  20:18:23  sob
  28. # release 4.4
  29. #
  30. #
  31.  
  32. CC = $cc
  33. rnbin = $rnbin
  34. rnlib = $rnlib
  35. mansrc = $mansrc
  36. manext = $manext
  37. #NNTPNNTPDIR = $NNTPSRC
  38. #NNTPNNTPINC = $rrninclude
  39. CFLAGS = $cflags
  40. LDFLAGS = $posix$iandd
  41. NDIRC = $ndirc
  42. NDIRO = $ndiro
  43.  
  44. libs = $ndirlib $termlib $jobslib $xnxlib $socketlib -lm $sharedclib
  45. mlibs = $ndirlib $jobslib $xnxlib $socketlib $sharedclib
  46. !GROK!THIS!
  47. $cat >>Makefile <<'!NO!SUBS!'
  48. #NNTPnntp=getactive
  49. #MTmthreading=mthreads mt.check
  50. public = trn tmpthread newsetup newsgroups Pnews Rnmail
  51. private = norm.saver mbox.saver makedir\
  52.     filexp Pnews.header $(mthreading) $(nntp)
  53. manpages = trn.1 Pnews.1 Rnmail.1 newsetup.1 newsgroups.1
  54. util = Makefile makedepend newsnews
  55.  
  56.  
  57. h1 = addng.h art.h artio.h artsrch.h autosub.h backpage.h bits.h cheat.h 
  58. h2 = common.h decode.h final.h head.h help.h init.h intrp.h kfile.h last.h
  59. h3 = ng.h ngdata.h ngsrch.h ngstuff.h only.h rcln.h rcstuff.h
  60. h4 = respond.h rn.h search.h sw.h term.h util.h
  61.  
  62. h = $(h1) $(h2) $(h3) $(h4)
  63.  
  64. c1 = addng.c art.c artio.c artsrch.c autosub.c backpage.c bits.c cheat.c
  65. c2 = decode.c final.c head.c help.c init.c intrp.c kfile.c last.c $(NDIRC)
  66. c3 = ng.c ngdata.c ngsrch.c ngstuff.c only.c rcln.c rcstuff.c respond.c rn.c
  67. c4 = rthreads.c rt-rn.c rt-select.c search.c sw.c term.c threads.c util.c
  68. c5 = unship.c uudecode.c
  69. #NNTPc6 = server.c $(NNTPDIR)/common/clientlib.c
  70.  
  71. c = $(c1) $(c2) $(c3) $(c4) $(c5) $(c6)
  72.  
  73. mtc1 = mthreads.c mt-read.c mt-process.c mt-write.c mt-misc.c threads.c $(NDIRC)
  74. #NNMTmtc2 = $(c6)
  75. mtc = $(mtc1) $(mtc2)
  76.  
  77. tmc = tmpthread.c tm-read.c tm-process.c tm-write.c mt-misc.c threads.c $(mtc2)
  78.  
  79. obj1 = addng.o art.o artio.o artsrch.o autosub.o backpage.o bits.o cheat.o
  80. obj2 = decode.o final.o head.o help.o init.o intrp.o kfile.o last.o $(NDIRO)
  81. obj3 = ng.o ngdata.o ngsrch.o ngstuff.o only.o rcln.o rcstuff.o respond.o rn.o
  82. obj4 = rthreads.o rt-rn.o rt-select.o search.o sw.o term.o threads.o util.o
  83. obj5 = unship.o uudecode.o
  84. #NNTPobj6 = server.o clientlib.o
  85.  
  86. obj = $(obj1) $(obj2) $(obj3) $(obj4) $(obj5) $(obj6)
  87.  
  88. mto1 = mthreads.o mt-read.o mt-process.o mt-write.o mt-misc.o
  89. mto2 = threads.o getdate.o $(NDIRO)
  90. #NNMTmto3 = $(obj6)
  91. mtobj = $(mto1) $(mto2) $(mto3)
  92.  
  93. tmo1 = tmpthread.o tm-read.o tm-process.o tm-write.o mt-misc.o
  94. tmo2 = threads.o getdate.o
  95. tmobj = $(tmo1) $(tmo2) $(obj6)
  96.  
  97. lintflags = -phbvxac
  98.  
  99. add1 = Makefile.old Pnews Rnmail mt.check
  100. add2 = bsd config.h config.sh eunice filexp 
  101. add3 = loc makedepend makedir mbox.saver ndir.h newsetup
  102. add4 = newsgroups newsnews norm.saver
  103. add5 = pdp11 usg v7 ultrix sun hp-ux sgi xenix next server.h mips uts
  104. add6 = all pyr grimble .falseactive Pnews.header s5uniq sigtest stardent
  105.  
  106. addedbyconf = $(add1) $(add2) $(add3) $(add4) $(add5) $(add6)
  107.  
  108. # grrr
  109. SHELL = /bin/sh
  110.  
  111.  
  112. .c.o:
  113.     $(CC) -c $(CFLAGS) $*.c
  114.  
  115. all: $(public) $(private) $(util)
  116.     touch all
  117.  
  118. trn: $(obj)
  119.     $(CC) $(LDFLAGS) $(obj) $(libs) -o trn
  120.  
  121. mthreads: $(mtobj)
  122.     $(CC) $(LDFLAGS) $(mtobj) $(mlibs) -o mthreads
  123.  
  124. tmpthread: $(tmobj)
  125.     $(CC) $(LDFLAGS) $(tmobj) $(mlibs) -o tmpthread
  126.  
  127. mtgroups: mtgroups.o mt-misc.o
  128.     $(CC) $(LDFLAGS) mtgroups.o mt-misc.o -lcurses $(libs) -o mtgroups
  129.  
  130. #NNTPgetactive: getactive.o server.o clientlib.o
  131. #NNTP    $(CC) $(LDFLAGS) getactive.o server.o clientlib.o -o getactive $(libs)
  132.  
  133. #NNTPclientlib.o:
  134. #NNTP    $(CC) -c $(CFLAGS) $(NNTPINC) $(NNTPDIR)/common/clientlib.c
  135.  
  136. # if a .h file depends on another .h file...
  137. $(h):
  138.     touch $@
  139.  
  140. install: $(public) $(private) $(manpages)
  141. # won't work with csh
  142.     export PATH || exit 1
  143.     - mv $(rnbin)/trn $(rnbin)/trn.old
  144. #NNTP    - ln -s trn $(rnbin)/trrn
  145.     - if test `pwd` != $(rnbin); then cp $(public) $(rnbin); fi
  146.     - if test `pwd` != $(rnbin); then cd $(rnbin); chmod 755 $(public); strip trn tmpthread ; fi
  147.     - ./makedir `./filexp $(rnlib)`
  148. #MT    - cd `./filexp $(rnlib)`; mv mthreads mthreads.old
  149.     - if test `pwd` != `./filexp $(rnlib)`; then cp INIT $(private) `./filexp $(rnlib)`; fi
  150. #NNTP    - if test `pwd` != `./filexp $(rnlib)`; then strip `./filexp $(rnlib)`/getactive ; fi
  151.     - if test ! -f `./filexp $(rnlib)/newsnews`; then cp newsnews `./filexp $(rnlib)`; fi
  152.     cd `./filexp $(rnlib)`; chmod 755 $(private); chmod 644 INIT newsnews
  153. #MT    - if test `pwd` != `./filexp $(rnlib)`; then strip `./filexp $(rnlib)`/mthreads ; fi
  154.     - if test `pwd` != $(mansrc); then \
  155. for page in $(manpages); do \
  156. cp $$page $(mansrc)/`basename $$page .1`.$(manext); \
  157. done; \
  158. #NNTPecho ".so man$(manext)/trn.$(manext)" > $(mansrc)/trrn.$(manext) ; \
  159. fi
  160.  
  161. clean:
  162.     rm -f *.o
  163.  
  164. realclean:
  165.     rm -f trn mthreads tmpthread *.o core $(addedbyconf) 
  166. #NNTP    rm -f clientlib.o getactive
  167.  
  168. # The following lint has practically everything turned on.  Unfortunately,
  169. # you have to wade through a lot of mumbo jumbo that can't be suppressed.
  170. # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
  171. # for that spot.
  172.  
  173. lint: lint_trn lint_mt lint_tm
  174.  
  175. lint_trn:
  176.     lint $(lintflags) $(defs) $(c) > trn.fuzz
  177.  
  178. lint_mt:
  179.     lint $(lintflags) $(mtc) > mt.fuzz
  180.  
  181. lint_tm:
  182.     lint $(lintflags) $(tmc) > tt.fuzz
  183.  
  184. sabertrn: $(c)
  185.     #load $(c) $(libs)
  186.  
  187. depend: config.h Makefile
  188.     ./makedepend
  189.  
  190. # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
  191. config.h: config.h.SH config.sh ; sh config.h.SH
  192. Makefile: Makefile.SH config.sh ; sh Makefile.SH
  193. $(obj):
  194.     @ echo "You haven't done a "'"make depend" yet!'; exit 1
  195. !NO!SUBS!
  196. case "$isrrn" in
  197. define) if $test "$serverspool " != " " ; then
  198.         sed < Makefile -e '/^#NNTP/s/^#NNTP//
  199.                    /^#MT/s/^#MT//
  200.                    /^#NNMT/d' > Makefile.new
  201.     else if $test "$xthread " != "define " ; then
  202.         sed < Makefile -e '/^#NNTP/s/^#NNTP//
  203.                    /^#MT/s/^#MT//
  204.                    /^#NNMT/s/^#NNMT//' > Makefile.new
  205.     else
  206.         sed < Makefile -e '/^#NNTP/s/^#NNTP//
  207.                    /^#MT/d
  208.                    /^#NNMT/s/^#NNMT//' > Makefile.new
  209.     fi ; fi
  210.     ;;
  211. *)    sed < Makefile -e '/^#NNTP/d
  212.                /^#MT/s/^#MT//
  213.                /^#NNMT/d' > Makefile.new
  214.     ;;
  215. esac
  216. mv Makefile.new Makefile
  217. $eunicefix Makefile
  218.