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