xref: /original-bsd/contrib/rcs-V5.6/src/Makefile (revision 42f60e33)
1# $Id: Makefile,v 5.16 1991/10/07 17:32:46 eggert Exp $
2# Copyright (C) 1982, 1988, 1989 Walter Tichy
3# Copyright 1990, 1991 by Paul Eggert
4#   Distributed under license by the Free Software Foundation, Inc.
5#
6# This file is part of RCS.
7#
8# RCS is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2, or (at your option)
11# any later version.
12#
13# RCS is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with RCS; see the file COPYING.  If not, write to
20# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21#
22# Report problems and direct all questions to:
23#
24#    rcs-bugs@cs.purdue.edu
25#
26
27# default target
28default :: all
29
30# See README for more information on the configuration section.
31# ----- start of configuration section -----
32
33#(Unix
34
35 CC = cc
36#CC = bsdcc -qlanglvl=ansi# AIX
37#CC = cc -g# debug
38#CC = gcc -g# GCC
39
40 CC_D =
41
42 CC_O = -O
43#CC_O =# debug
44#CC_O = -O -R# BSD compilers that do not support `const'
45#CC_O = -O -fdelayed-branch -finline-functions -fomit-frame-pointer -fstrength-reduce# GCC options for brave souls
46
47 CC_W =
48#CC_W = -Wall -Wcast-qual -Wpointer-arith -Wshadow -Wwrite-strings# GCC
49
50 CFLAGS = $(CC_D) $(CC_O) $(CC_W)
51
52 COMPAT2 = 0
53#COMPAT2 = 1
54
55#DIFF = $(DIFFPREFIX)gdiff
56#DIFF = $(DIFFPREFIX)rdiff# short for ``RCS diff'' on some hosts
57DIFF = $(DIFFPREFIX)diff
58
59#DIFFPREFIX = /usr/local/bin/# GNU diff -- must be version 1.15 or later
60#DIFFPREFIX = /bin/# traditional diff
61DIFFPREFIX = /usr/bin/# traditional diff (alternate name)
62
63#DIFF_FLAGS = -an# GNU diff
64DIFF_FLAGS = -n# traditional diff
65
66#DIFF_L = 1# GNU diff
67DIFF_L = 0# traditional diff
68
69 DIFF_SUCCESS = 0
70#DIFF_SUCCESS = EXIT_SUCCESS
71 DIFF_FAILURE = 1
72#DIFF_FAILURE = EXIT_FAILURE
73 DIFF_TROUBLE = 2
74#DIFF_TROUBLE = (EXIT_FAILURE*2)
75
76#DIFF3 = $(DIFF)3# GNU diff3
77#DIFF3 = /usr/lib/diff3# traditional diff3
78#DIFF3 = /usr/5lib/diff3prog# other aliases for traditional diff3
79#DIFF3 = /usr/lib/diff3prog
80#DIFF3 = /usr/lib/rdiff3
81 DIFF3 = /usr/bin/diff3
82
83#DIFF3_BIN = 1# GNU diff
84 DIFF3_BIN = 0# traditional diff
85
86 ED = /bin/ed
87
88#EXECUTABLE_GROUP = staff# BSD unix installation
89 EXECUTABLE_GROUP = bin# BSD unix installation
90#EXECUTABLE_PERMISSIONS = -g $(EXECUTABLE_GROUP) -m 775# BSD unix installation
91 EXECUTABLE_PERMISSIONS = -g $(EXECUTABLE_GROUP) -m 555# BSD unix installation
92#INSTALL = install -c $(EXECUTABLE_PERMISSIONS)# BSD unix installation
93 INSTALL = install -s -o bin $(EXECUTABLE_PERMISSIONS)# BSD unix installation
94#INSTALL = cp# traditional Unix installation
95
96 LDFLAGS =
97
98 LDLIBS =
99
100 LINK = $(CC) $(LDFLAGS)
101
102 LINT = lint -abchx# traditional and BSD lint
103#LINT = lint# System V lint
104
105 MAKE = make
106
107 OTHER_OBJECT =
108
109#RCSDIR = /usr/local/bin
110 RCSDIR = /usr/contrib/bin
111#RCSDIR = /bin
112#RCSDIR = /usr/bin
113
114 RCSPREFIX = $(RCSDIR)/
115#RCSPREFIX =
116
117 REMOVE = rm -f
118
119 SENDMAIL = "/usr/libexec/mail.local"
120#SENDMAIL = "/bin/mail"
121#SENDMAIL = "/etc/delivermail", "-w"
122#SENDMAIL = "/usr/bin/mail"
123#SENDMAIL = "/usr/lib/sendmail"
124#SENDMAIL = "mail"
125#SENDMAIL =# for impoverished hosts that lack electronic mail
126
127 TESTPREFIX =
128
129 o = .o
130#o = .s# Minix/PC with ACK cc
131
132 x =
133
134#)
135# On non-Unix hosts you must manually create and edit conf.h from conf.heg.
136
137# ----- end of configuration section -----
138# You shouldn't have to change anything past this point.
139
140
141# Avoid brain damage in some versions of 'make'.
142SHELL = /bin/sh
143
144# all commands
145RCSCOMMANDS = ci$x co$x ident$x merge$x rcs$x rcsdiff$x rcsmerge$x rlog$x
146
147all :: $(RCSCOMMANDS)
148
149install :: all
150	$(INSTALL) ci$x $(DESTDIR)$(RCSDIR)
151	$(INSTALL) co$x $(DESTDIR)$(RCSDIR)
152	$(INSTALL) ident$x $(DESTDIR)$(RCSDIR)
153	$(INSTALL) merge$x $(DESTDIR)$(RCSDIR)
154	$(INSTALL) rcs$x $(DESTDIR)$(RCSDIR)
155	$(INSTALL) rcsdiff$x $(DESTDIR)$(RCSDIR)
156	$(INSTALL) rcsmerge$x $(DESTDIR)$(RCSDIR)
157	$(INSTALL) rlog$x $(DESTDIR)$(RCSDIR)
158
159# Install RCS and (if applicable) GNU diff before running these tests.
160# To test RCS before installing it, see README.
161RCSTEST = PATH=$(RCSDIR):$(DIFFPREFIX).:$$PATH sh $(TESTPREFIX)rcstest
162installtest ::
163	$(RCSTEST)
164installdebug ::
165	$(RCSTEST) -v
166
167clean ::
168	$(REMOVE) a.* *$o conf.h conf.error $(RCSCOMMANDS) rcsclean$x
169
170#(Unix
171conf.h : conf.sh Makefile
172	$(REMOVE) a.*
173	CC='$(CC)' CFLAGS='$(CFLAGS)' \
174	COMPAT2='$(COMPAT2)' \
175	DIFF3='$(DIFF3)' DIFF3_BIN='$(DIFF3_BIN)' \
176	DIFF='$(DIFF)' DIFF_FLAGS='$(DIFF_FLAGS)' DIFF_L='$(DIFF_L)' \
177	DIFF_SUCCESS='$(DIFF_SUCCESS)' DIFF_FAILURE='$(DIFF_FAILURE)' DIFF_TROUBLE='$(DIFF_TROUBLE)' \
178	ED='$(ED)' \
179	LDFLAGS='$(LDFLAGS)' LDLIBS='$(LDLIBS)' \
180	RCSPREFIX='$(RCSPREFIX)' \
181	SENDMAIL='$(SENDMAIL)' \
182	sh -x conf.sh >a.h 2>conf.error
183	mv a.h $@
184	$(REMOVE) a.*
185#)
186
187ci = ci$o rcslex$o rcssyn$o rcsgen$o rcsedit$o rcskeys$o rcsmap$o \
188	rcsrev$o rcsutil$o rcsfnms$o partime$o maketime$o rcskeep$o \
189	rcsfcmp$o $(OTHER_OBJECT)
190ci$x : $(ci)
191	$(LINK) $(ci) $(LDLIBS) -o $@
192
193co = co$o rcslex$o rcssyn$o rcsgen$o rcsedit$o rcskeys$o rcsmap$o \
194	rcsrev$o rcsutil$o rcsfnms$o partime$o maketime$o rcskeep$o $(OTHER_OBJECT)
195co$x : $(co)
196	$(LINK) $(co) $(LDLIBS) -o $@
197
198ident = ident$o rcsmap$o $(OTHER_OBJECT)
199ident$x : $(ident)
200	$(LINK) $(ident) $(LDLIBS) -o $@
201
202merge = merge$o merger$o rcsfnms$o rcslex$o \
203	rcsmap$o rcsrev$o rcssyn$o rcsutil$o \
204	rcskeep$o rcskeys$o $(OTHER_OBJECT)
205merge$x : $(merge)
206	$(LINK) $(merge) $(LDLIBS) -o $@
207
208rlog = rlog$o rcslex$o rcsmap$o rcssyn$o rcsrev$o rcsutil$o partime$o \
209	maketime$o rcsfnms$o rcskeep$o rcskeys$o $(OTHER_OBJECT)
210rlog$x : $(rlog)
211	$(LINK) $(rlog) $(LDLIBS) -o $@
212
213rcs = rcs$o rcslex$o rcssyn$o rcsrev$o rcsutil$o rcsgen$o rcsedit$o rcskeys$o \
214	rcsmap$o rcsfnms$o rcskeep$o $(OTHER_OBJECT)
215rcs$x : $(rcs)
216	$(LINK) $(rcs) $(LDLIBS) -o $@
217
218rcsclean = rcsclean$o rcsedit$o rcsfcmp$o rcsfnms$o rcsgen$o rcskeys$o \
219	rcslex$o rcsmap$o rcsrev$o rcssyn$o rcsutil$o rcskeep$o $(OTHER_OBJECT)
220rcsclean$x : $(rcsclean)
221	$(LINK) $(rcsclean) $(LDLIBS) -o $@
222
223rcsdiff = rcsdiff$o rcsutil$o rcsfnms$o rcsmap$o rcsrev$o rcssyn$o rcslex$o \
224	maketime$o partime$o rcskeep$o rcskeys$o $(OTHER_OBJECT)
225rcsdiff$x : $(rcsdiff)
226	$(LINK) $(rcsdiff) $(LDLIBS) -o $@
227
228rcsmerge = rcsmerge$o merger$o rcsutil$o rcsfnms$o rcsmap$o rcsrev$o rcssyn$o \
229	rcslex$o rcskeep$o rcskeys$o $(OTHER_OBJECT)
230rcsmerge$x : $(rcsmerge)
231	$(LINK) $(rcsmerge) $(LDLIBS) -o $@
232
233SOURCE=	ci.c co.c ident.c maketime.c merge.c merger.c partime.c rcs.c \
234	rcsclean.c rcsdiff.c rcsedit.c rcsfcmp.c rcsfnms.c rcsgen.c \
235	rcskeep.c rcskeys.c rcslex.c rcsmap.c rcsmerge.c rcsrev.c rcssyn.c \
236	rcsutil.c rlog.c
237OBJECT=	ci$o co$o ident$o maketime$o merge$o merger$o partime$o rcs$o \
238	rcsclean$o rcsdiff$o rcsedit$o rcsfcmp$o rcsfnms$o rcsgen$o \
239	rcskeep$o rcskeys$o rcslex$o rcsmap$o rcsmerge$o rcsrev$o rcssyn$o \
240	rcsutil$o rlog$o
241
242lint :: conf.h
243	$(LINT) $(CC_D) -Dlint=1 $(SOURCE)
244
245conf_h = conf.h
246$(OBJECT) : $(conf_h) rcsbase.h
247