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 WCWIDTH_OBJ
= @WCWIDTH_OBJ@
103 # The C code source files for this library.
104 CSOURCES
= $(srcdir)/readline.c
$(srcdir)/funmap.c
$(srcdir)/keymaps.c \
105 $(srcdir)/vi_mode.c
$(srcdir)/parens.c
$(srcdir)/rltty.c \
106 $(srcdir)/complete.c
$(srcdir)/bind.c
$(srcdir)/isearch.c \
107 $(srcdir)/display.c
$(srcdir)/signals.c
$(srcdir)/emacs_keymap.c \
108 $(srcdir)/vi_keymap.c
$(srcdir)/util.c
$(srcdir)/kill.c \
109 $(srcdir)/undo.c
$(srcdir)/macro.c
$(srcdir)/input.c \
110 $(srcdir)/callback.c
$(srcdir)/terminal.c
$(srcdir)/xmalloc.c \
111 $(srcdir)/history.c
$(srcdir)/histsearch.c
$(srcdir)/histexpand.c \
112 $(srcdir)/histfile.c
$(srcdir)/nls.c
$(srcdir)/search.c \
113 $(srcdir)/shell.c
$(srcdir)/savestring.c
$(srcdir)/tilde.c \
114 $(srcdir)/text.c
$(srcdir)/misc.c
$(srcdir)/compat.c \
115 $(srcdir)/mbutil.c
$(srcdir)/support
/wcwidth.c
117 # The header files for this library.
118 HSOURCES
= readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
119 posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
120 ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h \
121 rltypedefs.h rlmbutil.h
123 HISTOBJ
= history.o histexpand.o histfile.o histsearch.o
shell.o mbutil.o
125 OBJECTS
= readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
126 rltty.o complete.o bind.o isearch.o display.o signals.o \
127 util.o kill.o undo.o macro.o input.o callback.o terminal.o \
128 text.o nls.o misc.o compat.o xmalloc.o
$(HISTOBJ
) $(TILDEOBJ
) \
131 # The texinfo files which document this library.
132 DOCSOURCE
= doc
/rlman.texinfo doc
/rltech.texinfo doc
/rluser.texinfo
133 DOCOBJECT
= doc
/readline.
dvi
134 DOCSUPPORT
= doc
/Makefile
135 DOCUMENTATION
= $(DOCSOURCE
) $(DOCOBJECT
) $(DOCSUPPORT
)
137 CREATED_MAKEFILES
= Makefile doc
/Makefile examples
/Makefile shlib
/Makefile
138 CREATED_CONFIGURE
= config.status config.h config.cache config.log \
140 CREATED_TAGS
= TAGS
tags
142 INSTALLED_HEADERS
= readline.h chardefs.h keymaps.h history.h tilde.h \
143 rlstdc.h rlconf.h rltypedefs.h
145 ##########################################################################
146 TARGETS
= @STATIC_TARGET@ @SHARED_TARGET@
147 INSTALL_TARGETS
= @STATIC_INSTALL_TARGET@ @SHARED_INSTALL_TARGET@
151 everything
: all examples
153 static
: $(STATIC_LIBS
)
155 libreadline.a
: $(OBJECTS
)
157 $(AR
) $(ARFLAGS
) $@
$(OBJECTS
)
158 -test -n
"$(RANLIB)" && $(RANLIB
) $@
160 libhistory.a
: $(HISTOBJ
) xmalloc.o
162 $(AR
) $(ARFLAGS
) $@
$(HISTOBJ
) xmalloc.o
163 -test -n
"$(RANLIB)" && $(RANLIB
) $@
165 wcwidth.o
: $(srcdir)/support
/wcwidth.c
167 $(CC
) $(CCFLAGS
) -c
$(srcdir)/support
/wcwidth.c
169 # Since tilde.c is shared between readline and bash, make sure we compile
170 # it with the right flags when it's built as part of readline
173 $(CC
) $(CCFLAGS
) -DREADLINE_LIBRARY
-c
$(srcdir)/tilde.c
175 readline
: $(OBJECTS
) readline.h rldefs.h chardefs.h .
/libreadline.a
176 $(CC
) $(CCFLAGS
) -o
$@ .
/examples
/rl.c .
/libreadline.a
${TERMCAP_LIB}
179 $(MAKE
) $(MFLAGS
) CCFLAGS
='$(GCC_LINT_CFLAGS)' static
181 Makefile makefile
: config.status
$(srcdir)/Makefile.in
182 CONFIG_FILES
=Makefile CONFIG_HEADERS
= $(SHELL
) .
/config.status
184 Makefiles makefiles
: config.status
$(srcdir)/Makefile.in
185 @for mf in
$(CREATED_MAKEFILES
); do \
186 CONFIG_FILES
=$$mf CONFIG_HEADERS
= $(SHELL
) .
/config.status
; \
189 config.status
: configure
190 $(SHELL
) .
/config.status
--recheck
194 stamp-h
: config.status
$(srcdir)/config.h.in
195 CONFIG_FILES
= CONFIG_HEADERS
=config.h .
/config.status
198 #$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution
199 # cd $(srcdir) && autoconf ## Comment-me-out in distribution
202 -test -d shlib || mkdir shlib
203 -( cd shlib
; ${MAKE} ${MFLAGS} all )
206 -test -d doc || mkdir doc
207 -( cd doc
&& $(MAKE
) $(MFLAGS
) )
210 -test -d examples || mkdir examples
211 -(cd examples
&& ${MAKE} ${MFLAGS} all )
215 install-headers
: installdirs ${INSTALLED_HEADERS}
216 for f in
${INSTALLED_HEADERS}; do \
217 $(INSTALL_DATA
) $(srcdir)/$$f $(DESTDIR
)$(includedir)/readline
; \
221 -test -n
"$(includedir)" && cd
$(DESTDIR
)$(includedir)/readline
&& \
222 ${RM} ${INSTALLED_HEADERS}
224 maybe-uninstall-headers
: uninstall-headers
227 ## Don't mess with people's installed readline's.
228 ## This tries to install this version of readline over whatever
229 ## version is already installed on the system (which could be a
230 ## newer version). There is no real reason for us to install
231 ## readline along with GDB. GDB links statically against readline,
232 ## so it doesn't depend on us installing it on the system.
236 #install: $(INSTALL_TARGETS)
238 install-static
: installdirs $(STATIC_LIBS
) install-headers install-doc
239 -$(MV
) $(DESTDIR
)$(libdir)/libreadline.a
$(DESTDIR
)$(libdir)/libreadline.old
240 $(INSTALL_DATA
) libreadline.a
$(DESTDIR
)$(libdir)/libreadline.a
241 -test -n
"$(RANLIB)" && $(RANLIB
) $(DESTDIR
)$(libdir)/libreadline.a
242 -$(MV
) $(DESTDIR
)$(libdir)/libhistory.a
$(DESTDIR
)$(libdir)/libhistory.old
243 $(INSTALL_DATA
) libhistory.a
$(DESTDIR
)$(libdir)/libhistory.a
244 -test -n
"$(RANLIB)" && $(RANLIB
) $(DESTDIR
)$(libdir)/libhistory.a
246 installdirs: $(srcdir)/support
/mkinstalldirs
247 -$(SHELL
) $(srcdir)/support
/mkinstalldirs
$(DESTDIR
)$(includedir) \
248 $(DESTDIR
)$(includedir)/readline
$(DESTDIR
)$(libdir) \
249 $(DESTDIR
)$(infodir) $(DESTDIR
)$(man3dir)
251 uninstall: uninstall-headers uninstall-doc
252 -test -n
"$(DESTDIR)$(libdir)" && cd
$(DESTDIR
)$(libdir) && \
253 ${RM} libreadline.a libreadline.old libhistory.a libhistory.old
$(SHARED_LIBS
)
254 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} uninstall )
256 install-shared
: installdirs install-headers shared install-doc
257 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} install )
259 uninstall-shared
: maybe-uninstall-headers
260 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} uninstall )
262 install-doc
: installdirs
263 -( if
test -d doc
; then \
265 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR
=${DESTDIR} install; \
269 -( if
test -d doc
; then \
271 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR
=${DESTDIR} uninstall; \
275 $(ETAGS
) $(CSOURCES
) $(HSOURCES
)
278 $(CTAGS
) $(CSOURCES
) $(HSOURCES
)
281 $(RM
) $(OBJECTS
) $(STATIC_LIBS
)
282 $(RM
) readline readline.exe
283 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
284 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
285 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
288 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
289 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
290 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
292 distclean maintainer-clean
: clean
293 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
294 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
295 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
297 $(RM
) $(CREATED_CONFIGURE
)
298 $(RM
) $(CREATED_TAGS
)
301 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
308 @echo Readline distributions are created using
$(srcdir)/support
/mkdist.
309 @echo Here is a sample of the necessary commands
:
310 @echo bash
$(srcdir)/support
/mkdist
-m
$(srcdir)/MANIFEST
-s
$(srcdir) -r
$(RL_LIBRARY_NAME
) $(RL_LIBRARY_VERSION
)
311 @echo
tar cf
$(RL_LIBRARY_NAME
)-${RL_LIBRARY_VERSION}.
tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION
)
312 @echo gzip
$(RL_LIBRARY_NAME
)-$(RL_LIBRARY_VERSION
).
tar
314 # Tell versions [3.59,3.63) of GNU make not to export all variables.
315 # Otherwise a system limit (for SysV at least) may be exceeded.
319 bind.o
: ansi_stdlib.h posixstat.h
320 bind.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
321 bind.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
324 callback.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
325 callback.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
327 complete.o
: ansi_stdlib.h posixdir.h posixstat.h
328 complete.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
329 complete.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
330 display.o
: ansi_stdlib.h posixstat.h
331 display.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
333 display.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
334 display.o
: history.h rlstdc.h
335 funmap.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
336 funmap.o
: rlconf.h ansi_stdlib.h rlstdc.h
337 funmap.o
: ${BUILD_DIR}/config.h
338 histexpand.o
: ansi_stdlib.h
339 histexpand.o
: history.h histlib.h rlstdc.h rltypedefs.h
340 histexpand.o
: ${BUILD_DIR}/config.h
341 histfile.o
: ansi_stdlib.h
342 histfile.o
: history.h histlib.h rlstdc.h rltypedefs.h
343 histfile.o
: ${BUILD_DIR}/config.h
344 history.o
: ansi_stdlib.h
345 history.o
: history.h histlib.h rlstdc.h rltypedefs.h
346 history.o
: ${BUILD_DIR}/config.h
347 histsearch.o
: ansi_stdlib.h
348 histsearch.o
: history.h histlib.h rlstdc.h rltypedefs.h
349 histsearch.o
: ${BUILD_DIR}/config.h
350 input.o
: ansi_stdlib.h
351 input.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
352 input.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
353 isearch.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
354 isearch.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
355 isearch.o
: ansi_stdlib.h history.h rlstdc.h
356 keymaps.o
: emacs_keymap.c vi_keymap.c
357 keymaps.o
: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
358 keymaps.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
359 keymaps.o
: ${BUILD_DIR}/config.h rlstdc.h
360 kill.o
: ansi_stdlib.h
361 kill.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
362 kill.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
363 kill.o
: history.h rlstdc.h
364 macro.o
: ansi_stdlib.h
365 macro.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
366 macro.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
367 macro.o
: history.h rlstdc.h
368 mbutil.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
369 mbutil.o
: readline.h keymaps.h rltypedefs.h chardefs.h rlstdc.h
370 misc.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
371 misc.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
372 misc.o
: history.h rlstdc.h ansi_stdlib.h
374 nls.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
375 nls.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
376 nls.o
: history.h rlstdc.h
378 parens.o
: ${BUILD_DIR}/config.h
379 parens.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
380 readline.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
381 readline.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
382 readline.o
: history.h rlstdc.h
383 readline.o
: posixstat.h ansi_stdlib.h posixjmp.h
384 rltty.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
386 rltty.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
387 search.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
388 search.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
389 search.o
: ansi_stdlib.h history.h rlstdc.h
390 shell.o
: ${BUILD_DIR}/config.h
391 shell.o
: ansi_stdlib.h
392 signals.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
393 signals.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
394 signals.o
: history.h rlstdc.h
395 terminal.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
397 terminal.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
398 terminal.o
: history.h rlstdc.h
399 text.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
400 text.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
401 text.o
: history.h rlstdc.h ansi_stdlib.h
402 tilde.o
: ansi_stdlib.h
403 tilde.o
: ${BUILD_DIR}/config.h
405 undo.o
: ansi_stdlib.h
406 undo.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
407 undo.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
408 undo.o
: history.h rlstdc.h
409 util.o
: posixjmp.h ansi_stdlib.h
410 util.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
411 util.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
412 vi_mode.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
413 vi_mode.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
414 vi_mode.o
: history.h ansi_stdlib.h rlstdc.h
415 xmalloc.o
: ${BUILD_DIR}/config.h
416 xmalloc.o
: ansi_stdlib.h
419 histfile.o
: rlshell.h
421 readline.o
: rlshell.h
423 terminal.o
: rlshell.h
424 histexpand.o
: rlshell.h
427 callback.o
: rlprivate.h
428 complete.o
: rlprivate.h
429 display.o
: rlprivate.h
431 isearch.o
: rlprivate.h
434 mbutil.o
: rlprivate.h
437 parens.o
: rlprivate.h
438 readline.o
: rlprivate.h
440 search.o
: rlprivate.h
441 signals.o
: rlprivate.h
442 terminal.o
: rlprivate.h
446 vi_mode.o
: rlprivate.h
449 complete.o
: xmalloc.h
452 histexpand.o
: xmalloc.h
453 histfile.o
: xmalloc.h
462 readline.o
: xmalloc.h
463 savestring.o
: xmalloc.h
466 terminal.o
: xmalloc.h
474 complete.o
: rlmbutil.h
475 display.o
: rlmbutil.h
476 histexpand.o
: rlmbutil.h
478 isearch.o
: rlmbutil.h
481 readline.o
: rlmbutil.h
484 vi_mode.o
: rlmbutil.h
486 bind.o
: $(srcdir)/bind.c
487 callback.o
: $(srcdir)/callback.c
488 compat.o
: $(srcdir)/compat.c
489 complete.o
: $(srcdir)/complete.c
490 display.o
: $(srcdir)/display.c
491 funmap.o
: $(srcdir)/funmap.c
492 input.o
: $(srcdir)/input.c
493 isearch.o
: $(srcdir)/isearch.c
494 keymaps.o
: $(srcdir)/keymaps.c
$(srcdir)/emacs_keymap.c
$(srcdir)/vi_keymap.c
495 kill.o
: $(srcdir)/kill.c
496 macro.o
: $(srcdir)/macro.c
497 mbutil.o
: $(srcdir)/mbutil.c
498 misc.o
: $(srcdir)/misc.c
499 nls.o
: $(srcdir)/nls.c
500 parens.o
: $(srcdir)/parens.c
501 readline.o
: $(srcdir)/readline.c
502 rltty.o
: $(srcdir)/rltty.c
503 savestring.o
: $(srcdir)/savestring.c
504 search.o
: $(srcdir)/search.c
505 shell.o
: $(srcdir)/shell.c
506 signals.o
: $(srcdir)/signals.c
507 terminal.o
: $(srcdir)/terminal.c
508 text.o
: $(srcdir)/text.c
509 tilde.o
: $(srcdir)/tilde.c
510 undo.o
: $(srcdir)/undo.c
511 util.o
: $(srcdir)/util.c
512 vi_mode.o
: $(srcdir)/vi_mode.c
513 xmalloc.o
: $(srcdir)/xmalloc.c
515 histexpand.o
: $(srcdir)/histexpand.c
516 histfile.o
: $(srcdir)/histfile.c
517 history.o
: $(srcdir)/history.c
518 histsearch.o
: $(srcdir)/histsearch.c
521 callback.o
: callback.c
523 complete.o
: complete.c
528 keymaps.o
: keymaps.c emacs_keymap.c vi_keymap.c
535 readline.o
: readline.c
537 savestring.o
: savestring.c
541 terminal.o
: terminal.c
549 histexpand.o
: histexpand.c
550 histfile.o
: histfile.c
552 histsearch.o
: histsearch.c