Subversion Repositories planix.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
99 7u83 1
#
2
# This code contains changes by
3
#      Gunnar Ritter, Freiburg i. Br., Germany, 2002. All rights reserved.
4
#
5
# Conditions 1, 2, and 4 and the no-warranty notice below apply
6
# to these changes.
7
#
8
#
9
# Copyright (c) 1980, 1993
10
# 	The Regents of the University of California.  All rights reserved.
11
#
12
# Redistribution and use in source and binary forms, with or without
13
# modification, are permitted provided that the following conditions
14
# are met:
15
# 1. Redistributions of source code must retain the above copyright
16
#    notice, this list of conditions and the following disclaimer.
17
# 2. Redistributions in binary form must reproduce the above copyright
18
#    notice, this list of conditions and the following disclaimer in the
19
#    documentation and/or other materials provided with the distribution.
20
# 3. All advertising materials mentioning features or use of this software
21
#    must display the following acknowledgement:
22
# 	This product includes software developed by the University of
23
# 	California, Berkeley and its contributors.
24
# 4. Neither the name of the University nor the names of its contributors
25
#    may be used to endorse or promote products derived from this software
26
#    without specific prior written permission.
27
#
28
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38
# SUCH DAMAGE.
39
#
40
#
41
# Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.
42
#
43
# Redistribution and use in source and binary forms, with or without
44
# modification, are permitted provided that the following conditions
45
# are met:
46
#   Redistributions of source code and documentation must retain the
47
#    above copyright notice, this list of conditions and the following
48
#    disclaimer.
49
#   Redistributions in binary form must reproduce the above copyright
50
#    notice, this list of conditions and the following disclaimer in the
51
#    documentation and/or other materials provided with the distribution.
52
#   All advertising materials mentioning features or use of this software
53
#    must display the following acknowledgement:
54
#      This product includes software developed or owned by Caldera
55
#      International, Inc.
56
#   Neither the name of Caldera International, Inc. nor the names of
57
#    other contributors may be used to endorse or promote products
58
#    derived from this software without specific prior written permission.
59
#
60
# USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
61
# INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
62
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
63
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
64
# ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE
65
# LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR
66
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
67
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
68
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
69
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
70
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
71
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
72
#
73
#	from Makefile	7.13.1.3 (2.11BSD GTE) 1996/10/23
74
#
75
#	@(#)Makefile	1.50 (gritter) 2/20/05
76
#
77
 
78
#
79
# Destinations for installation. $(PRESERVEDIR) is used for recovery files.
80
# It will get mode 1777.
81
#
82
PREFIX		= /usr/local
83
BINDIR		= $(PREFIX)/bin
84
LIBEXECDIR	= $(PREFIX)/libexec
85
MANDIR		= $(PREFIX)/share/man
86
PRESERVEDIR	= /var/preserve
87
 
88
#
89
# DESTDIR is prepended to the installation paths. It is mostly useful
90
# for package building and should be left empty otherwise.
91
#
92
DESTDIR		=
93
 
94
#
95
# A BSD-like install program. GNU install will fit well here, too.
96
#
97
INSTALL		= /usr/ucb/install
98
 
99
#
100
# Compiler and linker flags.
101
#
102
# On HP-UX, add -D_INCLUDE__STDC_A1_SOURCE to CPPFLAGS.
103
#
104
#CFLAGS	=
105
#CPPFLAGS =
106
#LDFLAGS	=
107
#LDADD	=
108
 
109
#
110
# All of the following settings are quite recommended, so you should only
111
# change them if it becomes really necessary.
112
#
113
# Remove -DMB to build without multibyte character support. This will be
114
#     necessary if the compiler complains about a missing wchar.h, wctype.h,
115
#     mbtowc(), mbrtowc(), btowc(), wcwidth() etc. You will likely also have
116
#     to use the old regular expression code in these cases (see below).
117
# Remove -DBIT8 to get a 7bit-only ex. This setting is mostly provided for
118
#     testing the internationalization code against the older version and
119
#     should not normally be removed.
120
# Add -DNO_BE_BACKSLASH to make backslash a regular character inside RE
121
#     bracket expressions. This is required for POSIX conformance but
122
#     conflicts with historical practice for ex.
123
#
124
# Some historic comments:
125
#
126
# Ex is very large - this version will not fit on PDP-11's without overlay
127
# software.  Things that can be turned off to save
128
# space include LISPCODE (-l flag, showmatch and lisp options), CHDIR (the 
129
# previously undocumented chdir command.)
130
#
131
# If your system expands tabs to 4 spaces you should -DTABS=4 below
132
#
133
FEATURES	= -DLISPCODE -DCHDIR -DFASTTAG -DUCVISUAL -DMB -DBIT8
134
 
