home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / RCS_SRC.ZIP / MAKEFILE < prev    next >
Text File  |  1991-01-15  |  10KB  |  306 lines

  1. #$Header: /usr/src/local/bin/rcs/src/RCS/Makefile,v 1.13 89/05/02 14:53:40 narten Exp $
  2. # Copyright (C) 1982, 1988, 1989 Walter Tichy
  3. #   Distributed under license by the Free Software Foundation, Inc.
  4. #
  5. # This file is part of RCS.
  6. #
  7. # RCS is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 1, or (at your option)
  10. # any later version.
  11. #
  12. # RCS is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with RCS; see the file COPYING.  If not, write to
  19. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20. #
  21. # Report problems and direct all questions to:
  22. #
  23. #    rcs-bugs@cs.purdue.edu
  24. #
  25. #               INSTRUCTIONS
  26. #               ============
  27. # 0.  If you are porting to different hardware,
  28. #     check the instructions in rcsbase.h
  29. #
  30. # Note: instructions 1-5 are normally taken care of by the calling make,
  31. # which passes in DIFF, DIFF3, RCSDIR, OLDDIR, OS, and LOCKING.
  32. #
  33. # 1. Early version of diff did not support options needed by RCS.
  34. #    Newer versions of diff, support them and diff is no longer distributed with
  35. #    RCS. The following definitions apply only if you have both old versions
  36. #    and new versions of diff, and you want RCS to use the new versions.
  37. #    The default should be :
  38. #
  39.  
  40. DIFF      = /bin/diff
  41. DIFF3     = /usr/lib/diff3
  42.  
  43. # 2.  Figure out where to put the RCS commands; define RCSDIR accordingly.
  44.  
  45. RCSDIR  = /usr/local/bin
  46.  
  47.  
  48. # 3.  Figure out where to put your old RCS commands; define OLDDIR
  49. #     accordingly. This is not needed if you don't have an old release of RCS.
  50. OLDDIR    = /usr/old/bin
  51.  
  52. # 4.  Set the operating system variable OS. If you run on 4.1 BSD, do not
  53. #     define OS:
  54. #     OS  =
  55. #     If you run on USG Unix or UN*X, use:
  56. #     OS  = -DUSG
  57. #     If you run on Version 6 Unix, use:
  58. #     OS  = -DV6
  59. #     If you run on 4.2 or 4.3 BSD, use:
  60. #     OS = -DV4_2BSD
  61. OS        = -DV4_2BSD
  62.  
  63. #     Also, set SIGNAL_TYPE to be what your signal() handlers yield.
  64. #     Old-fashioned signal handlers yield 'int'; the newer ones 'void'.
  65.  
  66. SIGNAL_TYPE = int
  67.  
  68. # 5.  Decide whether you want strict locking as the default or not.
  69. #     If you want strict locking, use:
  70. #     LOCKING = 1
  71. #     otherwise:
  72. #     LOCKING = 0
  73. LOCKING   = 1
  74.  
  75. # 6.  Decide what loader flags you need, and define LDFLAGS accordingly.
  76. #     On the Vax you need none, on PDP-11s with split i/d you need -i.
  77. #LDFLAGS  = -i
  78. LDFLAGS   =
  79.  
  80. # 7.  RCS can maintain a log of the use of the co and ci commands. If you
  81. #     want the logging, you must
  82. #     a) define SNOOP (that's where the process that writes the log goes),
  83. #     b) define SNOOPFILE (that's the file where SNOOP writes the log;
  84. #        it must be owned by the same user that owns SNOOP),
  85. #     c) include SNOOP and SNOOPFILE in the CFLAGS macro.
  86. #     If you don't want the logging of command usage, omit the SNOOP and
  87. #     SNOOPFILE definitions from CFLAGS.
  88. #     The two variants of the CFLAG macros are given below.
  89. SNOOPFILE = /usr/log/rcslog/log
  90. SNOOP    = /usr/local/bin/snoop
  91.  
  92. DEFINES= -DCOMPAT2 $(OS) -DSIGNAL_TYPE=$(SIGNAL_TYPE) -DSTRICT_LOCKING=$(LOCKING) -DDIFF='"$(DIFF)"' -DCO='"${RCSDIR}/co"' -DMERGE='"${RCSDIR}/merge"' 
  93. CFLAGS    = -O $(DEFINES)
  94. LINTFLAGS = -c -u
  95. LINT = lint $(LINTFLAGS) -Dlint $(DEFINES)
  96.  
  97. # 8.  If you don't have release 2 RCS files around (e.g., if you don't
  98. #     have release 2 of RCS), remove the word -DCOMPAT2 from whatever
  99. #     variant of CFLAGS you selected. -DCOMPAT2 assures that release 2
  100. #     RCS files can still be read. (After all release 2 RCS files have
  101. #     been updated with release 3 or 4 ci or rcs, you can remake RCS without
  102. #     -DCOMPAT2.) Also, make sure that the co commands at the end of this
  103. #     file are commented out; otherwise, Make will complain.
  104. #
  105. # 9.  Now you are ready. Try to make 'depend' and 'all'. If all went well, make
  106. #     'install' if you want no logging of command usage, 'installog' otherwise.
  107. #
  108. # 10. IMPORTANT! When you have RCS installed, rename old
  109. #     release 2 RCS files as follows (if you have any):
  110. #     If the working file was "f.c" and the RCS file "f.c.v", rename the
  111. #     RCS file to "f.c,v". If the working file was "f.c" and the RCS file
  112. #     "f.v", rename the RCS file "f.c,v". Thus, suffixes are no longer
  113. #     dropped and RCS files end in ",v" rather than ".v".
  114. #
  115. # 11. If you want to maintain RCS with itself, be sure you preserve the
  116. #     original revision numbers, dates, etc. This is done by checking the
  117. #     files in with the -k option. When done, remove the comments from the
  118. #     co-rules at the end of this file.
  119. #
  120. BCOMMANDS   =   ci ident rcs rcsdiff rcsmerge rlog co
  121. # binary comands
  122.  
  123. RCSCOMMANDS = merge $(BCOMMANDS)
  124. # all commands
  125.  
  126. BOBJECTS = ci.o co.o ident.o rcs.o rcsdiff.o rcsedit.o\
  127.     rcsfcmp.o rcsfnms.o rcsgen.o rcskeep.o rcskeys.o rcslex.o rcsmerge.o\
  128.     rcsrev.o rcssyn.o rcsutil.o rlog.o snoop.o\
  129.     rcssynTST.o rcsrevTST.o rcsfnmsTST.o rcsfcmpTST.o rcskeepTST.o
  130.  
  131. all:    $(RCSCOMMANDS)
  132.  
  133. INSTALL = install
  134.  
  135. $(BOBJECTS):    rcsbase.h
  136.  
  137. partime.o maketime.o co.o ci.o rcs.o rlog.o rcsutil.o:        time.h
  138.  
  139. install:    all 
  140. #    Save the old commands if you have any.
  141. #    -cd ${RCSDIR}; mv $(RCSCOMMANDS) ${RCSDIR}$(OLDDIR)
  142.     ${INSTALL} -m 775 -o root -s ci ${RCSDIR}
  143.     ${INSTALL} -m 775 -o root -s ident ${RCSDIR}
  144.     ${INSTALL} -m 775 -o root -s rcs ${RCSDIR}
  145.     ${INSTALL} -m 775 -o root -s rcsdiff ${RCSDIR}
  146.     ${INSTALL} -m 775 -o root -s rcsmerge ${RCSDIR}
  147.     ${INSTALL} -m 775 -o root -s rlog ${RCSDIR}
  148.     ${INSTALL} -m 775 -o root -s co ${RCSDIR}
  149.     ${INSTALL} -m 775 -o root -c merge ${RCSDIR}
  150. #    ${INSTALL} -m 775 -o root -c rcsclean ${RCSDIR}
  151. #    ${INSTALL} -m 775 -o root -c rcsfreeze.sh ${RCSDIR}/rcsfreeze
  152.  
  153. installog:    installsnoop install
  154.  
  155. installsnoop:    snoop
  156.     install -s snoop ${RCSDIR}$(SNOOP)
  157.     chmod u+s ${RCSDIR}$(SNOOP)
  158.     touch ${RCSDIR}$(SNOOPFILE)
  159.     chmod 644 ${RCSDIR}$(SNOOPFILE)
  160. # CAUTION: You may have to do a chown of SNOOP and SNOOPFILE (if not owned by root).
  161. lint: ci.lint co.lint ident.lint rlog.lint rcs.lint rcsdiff.lint rcsmerge.lint snoop.lint
  162.  
  163. clean:
  164.     -rm -f *.o; rm -f $(RCSCOMMANDS) snoop
  165.  
  166. CIFILES = ci.o rcslex.o rcssyn.o rcsgen.o rcsedit.o rcskeys.o rcsrev.o rcsutil.o rcsfnms.o partime.o maketime.o rcskeep.o rcsfcmp.o
  167.  
  168. CISRC = ci.c rcslex.c rcssyn.c rcsgen.c rcsedit.c rcskeys.c rcsrev.c rcsutil.c rcsfnms.c partime.c maketime.c rcskeep.c rcsfcmp.c
  169.  
  170. ci.lint:
  171.     $(LINT) $(CISRC)
  172.     
  173. ci:    $(CIFILES)
  174.     ${CC} $(LDFLAGS) -o ci $(CIFILES)
  175.  
  176. COFILES = co.o rcslex.o rcssyn.o rcsgen.o rcsedit.o rcskeys.o rcsrev.o rcsutil.o rcsfnms.o partime.o maketime.o
  177.  
  178. COSRC = co.c rcslex.c rcssyn.c rcsgen.c rcsedit.c rcskeys.c rcsrev.c rcsutil.c rcsfnms.c partime.c maketime.c
  179. co.lint:
  180.     $(LINT) $(COSRC)
  181. co:    $(COFILES)
  182.     ${CC} $(LDFLAGS) -o co $(COFILES)
  183.  
  184. ident:    ident.o rcskeys.o
  185.     ${CC} $(LDFLAGS) -o ident ident.o rcskeys.o
  186.  
  187. ident.lint:
  188.     $(LINT) ident.c rcskeys.c
  189.  
  190. merge:    merge.sh
  191.     sed -e '/^#/d' \
  192.         -e 's:DIFF=.*$$:DIFF=$(DIFF):' \
  193.         -e 's:DIFF3=.*$$:DIFF3=$(DIFF3):' \
  194.         merge.sh > merge
  195. #    This takes out the comment lines and substitutes in DIFF and DIFF3.
  196. #    (Comments are not permitted in some older shells.)
  197.     chmod 755 merge
  198.  
  199. RLOG = rlog.o rcslex.o rcssyn.o rcsrev.o rcsutil.o partime.o maketime.o rcsfnms.o
  200. RLOGSRC = rlog.c rcslex.c rcssyn.c rcsrev.c rcsutil.c partime.c maketime.c rcsfnms.c
  201. rlog:    $(RLOG)
  202.     ${CC} $(LDFLAGS) -o rlog $(RLOG)
  203.  
  204. rlog.lint:
  205.     $(LINT) $(RLOGSRC)
  206.  
  207. RCS = rcs.o rcslex.o rcssyn.o rcsrev.o rcsutil.o rcsgen.o rcsedit.o rcskeys.o rcsfnms.o
  208.  
  209. RCSSRC = rcs.c rcslex.c rcssyn.c rcsrev.c rcsutil.c rcsgen.c rcsedit.c rcskeys.c rcsfnms.c
  210. rcs:    $(RCS)
  211.     ${CC} $(LDFLAGS) -o rcs $(RCS)
  212.  
  213. rcs.lint:
  214.     $(LINT) $(RCSSRC)
  215.  
  216. rcsclean:    rcsclean.sh
  217.     sed -e '/^#/d' rcsclean.sh > rcsclean
  218. #    This takes out the comments (not permitted in older shells).
  219.     chmod 755 rcsclean
  220.  
  221. RCSDIFF = rcsdiff.o rcsutil.o rcsfnms.o rcsrev.o rcssyn.o rcslex.o
  222. RCSDIFFSRC = rcsdiff.c rcsutil.c rcsfnms.c rcsrev.c rcssyn.c rcslex.c
  223.  
  224. rcsdiff:    $(RCSDIFF)
  225.     ${CC} ${LDFLAGS} -o rcsdiff $(RCSDIFF)
  226.  
  227. rcsdiff.lint:
  228.     $(LINT) $(RCSDIFFSRC)
  229. RCSMERGE = rcsmerge.o rcsutil.o rcsfnms.o rcsrev.o rcssyn.o rcslex.o
  230. RCSMERGESRC = rcsmerge.c rcsutil.c rcsfnms.c rcsrev.c rcssyn.c rcslex.c
  231. rcsmerge:    $(RCSMERGE)
  232.     ${CC} ${LDFLAGS} -o rcsmerge $(RCSMERGE)
  233. rcsmerge.lint:
  234.     $(LINT) $(RCSMERGESRC)
  235.     
  236. snoop:    snoop.o
  237.     ${CC} ${LDFLAGS} -o snoop snoop.o
  238. snoop.lint:
  239.     $(LINT) snoop.c
  240.  
  241. SOURCE=    ci.c co.c curdir.c ident.c maketime.c partime.c rcs.c \
  242.     rcsclean.c rcsdiff.c rcsedit.c rcsfcmp.c rcsfnms.c rcsgen.c \
  243.     rcskeep.c rcskeys.c rcslex.c rcsmerge.c rcsrev.c rcssyn.c rcsutil.c \
  244.     rlog.c snoop.c
  245.  
  246. HFILES=    rcsbase.h time.h
  247.  
  248. depend:    ${SOURCE} ${HFILES}
  249.     (sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \
  250.      cc -M ${CFLAGS} ${SOURCE} | sed 's/\.\///; /\//d' \
  251.     ) >Makefile.new
  252.     cp Makefile Makefile.bak
  253.     cp Makefile.new Makefile
  254.     rm -f Makefile.new
  255.  
  256.  
  257. # DO NOT DELETE THIS LINE - 
  258. ci.o: ci.c
  259. ci.o: rcsbase.h
  260. ci.o: time.h
  261. co.o: co.c
  262. co.o: rcsbase.h
  263. co.o: time.h
  264. curdir.o: curdir.c
  265. curdir.o: rcsbase.h
  266. ident.o: ident.c
  267. ident.o: rcsbase.h
  268. maketime.o: maketime.c
  269. maketime.o: rcsbase.h
  270. maketime.o: time.h
  271. partime.o: partime.c
  272. partime.o: time.h
  273. rcs.o: rcs.c
  274. rcs.o: rcsbase.h
  275. rcsclean.o: rcsclean.c
  276. rcsclean.o: rcsbase.h
  277. rcsdiff.o: rcsdiff.c
  278. rcsdiff.o: rcsbase.h
  279. rcsedit.o: rcsedit.c
  280. rcsedit.o: rcsbase.h
  281. rcsfcmp.o: rcsfcmp.c
  282. rcsfcmp.o: rcsbase.h
  283. rcsfnms.o: rcsfnms.c
  284. rcsfnms.o: rcsbase.h
  285. rcsgen.o: rcsgen.c
  286. rcsgen.o: rcsbase.h
  287. rcskeep.o: rcskeep.c
  288. rcskeep.o: rcsbase.h
  289. rcskeys.o: rcskeys.c
  290. rcskeys.o: rcsbase.h
  291. rcslex.o: rcslex.c
  292. rcslex.o: rcsbase.h
  293. rcsmerge.o: rcsmerge.c
  294. rcsmerge.o: rcsbase.h
  295. rcsrev.o: rcsrev.c
  296. rcsrev.o: rcsbase.h
  297. rcssyn.o: rcssyn.c
  298. rcssyn.o: rcsbase.h
  299. rcsutil.o: rcsutil.c
  300. rcsutil.o: rcsbase.h
  301. rlog.o: rlog.c
  302. rlog.o: time.h
  303. rlog.o: rcsbase.h
  304. snoop.o: snoop.c
  305. snoop.o: rcsbase.h
  306.