2 # Master Makefile for the GNU readline library.
3 # Copyright (C) 1994-2004 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
18 RL_LIBRARY_VERSION = @LIBVERSION@
19 RL_LIBRARY_NAME = readline
21 PACKAGE = @PACKAGE_NAME@
22 VERSION = @PACKAGE_VERSION@
24 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
25 PACKAGE_NAME = @PACKAGE_NAME@
26 PACKAGE_STRING = @PACKAGE_STRING@
27 PACKAGE_VERSION = @PACKAGE_VERSION@
31 top_srcdir = @top_srcdir@
32 BUILD_DIR = @BUILD_DIR@
35 INSTALL_PROGRAM = @INSTALL_PROGRAM@
36 INSTALL_DATA = @INSTALL_DATA@
52 exec_prefix = @exec_prefix@
57 includedir = @includedir@
59 localedir = $(datadir)/locale
63 man3dir = $(mandir)/man3
65 # Support an alternate destination root directory for package building
68 # Programs to make tags files.
73 LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
76 DEFS = @DEFS@ @CROSS_COMPILE@
77 LOCAL_DEFS = @LOCAL_DEFS@
79 TERMCAP_LIB = @TERMCAP_LIB@
81 # For libraries which include headers from other libraries.
82 INCLUDES = -I. -I$(srcdir)
84 XCCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES)
85 CCFLAGS = $(XCCFLAGS) $(LOCAL_CFLAGS) $(CFLAGS)
87 # could add -Werror here
88 GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \
89 -Wwrite-strings -Wstrict-prototypes \
90 -Wmissing-prototypes -Wno-implicit -pedantic
91 GCC_LINT_CFLAGS = $(XCCFLAGS) $(GCC_LINT_FLAGS) @CFLAGS@ @LOCAL_CFLAGS@
95 $(CC) -c $(CCFLAGS) $<
97 # The name of the main library target.
98 LIBRARY_NAME = libreadline.a
99 STATIC_LIBS = libreadline.a libhistory.a
101 # The C code source files for this library.
102 CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
103 $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
104 $(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \
105 $(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \
106 $(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \
107 $(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \
108 $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
109 $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
110 $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
111 $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c \
112 $(srcdir)/text.c $(srcdir)/misc.c $(srcdir)/compat.c \
115 # The header files for this library.
116 HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
117 posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
118 ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h \
119 rltypedefs.h rlmbutil.h
121 HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o mbutil.o
123 OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
124 rltty.o complete.o bind.o isearch.o display.o signals.o \
125 util.o kill.o undo.o macro.o input.o callback.o terminal.o \
126 text.o nls.o misc.o compat.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
128 # The texinfo files which document this library.
129 DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
130 DOCOBJECT = doc/readline.dvi
131 DOCSUPPORT = doc/Makefile
132 DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
134 CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile shlib/Makefile
135 CREATED_CONFIGURE = config.status config.h config.cache config.log \
137 CREATED_TAGS = TAGS tags
139 INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
140 rlstdc.h rlconf.h rltypedefs.h
142 ##########################################################################
143 TARGETS = @STATIC_TARGET@ @SHARED_TARGET@
144 INSTALL_TARGETS = @STATIC_INSTALL_TARGET@ @SHARED_INSTALL_TARGET@
148 everything: all examples
150 static: $(STATIC_LIBS)
152 libreadline.a: $(OBJECTS)
154 $(AR) $(ARFLAGS) $@ $(OBJECTS)
155 -test -n "$(RANLIB)" && $(RANLIB) $@
157 libhistory.a: $(HISTOBJ) xmalloc.o
159 $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
160 -test -n "$(RANLIB)" && $(RANLIB) $@
162 # Since tilde.c is shared between readline and bash, make sure we compile
163 # it with the right flags when it's built as part of readline
166 $(CC) $(CCFLAGS) -DREADLINE_LIBRARY -c $(srcdir)/tilde.c
168 readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a
169 $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a ${TERMCAP_LIB}
172 $(MAKE) $(MFLAGS) CCFLAGS='$(GCC_LINT_CFLAGS)' static
174 Makefile makefile: config.status $(srcdir)/Makefile.in
175 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
177 Makefiles makefiles: config.status $(srcdir)/Makefile.in
178 @for mf in $(CREATED_MAKEFILES); do \
179 CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \
182 config.status: configure
183 $(SHELL) ./config.status --recheck
187 stamp-h: config.status $(srcdir)/config.h.in
188 CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
191 #$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution
192 # cd $(srcdir) && autoconf ## Comment-me-out in distribution
196 -test -d shlib || mkdir shlib
197 -( cd shlib ; ${MAKE} ${MFLAGS} all )
200 -test -d doc || mkdir doc
201 -( cd doc && $(MAKE) $(MFLAGS) )
204 -test -d examples || mkdir examples
205 -(cd examples && ${MAKE} ${MFLAGS} all )
209 install-headers: installdirs ${INSTALLED_HEADERS}
210 for f in ${INSTALLED_HEADERS}; do \
211 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/readline ; \
215 -test -n "$(includedir)" && cd $(DESTDIR)$(includedir)/readline && \
216 ${RM} ${INSTALLED_HEADERS}
218 maybe-uninstall-headers: uninstall-headers
220 install: $(INSTALL_TARGETS)
222 install-static: installdirs $(STATIC_LIBS) install-headers install-doc
223 -$(MV) $(DESTDIR)$(libdir)/libreadline.a $(DESTDIR)$(libdir)/libreadline.old
224 $(INSTALL_DATA) libreadline.a $(DESTDIR)$(libdir)/libreadline.a
225 -test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libreadline.a
226 -$(MV) $(DESTDIR)$(libdir)/libhistory.a $(DESTDIR)$(libdir)/libhistory.old
227 $(INSTALL_DATA) libhistory.a $(DESTDIR)$(libdir)/libhistory.a
228 -test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libhistory.a
230 installdirs: $(srcdir)/support/mkinstalldirs
231 -$(SHELL) $(srcdir)/support/mkinstalldirs $(DESTDIR)$(includedir) \
232 $(DESTDIR)$(includedir)/readline $(DESTDIR)$(libdir) \
233 $(DESTDIR)$(infodir) $(DESTDIR)$(man3dir)
235 uninstall: uninstall-headers uninstall-doc
236 -test -n "$(DESTDIR)$(libdir)" && cd $(DESTDIR)$(libdir) && \
237 ${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
238 -( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
240 install-shared: installdirs install-headers shared install-doc
241 -( cd shlib ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
243 uninstall-shared: maybe-uninstall-headers
244 -( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
246 install-doc: installdirs
247 -( if test -d doc ; then \
249 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} install; \
253 -( if test -d doc ; then \
255 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} uninstall; \
259 $(ETAGS) $(CSOURCES) $(HSOURCES)
262 $(CTAGS) $(CSOURCES) $(HSOURCES)
265 $(RM) $(OBJECTS) $(STATIC_LIBS)
266 $(RM) readline readline.exe
267 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
268 -( cd doc && $(MAKE) $(MFLAGS) $@ )
269 -( cd examples && $(MAKE) $(MFLAGS) $@ )
272 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
273 -( cd doc && $(MAKE) $(MFLAGS) $@ )
274 -( cd examples && $(MAKE) $(MFLAGS) $@ )
276 distclean maintainer-clean: clean
277 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
278 -( cd doc && $(MAKE) $(MFLAGS) $@ )
279 -( cd examples && $(MAKE) $(MFLAGS) $@ )
281 $(RM) $(CREATED_CONFIGURE)
282 $(RM) $(CREATED_TAGS)
285 -( cd doc && $(MAKE) $(MFLAGS) $@ )
292 @echo Readline distributions are created using $(srcdir)/support/mkdist.
293 @echo Here is a sample of the necessary commands:
294 @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME) $(RL_LIBRARY_VERSION)
295 @echo tar cf $(RL_LIBRARY_NAME)-${RL_LIBRARY_VERSION}.tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION)
296 @echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar
298 # Tell versions [3.59,3.63) of GNU make not to export all variables.
299 # Otherwise a system limit (for SysV at least) may be exceeded.
303 bind.o: ansi_stdlib.h posixstat.h
304 bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
305 bind.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
308 callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
309 callback.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
311 complete.o: ansi_stdlib.h posixdir.h posixstat.h
312 complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
313 complete.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
314 display.o: ansi_stdlib.h posixstat.h
315 display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
317 display.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
318 display.o: history.h rlstdc.h
319 funmap.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
320 funmap.o: rlconf.h ansi_stdlib.h rlstdc.h
321 funmap.o: ${BUILD_DIR}/config.h
322 histexpand.o: ansi_stdlib.h
323 histexpand.o: history.h histlib.h rlstdc.h rltypedefs.h
324 histexpand.o: ${BUILD_DIR}/config.h
325 histfile.o: ansi_stdlib.h
326 histfile.o: history.h histlib.h rlstdc.h rltypedefs.h
327 histfile.o: ${BUILD_DIR}/config.h
328 history.o: ansi_stdlib.h
329 history.o: history.h histlib.h rlstdc.h rltypedefs.h
330 history.o: ${BUILD_DIR}/config.h
331 histsearch.o: ansi_stdlib.h
332 histsearch.o: history.h histlib.h rlstdc.h rltypedefs.h
333 histsearch.o: ${BUILD_DIR}/config.h
334 input.o: ansi_stdlib.h
335 input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
336 input.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
337 isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
338 isearch.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
339 isearch.o: ansi_stdlib.h history.h rlstdc.h
340 keymaps.o: emacs_keymap.c vi_keymap.c
341 keymaps.o: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
342 keymaps.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
343 keymaps.o: ${BUILD_DIR}/config.h rlstdc.h
344 kill.o: ansi_stdlib.h
345 kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
346 kill.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
347 kill.o: history.h rlstdc.h
348 macro.o: ansi_stdlib.h
349 macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
350 macro.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
351 macro.o: history.h rlstdc.h
352 mbutil.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
353 mbutil.o: readline.h keymaps.h rltypedefs.h chardefs.h rlstdc.h
354 misc.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
355 misc.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
356 misc.o: history.h rlstdc.h ansi_stdlib.h
358 nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
359 nls.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
360 nls.o: history.h rlstdc.h
362 parens.o: ${BUILD_DIR}/config.h
363 parens.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
364 readline.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
365 readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
366 readline.o: history.h rlstdc.h
367 readline.o: posixstat.h ansi_stdlib.h posixjmp.h
368 rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
370 rltty.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
371 search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
372 search.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
373 search.o: ansi_stdlib.h history.h rlstdc.h
374 shell.o: ${BUILD_DIR}/config.h
375 shell.o: ansi_stdlib.h
376 signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
377 signals.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
378 signals.o: history.h rlstdc.h
379 terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
381 terminal.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
382 terminal.o: history.h rlstdc.h
383 text.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
384 text.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
385 text.o: history.h rlstdc.h ansi_stdlib.h
386 tilde.o: ansi_stdlib.h
387 tilde.o: ${BUILD_DIR}/config.h
389 undo.o: ansi_stdlib.h
390 undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
391 undo.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
392 undo.o: history.h rlstdc.h
393 util.o: posixjmp.h ansi_stdlib.h
394 util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
395 util.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
396 vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
397 vi_mode.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
398 vi_mode.o: history.h ansi_stdlib.h rlstdc.h
399 xmalloc.o: ${BUILD_DIR}/config.h
400 xmalloc.o: ansi_stdlib.h
403 histfile.o: rlshell.h
405 readline.o: rlshell.h
407 terminal.o: rlshell.h
408 histexpand.o: rlshell.h
411 callback.o: rlprivate.h
412 complete.o: rlprivate.h
413 display.o: rlprivate.h
415 isearch.o: rlprivate.h
418 mbutil.o: rlprivate.h
421 parens.o: rlprivate.h
422 readline.o: rlprivate.h
424 search.o: rlprivate.h
425 signals.o: rlprivate.h
426 terminal.o: rlprivate.h
430 vi_mode.o: rlprivate.h
433 complete.o: xmalloc.h
436 histexpand.o: xmalloc.h
437 histfile.o: xmalloc.h
446 readline.o: xmalloc.h
447 savestring.o: xmalloc.h
450 terminal.o: xmalloc.h
458 complete.o: rlmbutil.h
459 display.o: rlmbutil.h
460 histexpand.o: rlmbutil.h
462 isearch.o: rlmbutil.h
465 readline.o: rlmbutil.h
468 vi_mode.o: rlmbutil.h
470 bind.o: $(srcdir)/bind.c
471 callback.o: $(srcdir)/callback.c
472 compat.o: $(srcdir)/compat.c
473 complete.o: $(srcdir)/complete.c
474 display.o: $(srcdir)/display.c
475 funmap.o: $(srcdir)/funmap.c
476 input.o: $(srcdir)/input.c
477 isearch.o: $(srcdir)/isearch.c
478 keymaps.o: $(srcdir)/keymaps.c $(srcdir)/emacs_keymap.c $(srcdir)/vi_keymap.c
479 kill.o: $(srcdir)/kill.c
480 macro.o: $(srcdir)/macro.c
481 mbutil.o: $(srcdir)/mbutil.c
482 misc.o: $(srcdir)/misc.c
483 nls.o: $(srcdir)/nls.c
484 parens.o: $(srcdir)/parens.c
485 readline.o: $(srcdir)/readline.c
486 rltty.o: $(srcdir)/rltty.c
487 savestring.o: $(srcdir)/savestring.c
488 search.o: $(srcdir)/search.c
489 shell.o: $(srcdir)/shell.c
490 signals.o: $(srcdir)/signals.c
491 terminal.o: $(srcdir)/terminal.c
492 text.o: $(srcdir)/text.c
493 tilde.o: $(srcdir)/tilde.c
494 undo.o: $(srcdir)/undo.c
495 util.o: $(srcdir)/util.c
496 vi_mode.o: $(srcdir)/vi_mode.c
497 xmalloc.o: $(srcdir)/xmalloc.c
499 histexpand.o: $(srcdir)/histexpand.c
500 histfile.o: $(srcdir)/histfile.c
501 history.o: $(srcdir)/history.c
502 histsearch.o: $(srcdir)/histsearch.c
505 callback.o: callback.c
507 complete.o: complete.c
512 keymaps.o: keymaps.c emacs_keymap.c vi_keymap.c
519 readline.o: readline.c
521 savestring.o: savestring.c
525 terminal.o: terminal.c
533 histexpand.o: histexpand.c
534 histfile.o: histfile.c
536 histsearch.o: histsearch.c