135
#
136
# This disables the LC_CTYPE locale settings and assumes all characters
137
# upwards from octal 0240 are printable ones, like in ISO 8859-1. It
138
# should only be used if the system's locales are broken. It cannot be
139
# used in combination with -DMB.
140
#
141
#CHARSET	= -DISO8859_1
142
 
143
#
144
# If you want LC_MESSAGES support using catgets(), define this. To make
145
# any practical use of it, you also have to create a message catalogue,
146
# put it in a proper location and change UNKNOWN to its name. See your
147
# system's documentation on "gencat" or on language support in general
148
# for further information. This setting is not interesting at the current
149
# time unless you want to contribute internationalized message catalogues.
150
#
151
#LANGMSG		= -DLANGMSG -DCATNAME='"UNKNOWN"'
152
 
153
#
154
# For POSIX regular expressions, e.g. the star applied to subexpressions
155
# as in \(ab\)* and localized regular expressions like [:class:], [.c.],
156
# and [=c=], you need Caldera's 'UNIX(R) Regular Expression Library' or
157
# the included derivative of it.
158
#
159
# Comment out the three following lines if you do not have it or if it
160
# does not compile; it needs some advanced multibyte character support
161
# (wchar.h, wctype.h, btowc() etc.) which is not provided by older
162
# compilation environments.
163
#
164
REINC	= -I./libuxre -DUXRE
165
RELIB	= -L./libuxre -luxre
166
RETGT	= uxre
167
 
168
#
169
# VMUNIX should be correct for any modern Unix.
170
#
171
# Historic comments:
172
#
173
# VMUNIX makes ex considerably larger, raising 
174
# many limits and improving speed and simplicity of maintenance.  It is 
175
# suitable only for a VAX or other large machine, and then probably only in 
176
# a paged system.
177
#
178
# Don't define VFORK unless your system has the VFORK system call,
179
# which is like fork but the two processes have only one data space until the
180
# child execs. This speeds up ex by saving the memory copy.
181
#
182
#      Note by Gunnar Ritter: vfork() is unreliable and one of the worst
183
#      hacks in Unix history. Do not define VFORK unless you have a
184
#      special good reason for that.
185
#
186
OSTYPE	= -DVMUNIX
187
 
188
#
189
# On VMUNIX systems, ex can normally edit files up to 32 MB of size. LARGEF
190
# raises this limit to around 1 GB, but ex will consume much more of core
191
# and temp file space then.
192
#
193
#LARGEF	= -DLARGEF
194
 
195
# 
196
# The next setting is a crucial one since it determines the way ex
197
# gets its knowledge about the terminal's capabilities. If you get
198
# weird results, try using another library here. Uncomment exactly
199
# one entry.
200
#
201
# On System V, the terminfo library may be more accurate than the termcap
202
# file. To use it, link against the curses library.
203
#
204
#TERMLIB	= curses
205
#
206
# You may also get terminfo access by using the ncurses library.
207
#
208
#TERMLIB	= ncurses
209
#
210
# The preferred choice for ex on Linux distributions, other systems that
211
# provide a good termcap file, or when setting the TERMCAP environment
212
# variable is deemed sufficient, is the included 2.11BSD termcap library.
213
#
214
TERMLIB	= termlib
215
 
216
#
217
# Since ex uses sbrk() internally, a conflict with the libc's version of
218
# malloc() must be avoided. There are two ways to work around this problem.
219
# The first is to allocate a static pool for all malloc purposes. This will
220
# work on any kind of system.
221
#
222
#MALLOC=malloc.o
223
#
224
# If mmap() can be used to allocate anonymous memory, this is the preferred
225
# choice as it allows to grow memory dynamically as it is needed. This will
226
# usually work unless you are compiling for a vector machine or another
227
# unusual enviroment.
228
MALLOC=mapmalloc.o
229
 
230
###############################################################################
231
#                                                                             #
232
# That's it. You do not normally need to change anything below here.          #
233
#                                                                             #
234
###############################################################################
235
 
236
#WARN	= -Wall -Wno-parentheses -Werror
237
 
238
STRIP = -s
239
RECOVER	= -DEXRECOVER=\"$(LIBEXECDIR)/exrecover\" \
240
			-DEXPRESERVE=\"$(LIBEXECDIR)/expreserve\"
241
CCFLAGS	= $(CFLAGS) $(WARN) $(CPPFLAGS) $(FEATURES) $(CHARSET) $(OSTYPE) \
242
		$(LARGEF) $(RECOVER) $(LANGMSG) $(REINC) $(RPMCFLAGS)
243
TLIB	= libterm/libtermlib.a
244
INCLUDE	= /usr/include
245
OBJS	= ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
246
		ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
247
		ex_set.o ex_subr.o ex_tagio.o ex_temp.o ex_tty.o ex_unix.o \
