home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume27 / mthreads / part01 / Makefile.SH < prev    next >
Encoding:
Makefile  |  1993-11-20  |  2.4 KB  |  98 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 3.0 1992/03/01 02:13:32 davison Trn $
  7.  
  8. CC = $cc
  9. mtlib = $installprivlib
  10. mansrc = $installmansrc
  11. manext = $manext
  12. CFLAGS = $optimize $ccflags
  13. LDFLAGS = $ldflags
  14. #NNTPNNTPFLAGS = $nntpflags
  15. ndirc = $ndirc
  16. ndiro = $ndiro
  17.  
  18. libs = $libndir $jobslib -lm $libs
  19. !GROK!THIS!
  20. $cat >>Makefile <<'!NO!SUBS!'
  21.  
  22. public = mthreads mt.check
  23. private = makedir filexp
  24. manpages = mthreads.8
  25. util = Makefile makedepend
  26. #NNTPnntpsrc=nntpinit.c nntpclient.c
  27. #NNTPnntpobj=nntpinit.o nntpclient.o
  28.  
  29. h = common.h mthreads.h threads.h
  30.  
  31. c = mthreads.c mt-read.c mt-process.c mt-write.c mt-misc.c $(ndirc) $(nntpsrc)
  32.  
  33. obj = mthreads.o mt-read.o mt-process.o mt-write.o mt-misc.o parsedate.o \
  34.     $(ndiro) $(nntpobj)
  35.  
  36. addedbymake = Makefile.old mt.check config.h makedepend makedir mthreads all
  37.  
  38. # grrr
  39. SHELL = /bin/sh
  40.  
  41. .c.o:
  42.     $(CC) -c $(CFLAGS) $*.c
  43.  
  44. all: $(public) $(private) $(util)
  45.     touch all
  46.  
  47. mthreads: $(obj)
  48.     $(CC) $(LDFLAGS) $(obj) $(libs) -o mthreads
  49. #NNTP
  50. #NNTPnntpinit.o:
  51. #NNTP    $(CC) -c $(CFLAGS) $(NNTPFLAGS) $*.c
  52.  
  53. unipatch: unipatch.o
  54.     $(CC) $(LDFLAGS) unipatch.o -o unipatch
  55.  
  56. # if a .h file depends on another .h file...
  57. $(h):
  58.     -touch $@
  59.  
  60. install: $(public) $(private) $(manpages)
  61. # won't work with csh
  62.     export PATH || exit 1
  63.     - ./makedir `./filexp $(mtlib)`
  64.     - cd `./filexp $(mtlib)`; mv mthreads mthreads.old
  65.     - if test `pwd` != `./filexp $(mtlib)`; then cp $(public) `./filexp $(mtlib)`; fi
  66.     - if test `pwd` != `./filexp $(mtlib)`; then cp $(private) `./filexp $(mtlib)`; fi
  67.     - if test `pwd` != `./filexp $(mtlib)`; then strip `./filexp $(mtlib)`/mthreads ; fi
  68.     - if test "X$(mansrc)" != "X" -a "X`pwd`" != X$(mansrc); then \
  69. for page in $(manpages); do \
  70. dest=$(mansrc)/`basename $$page .8`.$(manext); \
  71. rm -f $$dest; cp $$page $$dest; chmod 444 $$dest; \
  72. done; \
  73. fi
  74.  
  75. clean:
  76.     @ echo 'Use "make realclean" to remove the executables and Configure droppings.'
  77.     @ echo 'Use "make spotless" to also remove config.sh'
  78.     rm -f *.o
  79.  
  80. realclean: clean
  81.     rm -f core $(addedbymake)
  82.  
  83. spotless: realclean
  84.     rm -f config.sh
  85.  
  86. depend: config.h Makefile
  87.     ./makedepend
  88.  
  89. # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
  90. !NO!SUBS!
  91. $cat dependencies >>Makefile
  92. case "$d_nntp" in
  93. define)    sed < Makefile -e '/^#NNTP/s/^#NNTP//' > Makefile.new ;;
  94. *)    sed < Makefile -e '/^#NNTP/d' > Makefile.new ;;
  95. esac
  96. mv Makefile.new Makefile
  97. $eunicefix Makefile
  98.