1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
#
# Makefile
# Copyright (C) 1990, 1991, 1992 Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#
#
# Makefile for readline and history libraries.
#
srcdir = .
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
datadir = $(prefix)/share
mandir = $(prefix)/man
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = $(prefix)/share/info
includedir = $(prefix)/include
DESTDIR =
SHELL = /bin/sh
INSTALL = install -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)
AR = ar
AR_FLAGS = qv
CFLAGS = -g
MAKEINFO = makeinfo
RANLIB = ranlib
# Define TYPES as -DVOID_SIGHANDLER if your operating system uses
# a return type of "void" for signal handlers.
TYPES = -DVOID_SIGHANDLER
# HP-UX compilation requires the BSD library.
#LOCAL_LIBS = -lBSD
# Xenix compilation requires -ldir -lx
#LOCAL_LIBS = -ldir -lx
# Comment out "-DVI_MODE" if you don't think that anyone will ever desire
# the vi line editing mode and features.
READLINE_DEFINES = $(TYPES) -DVI_MODE
DEBUG_FLAGS = $(MINUS_G)
LDFLAGS = $(DEBUG_FLAGS)
# A good alternative is gcc -traditional.
#CC = gcc -traditional
RM = rm
CP = cp
LOCAL_INCLUDES = -I$(srcdir)/../
# The name of the main library target.
LIBRARY_NAME = libreadline.a
# The C code source files for this library.
CSOURCES = readline.c funmap.c keymaps.c vi_mode.c parens.c search.c \
rltty.c complete.c bind.c isearch.c display.c signals.c \
emacs_keymap.c vi_keymap.c history.c tilde.c xmalloc.c
# The header files for this library.
HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h \
posixstat.h tilde.h
OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
rltty.o complete.o bind.o isearch.o display.o signals.o \
history.o tilde.o xmalloc.o
SOURCES = $(CSOURCES) $(HSOURCES)
DOCUMENTATION = readline.texi inc-read.texi \
history.texi inc-hist.texi
SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
FLAGS_TO_PASS = \
"infodir=$(infodir)" \
"bindir=$(bindir)" \
"prefix=$(prefix)" \
"exec_prefix=$(exec_prefix)" \
"against=$(against)" \
"MAKEINFO=$(MAKEINFO)" \
"INSTALL=$(INSTALL)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_DATA=$(INSTALL_DATA)"
SUBDIRS = doc
#### Host, target, and site specific Makefile fragments come in here.
###
.c.o:
$(CC) -c $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $<
STAGESTUFF = *.o
all: libreadline.a
check:
installcheck:
info dvi install-info clean-info clean-dvi: force
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
TAGS: force
etags $(srcdir)/*.h $(srcdir)/*.c
subdir_do: force
@for i in $(DODIRS); do \
if [ -f ./$$i/Makefile ] ; then \
if (cd ./$$i; \
$(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
else exit 1 ; fi ; \
else true ; fi ; \
done
libreadline.a: $(OBJECTS)
$(RM) -f libreadline.a
$(AR) $(AR_FLAGS) libreadline.a $(OBJECTS)
$(RANLIB) libreadline.a
bind.o: bind.c sysdep.h rldefs.h readline.h keymaps.h chardefs.h history.h
complete.o: complete.c sysdep.h rldefs.h readline.h keymaps.h chardefs.h
display.o: display.c rldefs.h readline.h keymaps.h chardefs.h history.h
funmap.o: funmap.c sysdep.h readline.h keymaps.h chardefs.h
history.o: history.c sysdep.h history.h chardefs.h
isearch.o: isearch.c readline.h keymaps.h chardefs.h history.h
keymaps.o: keymaps.c sysdep.h readline.h keymaps.h chardefs.h emacs_keymap.c vi_keymap.c
parens.o: parens.c readline.h keymaps.h chardefs.h
readline.o: readline.c sysdep.h rldefs.h readline.h keymaps.h chardefs.h history.h
rltty.o: rltty.c rldefs.h readline.h keymaps.h chardefs.h
search.o: search.c readline.h keymaps.h chardefs.h history.h
signals.o: signals.c rldefs.h readline.h keymaps.h chardefs.h history.h
tilde.o: tilde.c sysdep.h tilde.h chardefs.h
vi_mode.o: vi_mode.c rldefs.h readline.h keymaps.h chardefs.h history.h
xmalloc.o: xmalloc.c
libtest: libreadline.a libtest.c
$(CC) -o libtest $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) -L. libtest.c -lreadline -ltermcap
readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h vi_mode.o
$(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
$(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \
keymaps.o history.o vi_mode.o -L. -ltermcap
readline.tar: $(THINGS_TO_TAR)
tar -cf readline.tar $(THINGS_TO_TAR)
readline.tar.Z: readline.tar
compress -f readline.tar
install:
$(INSTALL_DATA) libreadline.a $(DESTDIR)$(libdir)/libreadline.a
$(RANLIB) $(DESTDIR)$(libdir)/libreadline.a
$(INSTALL_DATA) $(srcdir)/readline.h $(DESTDIR)$(includedir)/readline/readline.h
$(INSTALL_DATA) $(srcdir)/keymaps.h $(DESTDIR)$(includedir)/readline/keymaps.h
$(INSTALL_DATA) $(srcdir)/chardefs.h $(DESTDIR)$(includedir)/readline/chardefs.h
includes:
$(INSTALL_FILE) $(srcdir)/readline.h $(DESTDIR)$(includedir)/readline/readline.h
$(INSTALL_FILE) $(srcdir)/keymaps.h $(DESTDIR)$(includedir)/readline/keymaps.h
$(INSTALL_FILE) $(srcdir)/chardefs.h $(DESTDIR)$(includedir)/readline/chardefs.h
$(INSTALL_FILE) $(srcdir)/history.h $(DESTDIR)$(includedir)/readline/history.h
local-clean:
rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn
rm -f *.aux *.pg *.toc
mostlyclean: local-clean
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
clean: local-clean
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
distclean: local-clean
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
rm -f Makefile config.status sysdep.h
realclean maintainer-clean: local-clean
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
rm -f Makefile config.status sysdep.h
$(DESTDIR)/libreadline.a: libreadline.a
# Copy the object files from a particular stage into a subdirectory.
stage1: force
-mkdir stage1
-mv $(STAGESTUFF) stage1
stage2: force
-mkdir stage2
-mv $(STAGESTUFF) stage2
stage3: force
-mkdir stage3
-mv $(STAGESTUFF) stage3
against=stage2
comparison: force
for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
de-stage1: force
-(cd stage1 ; mv -f * ..)
-rmdir stage1
de-stage2: force
-(cd stage2 ; mv -f * ..)
-rmdir stage2
de-stage3: force
-(cd stage3 ; mv -f * ..)
-rmdir stage3
force:
# with the gnu make, this is done automatically.
Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
$(SHELL) ./config.status
|