home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume16 / deliver / part01 / Makefile < prev    next >
Makefile  |  1988-11-14  |  3KB  |  130 lines

  1. # $Header: Makefile,v 1.7 88/09/14 19:59:53 network Exp $
  2. #
  3. # Makefile for deliver
  4. #
  5. #  +----------------+
  6. #  | Things to make |
  7. #  +----------------+
  8. #
  9. #       deliver         Compile and link the deliver program.
  10. #       install         Install deliver.  (You must be root to do this.)
  11. #       lint            Run lint on all sources, creating lint.out.
  12. #       shar            Create distribution sharchives.
  13. #       clean           Clean up.
  14. #       clobber         Remove everything that can be regenerated.
  15. #
  16. #  +---------------+
  17. #  | Configuration |
  18. #  +---------------+
  19. #
  20. # SHELL
  21. #       I don't have to tell you...
  22. #
  23. # COPY
  24. #       Your local copy program.  SCO Xenix users may want to change this
  25. #       to "copy -m" which preserves file modification time.
  26. #
  27. # SHAR
  28. #       Your local sharchive generator.
  29. #
  30. # CFLAGS
  31. #       Compile-time flags to cc.
  32. #       For BSD systems, include "-DBSD".
  33. #       For USG (System III and System V) systems, include "-DUSG".
  34. #
  35. # LDFLAGS
  36. #       Link-time flags to cc.  The -i flag creates pure (sharable) code.
  37. #
  38. # LIBS
  39. #       Depending on your environment, you may or may not need to link
  40. #       with "-lx".  SCO Xenix System V needs it; Altos Xenix doesn't.
  41. #
  42. # BIN
  43. #       Target directory for installation; /usr/bin is recommended.
  44. #       You may use /usr/local/bin (or whatever), but you must be sure
  45. #       that the directory you choose is in your PATH during mail
  46. #       transmission and delivery.
  47. #
  48. # DELSHAR
  49. #       Basename of sharchives created by "make shar".
  50. #
  51.  
  52. SHELL = /bin/sh
  53. COPY =  cp
  54. SHAR =  shar
  55. CFLAGS = -O
  56. LDFLAGS = -i
  57. LIBS = -lx
  58. BIN =   /usr/bin
  59. DELSHAR =  deliver.sh
  60.  
  61. #
  62. # The files that make up the deliver distribution.
  63. #
  64.  
  65. DOCS =  README deliver.8
  66. MF   =  Makefile
  67.  
  68. HDRS =  config.h context.h deliver.h dest.h patchlevel.h misc.h
  69.  
  70. SRC1 =  context.c copymsg.c debug.c dest.c dfile.c lock.c
  71. SRC2 =  main.c mbox.c procs.c subs.c sysdep.c uucp.c
  72. SRCS =  $(SRC1) $(SRC2)
  73.  
  74. OBJS =  context.o copymsg.o debug.o dest.o dfile.o lock.o \
  75.     main.o mbox.o procs.o subs.o sysdep.o uucp.o
  76.  
  77. all: deliver
  78. deliver: $(OBJS)
  79.     $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  80. $(OBJS): $(HDRS)
  81.  
  82. clean::
  83.     rm -f $(OBJS)
  84.  
  85. #
  86. # This is a klugy way to determine if you are root or not.
  87. # I'm open to suggestions!  (Remember that 'su' counts.)
  88. #
  89.  
  90. install: deliver
  91.     @if [ ! -w /etc ]; \
  92.     then \
  93.         echo ""; \
  94.         echo "Sorry!  You must be root to install deliver."; \
  95.         exit 1; \
  96.     fi
  97.     $(COPY) deliver $(BIN)/deliver
  98.     chgrp root $(BIN)/deliver
  99.     chown root $(BIN)/deliver
  100.     chmod 4711 $(BIN)/deliver
  101.  
  102. clobber::
  103.     rm -f deliver
  104.  
  105. #
  106. # Look for fuzz.
  107. #
  108.  
  109. lint: lint.out
  110. lint.out: $(HDRS) $(SRCS)
  111.     lint $(SRCS) -lc $(LIBS) >lint.out
  112.  
  113. clean::
  114.     rm -f lint.out
  115.  
  116. #
  117. # Make distribution sharchives.
  118. #
  119.  
  120. shar:   $(DELSHAR).01 $(DELSHAR).02 $(DELSHAR).03
  121. $(DELSHAR).01: $(DOCS) $(MF) $(HDRS)
  122.     $(SHAR) >$@ $(DOCS) $(MF) $(HDRS)
  123. $(DELSHAR).02: $(SRC1)
  124.     $(SHAR) >$@ $(SRC1)
  125. $(DELSHAR).03: $(SRC2)
  126.     $(SHAR) >$@ $(SRC2)
  127.  
  128. clobber::
  129.     rm -f $(DELSHAR).??
  130.