248
		ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
249
		ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
250
		printf.o ex_version.o $(MALLOC)
251
HDRS	= ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h \
252
		ex_vis.h libterm/libterm.h
253
SRC1	= ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
254
SRC2	= ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
255
SRC3	= ex_set.c ex_subr.c ex_tagio.c ex_temp.c ex_tty.c ex_unix.c
256
SRC4	= ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
257
SRC5	= ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
258
SRC6	= printf.c expreserve.c exrecover.c ex_version.c
259
SRC7	= mapmalloc.c malloc.c
260
 
261
.SUFFIXES: .o .c
262
.c.o: ; $(CC) $(CCFLAGS) -c $<
263
 
264
all: $(RETGT) exrecover expreserve ex
265
 
266
ex: $(TLIB) $(OBJS)
267
	$(CC) -o ex $(LDFLAGS) $(OBJS) $(LDADD) -Llibterm -l$(TERMLIB) $(RELIB)
268
	size ex
269
 
270
$(TLIB): libterm/termcap.c libterm/tgoto.c libterm/tputs.c libterm/libterm.h
271
	@cd libterm && $(MAKE) CC="$(CC)" \
272
		COPT="$(CFLAGS) $(WARN) $(CPPFLAGS) $(OSTYPE)"
273
 
274
exrecover: exrecover.o $(MALLOC)
275
	$(CC) -o exrecover $(LDFLAGS) exrecover.o $(MALLOC) $(LDADD)
276
 
277
expreserve: expreserve.o
278
	$(CC) -o expreserve $(LDFLAGS) expreserve.o $(LDADD)
279
 
280
ex_vars.h: ex_data.c
281
	sh makeoptions $(CCFLAGS)
282
 
283
uxre:
284
	@cd libuxre && $(MAKE) CC="$(CC)" \
285
		COPT="$(CFLAGS) $(WARN) $(CPPFLAGS) $(OSTYPE)"
286
 
287
clean:
288
	@cd libterm && $(MAKE) clean
289
	@test ! -d libuxre || (cd libuxre && $(MAKE) clean)
290
#	If we dont have ex we cant make it so don't rm ex_vars.h
291
	-rm -f ex exrecover expreserve *.o x*.[cs] core errs trace
292
 
293
mrproper: clean
294
	-rm -f log
295
 
296
# install in standard place
297
 
298
install-man:
299
	test -d $(DESTDIR)$(PREFIX) || mkdir -p $(DESTDIR)$(PREFIX)
300
	test -d $(DESTDIR)$(MANDIR) || mkdir -p $(DESTDIR)$(MANDIR)
301
	test -d $(DESTDIR)$(MANDIR)/man1 || mkdir -p $(DESTDIR)$(MANDIR)/man1
302
	rm -f $(DESTDIR)$(MANDIR)/man1/ex.1 $(DESTDIR)$(MANDIR)/man1/edit.1 \
303
		$(DESTDIR)$(MANDIR)/man1/vedit.1 \
304
		$(DESTDIR)$(MANDIR)/man1/vi.1 \
305
		$(DESTDIR)$(MANDIR)/man1/view.1
306
	$(INSTALL) -c -m 644 ex.1 $(DESTDIR)$(MANDIR)/man1/ex.1
307
	$(INSTALL) -c -m 644 vi.1 $(DESTDIR)$(MANDIR)/man1/vi.1
308
	ln -s ex.1 $(DESTDIR)$(MANDIR)/man1/edit.1
309
	ln -s vi.1 $(DESTDIR)$(MANDIR)/man1/vedit.1
310
	ln -s vi.1 $(DESTDIR)$(MANDIR)/man1/view.1
311
 
312
install: all install-man
313
	rm -f $(DESTDIR)$(BINDIR)/ex $(DESTDIR)$(BINDIR)/edit \
314
		$(DESTDIR)$(BINDIR)/vedit $(DESTDIR)$(BINDIR)/vi \
315
		$(DESTDIR)$(BINDIR)/view
316
	test -d $(DESTDIR)$(BINDIR) || mkdir -p $(DESTDIR)$(BINDIR)
317
# special provisions for sticky install
318
	if test -f $(DESTDIR)$(BINDIR)/ex; \
319
	then	test -f $(DESTDIR)$(BINDIR)/ex.old.$$$$ && exit 1; \
320
		chmod 755 $(DESTDIR)$(BINDIR)/ex; \
321
		echo q | $(DESTDIR)$(BINDIR)/ex; \
322
		mv $(DESTDIR)$(BINDIR)/ex $(DESTDIR)$(BINDIR)/ex.old.$$$$; \
323
		rm -f $(DESTDIR)$(BINDIR)/ex.old.$$$$; \
324
	fi
