1 ## -*- text -*- #############################################################
3 # Makefile for the Bash versions of the GNU Readline and History Libraries. #
5 #############################################################################
7 # Copyright (C) 1994-2024 Free Software Foundation, Inc.
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 PACKAGE = @PACKAGE_NAME@
23 VERSION = @PACKAGE_VERSION@
25 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
26 PACKAGE_NAME = @PACKAGE_NAME@
27 PACKAGE_STRING = @PACKAGE_STRING@
28 PACKAGE_VERSION = @PACKAGE_VERSION@
33 BUILD_DIR = @BUILD_DIR@
35 datarootdir = @datarootdir@
38 INSTALL_PROGRAM = @INSTALL_PROGRAM@
39 INSTALL_DATA = @INSTALL_DATA@
51 # Programs to make tags files.
60 LOCAL_CFLAGS = @LOCAL_CFLAGS@ ${DEBUG}
61 STYLE_CFLAGS = @STYLE_CFLAGS@
66 LOCAL_DEFS = @LOCAL_DEFS@
68 INCLUDES = -I. -I$(BUILD_DIR) -I$(topdir) -I$(topdir)/lib
70 CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(APP_CFLAGS) $(CPPFLAGS) ${INCLUDES} \
71 $(STYLE_CFLAGS) $(LOCAL_CFLAGS) $(CFLAGS) ${ADDON_CFLAGS}
75 $(CC) -c $(CCFLAGS) $<
77 # The name of the main library target.
78 LIBRARY_NAME = libreadline.a
80 # The C code source files for this library.
81 CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
82 $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
83 $(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \
84 $(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \
85 $(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \
86 $(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \
87 $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
88 $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
89 $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
90 $(srcdir)/shell.c $(srcdir)/tilde.c $(srcdir)/savestring.c \
91 $(srcdir)/text.c $(srcdir)/misc.c $(srcdir)/compat.c \
92 $(srcdir)/colors.c $(srcdir)/parse-colors.c \
93 $(srcdir)/mbutil.c $(srcdir)/xfree.c
95 # The header files for this library.
96 HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
97 posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
98 ansi_stdlib.h rlstdc.h tcap.h xmalloc.h rlprivate.h rlshell.h \
99 rltypedefs.h rlmbutil.h colors.h parse-colors.h
101 HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o savestring.o \
104 COLORSOBJ = colors.o parse-colors.o
105 OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
106 rltty.o complete.o bind.o isearch.o display.o signals.o \
107 util.o kill.o undo.o macro.o input.o callback.o terminal.o \
108 text.o nls.o misc.o $(HISTOBJ) $(TILDEOBJ) $(COLORSOBJ) \
109 xmalloc.o xfree.o compat.o
111 # The texinfo files which document this library.
112 DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
113 DOCOBJECT = doc/readline.dvi
114 DOCSUPPORT = doc/Makefile
115 DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
117 SUPPORT = Makefile ChangeLog $(DOCSUPPORT) examples/[-a-z.]*
119 SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
121 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
123 INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
124 rlstdc.h rlconf.h rltypedefs.h
126 ##########################################################################
128 all: libreadline.a libhistory.a
130 libreadline.a: $(OBJECTS)
132 $(AR) $(ARFLAGS) $@ $(OBJECTS)
133 -test -n "$(RANLIB)" && $(RANLIB) $@
135 libhistory.a: $(HISTOBJ) xmalloc.o xfree.o
137 $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o xfree.o
138 -test -n "$(RANLIB)" && $(RANLIB) $@
141 test -d doc || mkdir doc
142 -( cd doc && $(MAKE) $(BASH_MAKEFLAGS) )
144 # Since tilde.c is shared between readline and bash, make sure we compile
145 # it with the right flags when it's built as part of readline
148 $(CC) $(CCFLAGS) -DREADLINE_LIBRARY -c $(srcdir)/tilde.c
153 @echo "This version of the readline library should not be installed."
156 @echo "This version of the readline library should not be installed."
159 $(ETAGS) $(CSOURCES) $(HSOURCES)
162 $(CTAGS) $(CSOURCES) $(HSOURCES)
164 .PHONY: clean maintainer-clean distclean mostlyclean
168 -( cd doc && $(MAKE) $(BASH_MAKEFLAGS) $@ )
171 -( cd doc && $(MAKE) $(BASH_MAKEFLAGS) $@ )
173 distclean maintainer-clean: clean
174 -( cd doc && $(MAKE) $(BASH_MAKEFLAGS) $@ )
179 bind.o: ansi_stdlib.h posixstat.h
180 bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
181 bind.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
182 bind.o: history.h rlstdc.h
183 callback.o: rlconf.h ansi_stdlib.h
184 callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
185 callback.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
186 compat.o: ${BUILD_DIR}/config.h
187 compat.o: rlstdc.h rltypedefs.h
188 complete.o: ansi_stdlib.h posixdir.h posixstat.h
189 complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
190 complete.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
192 display.o: ansi_stdlib.h posixstat.h
193 display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
195 display.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
196 display.o: history.h rlstdc.h
197 funmap.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
198 funmap.o: rlconf.h ansi_stdlib.h rlstdc.h
199 funmap.o: ${BUILD_DIR}/config.h
200 histexpand.o: ansi_stdlib.h
201 histexpand.o: history.h histlib.h rlstdc.h
202 histexpand.o: ${BUILD_DIR}/config.h
203 histfile.o: ansi_stdlib.h
204 histfile.o: history.h histlib.h rlstdc.h
205 histfile.o: ${BUILD_DIR}/config.h
206 history.o: ansi_stdlib.h
207 history.o: history.h histlib.h rlstdc.h
208 history.o: ${BUILD_DIR}/config.h
209 histsearch.o: ansi_stdlib.h
210 histsearch.o: history.h histlib.h rlstdc.h
211 histsearch.o: ${BUILD_DIR}/config.h
212 input.o: ansi_stdlib.h
213 input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
214 input.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
215 isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
216 isearch.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
217 isearch.o: ansi_stdlib.h history.h rlstdc.h
218 keymaps.o: emacs_keymap.c vi_keymap.c
219 keymaps.o: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
220 keymaps.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
221 keymaps.o: ${BUILD_DIR}/config.h rlstdc.h
222 kill.o: ansi_stdlib.h
223 kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
224 kill.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
225 kill.o: history.h rlstdc.h
226 macro.o: ansi_stdlib.h
227 macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
228 macro.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
229 macro.o: history.h rlstdc.h
230 mbutil.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h rlmbutil.h
231 mbutil.o: readline.h keymaps.h rltypedefs.h chardefs.h rlstdc.h
232 misc.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
233 misc.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
234 misc.o: history.h rlstdc.h ansi_stdlib.h
236 nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
237 nls.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
238 nls.o: history.h rlstdc.h
240 parens.o: ${BUILD_DIR}/config.h
241 parens.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
242 readline.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
243 readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
244 readline.o: history.h rlstdc.h
245 readline.o: posixstat.h ansi_stdlib.h posixjmp.h
246 rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
248 rltty.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
249 savestring.o: ${BUILD_DIR}/config.h
250 search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
251 search.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
252 search.o: ansi_stdlib.h history.h rlstdc.h
253 shell.o: ${BUILD_DIR}/config.h ansi_stdlib.h
254 signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
255 signals.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
256 signals.o: history.h rlstdc.h
257 terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
259 terminal.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
260 terminal.o: history.h rlstdc.h
261 text.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
262 text.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
263 text.o: history.h rlstdc.h ansi_stdlib.h
264 rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
265 tilde.o: ansi_stdlib.h
266 tilde.o: ${BUILD_DIR}/config.h
268 undo.o: ansi_stdlib.h
269 undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
270 undo.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
271 undo.o: history.h rlstdc.h xmalloc.h
272 util.o: posixjmp.h ansi_stdlib.h
273 util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
274 util.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
275 vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
276 vi_mode.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
277 vi_mode.o: history.h ansi_stdlib.h rlstdc.h
278 xmalloc.o: ${BUILD_DIR}/config.h ansi_stdlib.h
279 xfree.o: ${BUILD_DIR}/config.h ansi_stdlib.h
281 colors.o: ${BUILD_DIR}/config.h colors.h
282 colors.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
284 colors.o: ansi_stdlib.h posixstat.h
285 parse-colors.o: ${BUILD_DIR}/config.h colors.h parse-colors.h
286 parse-colors.o: rldefs.h rlconf.h
287 parse-colors.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
289 input.o: posixselect.h posixtime.h
290 parens.o: posixselect.h posixtime.h
293 histfile.o: rlshell.h
295 readline.o: rlshell.h
297 terminal.o: rlshell.h
298 histexpand.o: rlshell.h
301 callback.o: rlprivate.h
302 complete.o: rlprivate.h
303 display.o: rlprivate.h
305 isearch.o: rlprivate.h
308 mbutil.o: rlprivate.h
311 parens.o: rlprivate.h
312 readline.o: rlprivate.h
314 search.o: rlprivate.h
315 signals.o: rlprivate.h
316 terminal.o: rlprivate.h
320 vi_mode.o: rlprivate.h
321 colors.o: rlprivate.h
322 parse-colors.o: rlprivate.h
325 complete.o: xmalloc.h
328 histexpand.o: xmalloc.h
329 histfile.o: xmalloc.h
338 readline.o: xmalloc.h
339 savestring.o: xmalloc.h
342 terminal.o: xmalloc.h
351 parse-colors.o: xmalloc.h
353 complete.o: rlmbutil.h
354 display.o: rlmbutil.h
355 histexpand.o: rlmbutil.h
357 isearch.o: rlmbutil.h
360 readline.o: rlmbutil.h
363 vi_mode.o: rlmbutil.h
365 parse-colors.o: rlmbutil.h
367 # Rules for deficient makes, like SunOS and Solaris
369 callback.o: callback.c
371 complete.o: complete.c
376 keymaps.o: keymaps.c emacs_keymap.c vi_keymap.c
383 readline.o: readline.c
385 savestring.o: savestring.c
389 terminal.o: terminal.c
399 parse-colors.o: parse-colors.c
401 histexpand.o: histexpand.c
402 histfile.o: histfile.c
404 histsearch.o: histsearch.c