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
) $@
)
310 @echo Readline distributions are created using
$(srcdir)/support
/mkdist.
311 @echo Here is a sample of the necessary commands
:
312 @echo bash
$(srcdir)/support
/mkdist
-m
$(srcdir)/MANIFEST
-s
$(srcdir) -r
$(RL_LIBRARY_NAME
) $(RL_LIBRARY_VERSION
)
313 @echo
tar cf
$(RL_LIBRARY_NAME
)-${RL_LIBRARY_VERSION}.
tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION
)
314 @echo gzip
$(RL_LIBRARY_NAME
)-$(RL_LIBRARY_VERSION
).
tar
316 # Tell versions [3.59,3.63) of GNU make not to export all variables.
317 # Otherwise a system limit (for SysV at least) may be exceeded.
321 bind.o
: ansi_stdlib.h posixstat.h
322 bind.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
323 bind.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
326 callback.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
327 callback.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
329 complete.o
: ansi_stdlib.h posixdir.h posixstat.h
330 complete.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
331 complete.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
332 display.o
: ansi_stdlib.h posixstat.h
333 display.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
335 display.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
336 display.o
: history.h rlstdc.h
337 funmap.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
338 funmap.o
: rlconf.h ansi_stdlib.h rlstdc.h
339 funmap.o
: ${BUILD_DIR}/config.h
340 histexpand.o
: ansi_stdlib.h
341 histexpand.o
: history.h histlib.h rlstdc.h rltypedefs.h
342 histexpand.o
: ${BUILD_DIR}/config.h
343 histfile.o
: ansi_stdlib.h
344 histfile.o
: history.h histlib.h rlstdc.h rltypedefs.h
345 histfile.o
: ${BUILD_DIR}/config.h
346 history.o
: ansi_stdlib.h
347 history.o
: history.h histlib.h rlstdc.h rltypedefs.h
348 history.o
: ${BUILD_DIR}/config.h
349 histsearch.o
: ansi_stdlib.h
350 histsearch.o
: history.h histlib.h rlstdc.h rltypedefs.h
351 histsearch.o
: ${BUILD_DIR}/config.h
352 input.o
: ansi_stdlib.h
353 input.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
354 input.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
355 isearch.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
356 isearch.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
357 isearch.o
: ansi_stdlib.h history.h rlstdc.h
358 keymaps.o
: emacs_keymap.c vi_keymap.c
359 keymaps.o
: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
360 keymaps.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
361 keymaps.o
: ${BUILD_DIR}/config.h rlstdc.h
362 kill.o
: ansi_stdlib.h
363 kill.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
364 kill.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
365 kill.o
: history.h rlstdc.h
366 macro.o
: ansi_stdlib.h
367 macro.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
368 macro.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
369 macro.o
: history.h rlstdc.h
370 mbutil.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
371 mbutil.o
: readline.h keymaps.h rltypedefs.h chardefs.h rlstdc.h
372 misc.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
373 misc.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
374 misc.o
: history.h rlstdc.h ansi_stdlib.h
376 nls.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
377 nls.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
378 nls.o
: history.h rlstdc.h
380 parens.o
: ${BUILD_DIR}/config.h
381 parens.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
382 readline.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
383 readline.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
384 readline.o
: history.h rlstdc.h
385 readline.o
: posixstat.h ansi_stdlib.h posixjmp.h
386 rltty.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
388 rltty.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
389 search.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
390 search.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
391 search.o
: ansi_stdlib.h history.h rlstdc.h
392 shell.o
: ${BUILD_DIR}/config.h
393 shell.o
: ansi_stdlib.h
394 signals.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
395 signals.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
396 signals.o
: history.h rlstdc.h
397 terminal.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
399 terminal.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
400 terminal.o
: history.h rlstdc.h
401 text.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
402 text.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
403 text.o
: history.h rlstdc.h ansi_stdlib.h
404 tilde.o
: ansi_stdlib.h
405 tilde.o
: ${BUILD_DIR}/config.h
407 undo.o
: ansi_stdlib.h
408 undo.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
409 undo.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
410 undo.o
: history.h rlstdc.h
411 util.o
: posixjmp.h ansi_stdlib.h
412 util.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
413 util.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
414 vi_mode.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
415 vi_mode.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
416 vi_mode.o
: history.h ansi_stdlib.h rlstdc.h
417 xmalloc.o
: ${BUILD_DIR}/config.h
418 xmalloc.o
: ansi_stdlib.h
421 histfile.o
: rlshell.h
423 readline.o
: rlshell.h
425 terminal.o
: rlshell.h
426 histexpand.o
: rlshell.h
429 callback.o
: rlprivate.h
430 complete.o
: rlprivate.h
431 display.o
: rlprivate.h
433 isearch.o
: rlprivate.h
436 mbutil.o
: rlprivate.h
439 parens.o
: rlprivate.h
440 readline.o
: rlprivate.h
442 search.o
: rlprivate.h
443 signals.o
: rlprivate.h
444 terminal.o
: rlprivate.h
448 vi_mode.o
: rlprivate.h
451 callback.o
: xmalloc.h
452 complete.o
: xmalloc.h
455 histexpand.o
: xmalloc.h
456 histfile.o
: xmalloc.h
465 readline.o
: xmalloc.h
466 savestring.o
: xmalloc.h
469 terminal.o
: xmalloc.h
477 complete.o
: rlmbutil.h
478 display.o
: rlmbutil.h
479 histexpand.o
: rlmbutil.h
481 isearch.o
: rlmbutil.h
484 readline.o
: rlmbutil.h
487 vi_mode.o
: rlmbutil.h
489 bind.o
: $(srcdir)/bind.c
490 callback.o
: $(srcdir)/callback.c
491 compat.o
: $(srcdir)/compat.c
492 complete.o
: $(srcdir)/complete.c
493 display.o
: $(srcdir)/display.c
494 funmap.o
: $(srcdir)/funmap.c
495 input.o
: $(srcdir)/input.c
496 isearch.o
: $(srcdir)/isearch.c
497 keymaps.o
: $(srcdir)/keymaps.c
$(srcdir)/emacs_keymap.c
$(srcdir)/vi_keymap.c
498 kill.o
: $(srcdir)/kill.c
499 macro.o
: $(srcdir)/macro.c
500 mbutil.o
: $(srcdir)/mbutil.c
501 misc.o
: $(srcdir)/misc.c
502 nls.o
: $(srcdir)/nls.c
503 parens.o
: $(srcdir)/parens.c
504 readline.o
: $(srcdir)/readline.c
505 rltty.o
: $(srcdir)/rltty.c
506 savestring.o
: $(srcdir)/savestring.c
507 search.o
: $(srcdir)/search.c
508 shell.o
: $(srcdir)/shell.c
509 signals.o
: $(srcdir)/signals.c
510 terminal.o
: $(srcdir)/terminal.c
511 text.o
: $(srcdir)/text.c
512 tilde.o
: $(srcdir)/tilde.c
513 undo.o
: $(srcdir)/undo.c
514 util.o
: $(srcdir)/util.c
515 vi_mode.o
: $(srcdir)/vi_mode.c
516 xmalloc.o
: $(srcdir)/xmalloc.c
518 histexpand.o
: $(srcdir)/histexpand.c
519 histfile.o
: $(srcdir)/histfile.c
520 history.o
: $(srcdir)/history.c
521 histsearch.o
: $(srcdir)/histsearch.c
524 callback.o
: callback.c
526 complete.o
: complete.c
531 keymaps.o
: keymaps.c emacs_keymap.c vi_keymap.c
538 readline.o
: readline.c
540 savestring.o
: savestring.c
544 terminal.o
: terminal.c
552 histexpand.o
: histexpand.c
553 histfile.o
: histfile.c
555 histsearch.o
: histsearch.c