325
	$(INSTALL) -c $(STRIP) -m 1755 ex $(DESTDIR)$(BINDIR)/ex
326
	test -d $(DESTDIR)$(LIBEXECDIR) || mkdir -p $(DESTDIR)$(LIBEXECDIR)
327
	$(INSTALL) -c $(STRIP) exrecover $(DESTDIR)$(LIBEXECDIR)/exrecover
328
	$(INSTALL) -c $(STRIP) expreserve $(DESTDIR)$(LIBEXECDIR)/expreserve
329
	ln -s ex $(DESTDIR)$(BINDIR)/edit
330
	ln -s ex $(DESTDIR)$(BINDIR)/vedit
331
	ln -s ex $(DESTDIR)$(BINDIR)/vi
332
	ln -s ex $(DESTDIR)$(BINDIR)/view
333
	test -d $(DESTDIR)$(PRESERVEDIR) || mkdir -p $(DESTDIR)$(PRESERVEDIR)
334
	chmod 1777 $(DESTDIR)$(PRESERVEDIR)
335
 
336
ex.o: config.h ex_argv.h ex.h ex_proto.h ex_temp.h ex_tty.h ex_tune.h
337
ex.o: ex_vars.h libterm/libterm.h
338
ex_addr.o: config.h ex.h ex_proto.h ex_re.h ex_tune.h ex_vars.h
339
ex_cmds.o: config.h ex_argv.h ex.h ex_proto.h ex_temp.h ex_tty.h ex_tune.h
340
ex_cmds.o: ex_vars.h ex_vis.h libterm/libterm.h
341
ex_cmds2.o: config.h ex_argv.h ex.h ex_proto.h ex_temp.h ex_tty.h ex_tune.h
342
ex_cmds2.o: ex_vars.h ex_vis.h libterm/libterm.h
343
ex_cmdsub.o: config.h ex_argv.h ex.h ex_proto.h ex_temp.h ex_tty.h ex_tune.h
344
ex_cmdsub.o: ex_vars.h ex_vis.h libterm/libterm.h
345
ex_data.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h
346
ex_data.o: libterm/libterm.h
347
ex_extern.o: config.h ex_argv.h ex.h ex_proto.h ex_re.h ex_temp.h ex_tty.h
348
ex_extern.o: ex_tune.h ex_vars.h ex_vis.h libterm/libterm.h
349
ex_get.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h
350
ex_get.o: libterm/libterm.h
351
ex_io.o: config.h ex_argv.h ex.h ex_proto.h ex_temp.h ex_tty.h ex_tune.h
352
ex_io.o: ex_vars.h ex_vis.h libterm/libterm.h
353
ex_put.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
354
ex_put.o: libterm/libterm.h
355
ex_re.o: config.h ex.h ex_proto.h ex_re.h ex_tune.h ex_vars.h
356
ex_set.o: config.h ex.h ex_proto.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h
357
ex_set.o: libterm/libterm.h
358
ex_subr.o: config.h ex.h ex_proto.h ex_re.h ex_tty.h ex_tune.h ex_vars.h
359
ex_subr.o: ex_vis.h libterm/libterm.h
360
ex_tagio.o: config.h ex.h ex_proto.h ex_tune.h ex_vars.h
361
ex_temp.o: config.h ex.h ex_proto.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h
362
ex_temp.o: ex_vis.h libterm/libterm.h
363
ex_tty.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h
364
ex_tty.o: libterm/libterm.h
365
ex_unix.o: config.h ex.h ex_proto.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h
366
ex_unix.o: ex_vis.h libterm/libterm.h
367
ex_v.o: config.h ex.h ex_proto.h ex_re.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
368
ex_v.o: libterm/libterm.h
369
ex_vadj.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
370
ex_vadj.o: libterm/libterm.h
371
ex_vget.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
372
ex_vget.o: libterm/libterm.h
373
ex_vmain.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
374
ex_vmain.o: libterm/libterm.h
375
ex_voper.o: config.h ex.h ex_proto.h ex_re.h ex_tty.h ex_tune.h ex_vars.h
376
ex_voper.o: ex_vis.h libterm/libterm.h
377
ex_vops.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
378
ex_vops.o: libterm/libterm.h
379
ex_vops2.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
380
ex_vops2.o: libterm/libterm.h
381
ex_vops3.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
382
ex_vops3.o: libterm/libterm.h
383
ex_vput.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
384
ex_vput.o: libterm/libterm.h
385
ex_vwind.o: config.h ex.h ex_proto.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
386
ex_vwind.o: libterm/libterm.h
387
expreserve.o: config.h
388
exrecover.o: config.h ex.h ex_proto.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h
389
exrecover.o: libterm/libterm.h
390
malloc.o: config.h
391
mapmalloc.o: config.h
392
printf.o: config.h