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@
50 exec_prefix = @exec_prefix@
55 includedir = @includedir@
57 localedir = $(datadir)/locale
61 man3dir = $(mandir)/man3
63 # Support an alternate destination root directory for package building
66 # Programs to make tags files.
71 LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
75 LOCAL_DEFS = @LOCAL_DEFS@
77 TERMCAP_LIB = @TERMCAP_LIB@
79 # For libraries which include headers from other libraries.
80 INCLUDES = -I. -I$(srcdir)
82 XCCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES)
83 CCFLAGS = $(XCCFLAGS) $(LOCAL_CFLAGS) $(CFLAGS)
85 # could add -Werror here
86 GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \
87 -Wwrite-strings -Wstrict-prototypes \
88 -Wmissing-prototypes -Wno-implicit -pedantic
89 GCC_LINT_CFLAGS = $(XCCFLAGS) $(GCC_LINT_FLAGS) @CFLAGS@ @LOCAL_CFLAGS@
93 $(CC) -c $(CCFLAGS) $<
95 # The name of the main library target.
96 LIBRARY_NAME = libreadline.a
97 STATIC_LIBS = libreadline.a libhistory.a
99 # The C code source files for this library.
100 CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
101 $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
102 $(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \
103 $(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \
104 $(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \
105 $(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \
106 $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
107 $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
108 $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
109 $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c \
110 $(srcdir)/text.c $(srcdir)/misc.c $(srcdir)/compat.c \
113 # The header files for this library.
114 HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
115 posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
116 ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h \
117 rltypedefs.h rlmbutil.h
119 HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o mbutil.o
121 OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
122 rltty.o complete.o bind.o isearch.o display.o signals.o \
123 util.o kill.o undo.o macro.o input.o callback.o terminal.o \
124 text.o nls.o misc.o compat.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
126 # The texinfo files which document this library.
127 DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
128 DOCOBJECT = doc/readline.dvi
129 DOCSUPPORT = doc/Makefile
130 DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
132 CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile shlib/Makefile
133 CREATED_CONFIGURE = config.status config.h config.cache config.log \
135 CREATED_TAGS = TAGS tags
137 INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
138 rlstdc.h rlconf.h rltypedefs.h
140 ##########################################################################
141 TARGETS = @STATIC_TARGET@ @SHARED_TARGET@
142 INSTALL_TARGETS = @STATIC_INSTALL_TARGET@ @SHARED_INSTALL_TARGET@
146 everything: all examples
148 static: $(STATIC_LIBS)
150 libreadline.a: $(OBJECTS)
152 $(AR) $(ARFLAGS) $@ $(OBJECTS)
153 -test -n "$(RANLIB)" && $(RANLIB) $@
155 libhistory.a: $(HISTOBJ) xmalloc.o
157 $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
158 -test -n "$(RANLIB)" && $(RANLIB) $@
160 # Since tilde.c is shared between readline and bash, make sure we compile
161 # it with the right flags when it's built as part of readline
164 $(CC) $(CCFLAGS) -DREADLINE_LIBRARY -c $(srcdir)/tilde.c
166 readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a
167 $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a ${TERMCAP_LIB}
170 $(MAKE) $(MFLAGS) CCFLAGS='$(GCC_LINT_CFLAGS)' static
172 Makefile makefile: config.status $(srcdir)/Makefile.in
173 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
175 Makefiles makefiles: config.status $(srcdir)/Makefile.in
176 @for mf in $(CREATED_MAKEFILES); do \
177 CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \
180 config.status: configure
181 $(SHELL) ./config.status --recheck
185 stamp-h: config.status $(srcdir)/config.h.in
186 CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
189 #$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution
190 # cd $(srcdir) && autoconf ## Comment-me-out in distribution
194 -test -d shlib || mkdir shlib
195 -( cd shlib ; ${MAKE} ${MFLAGS} all )
198 -test -d doc || mkdir doc
199 -( cd doc && $(MAKE) $(MFLAGS) )
202 -test -d examples || mkdir examples
203 -(cd examples && ${MAKE} ${MFLAGS} all )
207 install-headers: installdirs ${INSTALLED_HEADERS}
208 for f in ${INSTALLED_HEADERS}; do \
209 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/readline ; \
213 -test -n "$(includedir)" && cd $(DESTDIR)$(includedir)/readline && \
214 ${RM} ${INSTALLED_HEADERS}
216 maybe-uninstall-headers: uninstall-headers
218 install: $(INSTALL_TARGETS)
220 install-static: installdirs $(STATIC_LIBS) install-headers install-doc
221 -$(MV) $(DESTDIR)$(libdir)/libreadline.a $(DESTDIR)$(libdir)/libreadline.old
222 $(INSTALL_DATA) libreadline.a $(DESTDIR)$(libdir)/libreadline.a
223 -test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libreadline.a
224 -$(MV) $(DESTDIR)$(libdir)/libhistory.a $(DESTDIR)$(libdir)/libhistory.old
225 $(INSTALL_DATA) libhistory.a $(DESTDIR)$(libdir)/libhistory.a
226 -test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libhistory.a
228 installdirs: $(srcdir)/support/mkinstalldirs
229 -$(SHELL) $(srcdir)/support/mkinstalldirs $(DESTDIR)$(includedir) \
230 $(DESTDIR)$(includedir)/readline $(DESTDIR)$(libdir) \
231 $(DESTDIR)$(infodir) $(DESTDIR)$(man3dir)
233 uninstall: uninstall-headers uninstall-doc
234 -test -n "$(DESTDIR)$(libdir)" && cd $(DESTDIR)$(libdir) && \
235 ${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
236 -( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
238 install-shared: installdirs install-headers shared install-doc
239 -( cd shlib ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
241 uninstall-shared: maybe-uninstall-headers
242 -( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
244 install-doc: installdirs
245 -( if test -d doc ; then \
247 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} install; \
251 -( if test -d doc ; then \
253 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} uninstall; \
257 $(ETAGS) $(CSOURCES) $(HSOURCES)
260 $(CTAGS) $(CSOURCES) $(HSOURCES)
263 $(RM) $(OBJECTS) $(STATIC_LIBS)
264 $(RM) readline readline.exe
265 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
266 -( cd doc && $(MAKE) $(MFLAGS) $@ )
267 -( cd examples && $(MAKE) $(MFLAGS) $@ )
270 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
271 -( cd doc && $(MAKE) $(MFLAGS) $@ )
272 -( cd examples && $(MAKE) $(MFLAGS) $@ )
274 distclean maintainer-clean: clean
275 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
276 -( cd doc && $(MAKE) $(MFLAGS) $@ )
277 -( cd examples && $(MAKE) $(MFLAGS) $@ )
279 $(RM) $(CREATED_CONFIGURE)
280 $(RM) $(CREATED_TAGS)
283 -( cd doc && $(MAKE) $(MFLAGS) $@ )
290 @echo Readline distributions are created using $(srcdir)/support/mkdist.
291 @echo Here is a sample of the necessary commands:
292 @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME) $(RL_LIBRARY_VERSION)
293 @echo tar cf $(RL_LIBRARY_NAME)-${RL_LIBRARY_VERSION}.tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION)
294 @echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar
296 # Tell versions [3.59,3.63) of GNU make not to export all variables.
297 # Otherwise a system limit (for SysV at least) may be exceeded.
301 bind.o: ansi_stdlib.h posixstat.h
302 bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
303 bind.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
306 callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
307 callback.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
309 complete.o: ansi_stdlib.h posixdir.h posixstat.h
310 complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
311 complete.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
312 display.o: ansi_stdlib.h posixstat.h
313 display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
315 display.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
316 display.o: history.h rlstdc.h
317 funmap.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
318 funmap.o: rlconf.h ansi_stdlib.h rlstdc.h
319 funmap.o: ${BUILD_DIR}/config.h
320 histexpand.o: ansi_stdlib.h
321 histexpand.o: history.h histlib.h rlstdc.h rltypedefs.h
322 histexpand.o: ${BUILD_DIR}/config.h
323 histfile.o: ansi_stdlib.h
324 histfile.o: history.h histlib.h rlstdc.h rltypedefs.h
325 histfile.o: ${BUILD_DIR}/config.h
326 history.o: ansi_stdlib.h
327 history.o: history.h histlib.h rlstdc.h rltypedefs.h
328 history.o: ${BUILD_DIR}/config.h
329 histsearch.o: ansi_stdlib.h
330 histsearch.o: history.h histlib.h rlstdc.h rltypedefs.h
331 histsearch.o: ${BUILD_DIR}/config.h
332 input.o: ansi_stdlib.h
333 input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
334 input.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
335 isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
336 isearch.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
337 isearch.o: ansi_stdlib.h history.h rlstdc.h
338 keymaps.o: emacs_keymap.c vi_keymap.c
339 keymaps.o: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
340 keymaps.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
341 keymaps.o: ${BUILD_DIR}/config.h rlstdc.h
342 kill.o: ansi_stdlib.h
343 kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
344 kill.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
345 kill.o: history.h rlstdc.h
346 macro.o: ansi_stdlib.h
347 macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
348 macro.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
349 macro.o: history.h rlstdc.h
350 mbutil.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
351 mbutil.o: readline.h keymaps.h rltypedefs.h chardefs.h rlstdc.h
352 misc.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
353 misc.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
354 misc.o: history.h rlstdc.h ansi_stdlib.h
356 nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
357 nls.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
358 nls.o: history.h rlstdc.h
360 parens.o: ${BUILD_DIR}/config.h
361 parens.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
362 readline.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
363 readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
364 readline.o: history.h rlstdc.h
365 readline.o: posixstat.h ansi_stdlib.h posixjmp.h
366 rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
368 rltty.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
369 search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
370 search.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
371 search.o: ansi_stdlib.h history.h rlstdc.h
372 shell.o: ${BUILD_DIR}/config.h
373 shell.o: ansi_stdlib.h
374 signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
375 signals.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
376 signals.o: history.h rlstdc.h
377 terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
379 terminal.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
380 terminal.o: history.h rlstdc.h
381 text.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
382 text.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
383 text.o: history.h rlstdc.h ansi_stdlib.h
384 tilde.o: ansi_stdlib.h
385 tilde.o: ${BUILD_DIR}/config.h
387 undo.o: ansi_stdlib.h
388 undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
389 undo.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
390 undo.o: history.h rlstdc.h
391 util.o: posixjmp.h ansi_stdlib.h
392 util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
393 util.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
394 vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
395 vi_mode.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
396 vi_mode.o: history.h ansi_stdlib.h rlstdc.h
397 xmalloc.o: ${BUILD_DIR}/config.h
398 xmalloc.o: ansi_stdlib.h
401 histfile.o: rlshell.h
403 readline.o: rlshell.h
405 terminal.o: rlshell.h
406 histexpand.o: rlshell.h
409 callback.o: rlprivate.h
410 complete.o: rlprivate.h
411 display.o: rlprivate.h
413 isearch.o: rlprivate.h
416 mbutil.o: rlprivate.h
419 parens.o: rlprivate.h
420 readline.o: rlprivate.h
422 search.o: rlprivate.h
423 signals.o: rlprivate.h
424 terminal.o: rlprivate.h
428 vi_mode.o: rlprivate.h
431 complete.o: xmalloc.h
434 histexpand.o: xmalloc.h
435 histfile.o: xmalloc.h
444 readline.o: xmalloc.h
445 savestring.o: xmalloc.h
448 terminal.o: xmalloc.h
456 complete.o: rlmbutil.h
457 display.o: rlmbutil.h
458 histexpand.o: rlmbutil.h
460 isearch.o: rlmbutil.h
463 readline.o: rlmbutil.h
466 vi_mode.o: rlmbutil.h
468 bind.o: $(srcdir)/bind.c
469 callback.o: $(srcdir)/callback.c
470 compat.o: $(srcdir)/compat.c
471 complete.o: $(srcdir)/complete.c
472 display.o: $(srcdir)/display.c
473 funmap.o: $(srcdir)/funmap.c
474 input.o: $(srcdir)/input.c
475 isearch.o: $(srcdir)/isearch.c
476 keymaps.o: $(srcdir)/keymaps.c $(srcdir)/emacs_keymap.c $(srcdir)/vi_keymap.c
477 kill.o: $(srcdir)/kill.c
478 macro.o: $(srcdir)/macro.c
479 mbutil.o: $(srcdir)/mbutil.c
480 misc.o: $(srcdir)/misc.c
481 nls.o: $(srcdir)/nls.c
482 parens.o: $(srcdir)/parens.c
483 readline.o: $(srcdir)/readline.c
484 rltty.o: $(srcdir)/rltty.c
485 savestring.o: $(srcdir)/savestring.c
486 search.o: $(srcdir)/search.c
487 shell.o: $(srcdir)/shell.c
488 signals.o: $(srcdir)/signals.c
489 terminal.o: $(srcdir)/terminal.c
490 text.o: $(srcdir)/text.c
491 tilde.o: $(srcdir)/tilde.c
492 undo.o: $(srcdir)/undo.c
493 util.o: $(srcdir)/util.c
494 vi_mode.o: $(srcdir)/vi_mode.c
495 xmalloc.o: $(srcdir)/xmalloc.c
497 histexpand.o: $(srcdir)/histexpand.c
498 histfile.o: $(srcdir)/histfile.c
499 history.o: $(srcdir)/history.c
500 histsearch.o: $(srcdir)/histsearch.c
503 callback.o: callback.c
505 complete.o: complete.c
510 keymaps.o: keymaps.c emacs_keymap.c vi_keymap.c
517 readline.o: readline.c
519 savestring.o: savestring.c
523 terminal.o: terminal.c
531 histexpand.o: histexpand.c
532 histfile.o: histfile.c
534 histsearch.o: histsearch.c