home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume19 / rkive / part02 / Makefile < prev    next >
Makefile  |  1989-06-29  |  6KB  |  259 lines

  1. ##########################################################
  2. #
  3. #    @(#)Makefile    1.1 6/1/89 - USENET Source Archiver
  4. #
  5. #
  6. # This software is Copyright (c) 1989 by Kent Landfield.
  7. #
  8. # Permission is hereby granted to copy, distribute or otherwise 
  9. # use any part of this package as long as you do not try to make 
  10. # money from it or pretend that you wrote it.  This copyright 
  11. # notice must be maintained in any copy made.
  12. #
  13. # Use of this software constitutes acceptance for use in an AS IS 
  14. # condition. There are NO warranties with regard to this software.  
  15. # In no event shall the author be liable for any damages whatsoever 
  16. # arising out of or in connection with the use or performance of this 
  17. # software.  Any use of this software is at the user's own risk.
  18. #
  19. #  If you make modifications to this software that you feel 
  20. #  increases it usefulness for the rest of the community, please 
  21. #  email the changes, enhancements, bug fixes as well as any and 
  22. #  all ideas to me. This software is going to be maintained and 
  23. #  enhanced as deemed necessary by the community.
  24. #        
  25. #        Kent Landfield
  26. #        uunet!ssbell!kent
  27. #
  28. #  History:
  29. #    Creation: Tue Feb 21 08:52:35 CST 1989 due to necessity.
  30. #                                                               
  31. ##########################################################
  32. #
  33. # Which mkdir function do you want to use ?
  34. #
  35. # Define HAVE_MKDIR if there is a mkdir() function in your 
  36. # system library (AT&T 5.2 or earlier systems are probably
  37. # out of luck..)
  38. #
  39. # Define USE_SYSMKDIR if you wish to system off /bin/mkdir.
  40. # (not recommended for *real* use...)
  41. #
  42. # If you do not define either, the function makedir will
  43. # create the directory itself. 
  44. #
  45. #CFLAGS=-O -DUSE_SYSMKDIR
  46. #CFLAGS=-O -DHAVE_MKDIR
  47. CFLAGS= -O 
  48. #
  49. # Define your favorite C compiler here...
  50. #
  51. CC=gcc
  52.  
  53. #
  54. # Define flags to be passed to lint.
  55. #
  56. LINTFLAGS=
  57.  
  58. #
  59. # rkive needs to have POSIX Compatible directory access routines.
  60. # If you have it builtin to your system libraries then
  61. # comment out the following. If you use Doug Gwyn's routines, (or 
  62. # other compatible routines) define the library in which they appear.
  63. #
  64. LDFLAGS=-lndir
  65.  
  66. I = /usr/include
  67. LP = /usr/lbin/clist
  68. NROFF = /usr/bin/nroff
  69. BINDIR=/usr/lbin
  70.  
  71. DOCS = article.1 rkive.1 ckconfig.1 rkive.5
  72. SUPPORT = rkive.cf Makefile README IDEAS MANIFEST
  73. INCLUDES = rkive.h article.h cfg.h patchlevel.h
  74.  
  75. ARTICLE_SRCS =  article.c efopen.c format.c header.c str.c version.c
  76. ARTICLE_OBJS =  article.o efopen.o format.o header.o str.o version.o
  77.  
  78. CKCONFIG_SRCS = ckconfig.c disp_grp.c efopen.c setup.c str.c version.c
  79. CKCONFIG_OBJS = ckconfig.o disp_grp.o efopen.o setup.o str.o version.o
  80.  
  81. ARCHIVE_SRCS =  disp_grp.c efopen.c format.c header.c \
  82.         makedir.c news_arc.c record_arc.c rename.c \
  83.         rkive.c setup.c str.c version.c
  84. ARCHIVE_OBJS =  disp_grp.o efopen.o format.o header.o \
  85.         makedir.o news_arc.o record_arc.o rename.o \
  86.         rkive.o setup.o str.o version.o
  87.  
  88. SRCS = article.c ckconfig.c disp_grp.c efopen.c format.c \
  89.     header.c news_arc.c rkive.c rename.c record_arc.c \
  90.     makedir.c setup.c str.c version.c
  91.  
  92. PROGS = article ckconfig rkive
  93.  
  94. all: $(PROGS)
  95.  
  96. install: $(PROGS)
  97.     strip $(PROGS)
  98.     cp $(PROGS) $(BINDIR)
  99.  
  100. ckconfig: $(CKCONFIG_OBJS)
  101.     $(CC) $(CFLAGS) -o ckconfig $(CKCONFIG_OBJS)
  102.  
  103. article: $(ARTICLE_OBJS)
  104.     $(CC) $(CFLAGS) -o article $(ARTICLE_OBJS)
  105.  
  106. rkive: $(ARCHIVE_OBJS)
  107.     $(CC) $(CFLAGS) -o rkive $(ARCHIVE_OBJS) $(LDFLAGS)
  108.  
  109. man:
  110.     $(NROFF) -man $(DOCS)
  111.  
  112. ################################
  113. #        Dependencies
  114. ################################
  115.  
  116. rkive.o: $(I)/sys/types.h
  117. rkive.o: $(I)/sys/stat.h
  118. rkive.o: $(I)/dirent.h
  119. rkive.o: $(I)/stdio.h
  120. rkive.o: article.h
  121. rkive.o: cfg.h
  122. rkive.o: rkive.h
  123.  
  124. article.o: $(I)/stdio.h
  125. article.o: $(I)/ctype.h
  126. article.o: $(I)/sys/types.h
  127. article.o: article.h
  128.  
  129. ckconfig.o: $(I)/sys/types.h
  130. ckconfig.o: $(I)/dirent.h
  131. ckconfig.o: $(I)/stdio.h
  132. ckconfig.o: $(I)/pwd.h
  133. ckconfig.o: $(I)/grp.h
  134. ckconfig.o: cfg.h
  135. ckconfig.o: rkive.h
  136.  
  137. disp_grp.o: $(I)/sys/types.h
  138. disp_grp.o: $(I)/dirent.h
  139. disp_grp.o: $(I)/stdio.h
  140. disp_grp.o: $(I)/pwd.h
  141. disp_grp.o: $(I)/grp.h
  142. disp_grp.o: cfg.h
  143. disp_grp.o: rkive.h
  144.  
  145. efopen.o: $(I)/stdio.h
  146.  
  147. format.o: $(I)/stdio.h
  148. format.o: $(I)/sys/types.h
  149. format.o: article.h
  150.  
  151. header.o: $(I)/stdio.h
  152. header.o: $(I)/ctype.h
  153. header.o: $(I)/sys/types.h
  154. header.o: article.h
  155.  
  156. makedir.o: $(I)/sys/types.h
  157. makedir.o: $(I)/sys/stat.h
  158. makedir.o: $(I)/stdio.h
  159. makedir.o: $(I)/dirent.h
  160. makedir.o: rkive.h
  161.  
  162. news_arc.o: $(I)/sys/types.h
  163. news_arc.o: $(I)/sys/stat.h
  164. news_arc.o: $(I)/dirent.h
  165. news_arc.o: $(I)/stdio.h
  166. news_arc.o: $(I)/ctype.h
  167. news_arc.o: article.h
  168. news_arc.o: cfg.h
  169. news_arc.o: rkive.h
  170.  
  171. record_arc.o: $(I)/sys/types.h
  172. record_arc.o: $(I)/sys/stat.h
  173. record_arc.o: $(I)/dirent.h
  174. record_arc.o: $(I)/stdio.h
  175. record_arc.o: cfg.h
  176. record_arc.o: rkive.h
  177.  
  178. rename.o: $(I)/stdio.h
  179.  
  180. setup.o: $(I)/sys/types.h
  181. setup.o: $(I)/sys/stat.h
  182. setup.o: $(I)/stdio.h
  183. setup.o: $(I)/ctype.h
  184. setup.o: $(I)/pwd.h
  185. setup.o: $(I)/grp.h
  186. setup.o: $(I)/dirent.h
  187. setup.o: cfg.h
  188. setup.o: rkive.h
  189.  
  190. version.o: $(I)/stdio.h
  191. version.o: patchlevel.h
  192.  
  193. ################################
  194. #           Print
  195. ################################
  196.  
  197. print: print_docs print_support print_include 
  198.     $(LP) $(SRCS)
  199.  
  200. print_support:
  201.      pr $(SUPPORT) | lp
  202.  
  203. print_include:
  204.     $(LP) $(INCLUDES)
  205.  
  206. print_article:
  207.     $(LP) $(ARTICLE_SRCS)
  208.  
  209. print_ckconfig:
  210.     $(LP) $(CKCONFIG_SRCS)
  211.  
  212. print_rkive:
  213.     $(LP) $(ARCHIVE_SRCS)
  214.  
  215. print_docs:
  216.     $(NROFF) -man $(DOCS) | os | lp
  217.  
  218. ################################
  219. #           LINT
  220. ################################
  221.  
  222. lint:  
  223.     @echo "linting Article sources: " > Lint.out
  224.     lint $(LINTFLAGS) $(ARTICLE_SRCS) | tee -a Lint.out
  225.     @echo "linting Ckconfig sources: " >> Lint.out
  226.     lint $(LINTFLAGS) $(CKCONFIG_SRCS) | tee -a Lint.out
  227.     @echo "linting Archiver sources: " >> Lint.out
  228.     lint $(LINTFLAGS) $(ARCHIVE_SRCS) | tee -a Lint.out
  229.  
  230. lint_article:
  231.     @echo "linting Article sources: " > Lint.out
  232.     lint $(LINTFLAGS) $(ARTICLE_SRCS) 2>&1 | tee -a Lint.out
  233.  
  234. lint_ckconfig:
  235.     @echo "linting Ckconfig sources: " > Lint.out
  236.     lint $(LINTFLAGS) $(CKCONFIG_SRCS) | tee -a Lint.out
  237.  
  238. lint_rkive:
  239.     @echo "linting Archiver sources: " > Lint.out
  240.     lint $(LINTFLAGS) $(ARCHIVE_SRCS) | tee -a Lint.out
  241.  
  242. ################################
  243. #              CLEANUP        
  244. ################################
  245.  
  246. clean:
  247.     rm -f *.o Lint.out
  248.  
  249. clobber: clean
  250.     rm -f $(PROGS)
  251.  
  252. inspection:  
  253.     -inspect -abv $(ARTICLE_SRCS) 
  254.     -inspect -abv $(CKCONFIG_SRCS) 
  255.     -inspect -abv $(ARCHIVE_SRCS) 
  256.  
  257. inspect_rkive:
  258.     -inspect -abv $(ARCHIVE_SRCS) 
  259.