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@
54 datarootdir
= @datarootdir@
59 includedir = @
includedir@
61 localedir
= $(datadir)/locale
65 man3dir = $(mandir)/man3
67 # Support an alternate destination root directory for package building
70 # Programs to make tags files.
75 LOCAL_CFLAGS
= @LOCAL_CFLAGS@
-DRL_LIBRARY_VERSION
='"$(RL_LIBRARY_VERSION)"'
78 DEFS
= @DEFS@ @CROSS_COMPILE@
79 LOCAL_DEFS
= @LOCAL_DEFS@
81 TERMCAP_LIB
= @TERMCAP_LIB@
83 # For libraries which include headers from other libraries.
84 INCLUDES
= -I.
-I
$(srcdir)
86 XCCFLAGS
= $(DEFS
) $(LOCAL_DEFS
) $(CPPFLAGS
) $(INCLUDES
)
87 CCFLAGS
= $(XCCFLAGS
) $(LOCAL_CFLAGS
) $(CFLAGS
)
89 # could add -Werror here
90 GCC_LINT_FLAGS
= -ansi
-Wall
-Wshadow
-Wpointer-arith
-Wcast-qual \
91 -Wwrite-strings
-Wstrict-prototypes \
92 -Wmissing-prototypes
-Wno-implicit
-pedantic
93 GCC_LINT_CFLAGS
= $(XCCFLAGS
) $(GCC_LINT_FLAGS
) @CFLAGS@ @LOCAL_CFLAGS@
97 $(CC
) -c
$(CCFLAGS
) $<
99 # The name of the main library target.
100 LIBRARY_NAME
= libreadline.a
101 STATIC_LIBS
= libreadline.a libhistory.a
103 WCWIDTH_OBJ
= @WCWIDTH_OBJ@
105 # The C code source files for this library.
106 CSOURCES
= $(srcdir)/readline.c
$(srcdir)/funmap.c
$(srcdir)/keymaps.c \
107 $(srcdir)/vi_mode.c
$(srcdir)/parens.c
$(srcdir)/rltty.c \
108 $(srcdir)/complete.c
$(srcdir)/bind.c
$(srcdir)/isearch.c \
109 $(srcdir)/display.c
$(srcdir)/signals.c
$(srcdir)/emacs_keymap.c \
110 $(srcdir)/vi_keymap.c
$(srcdir)/util.c
$(srcdir)/kill.c \
111 $(srcdir)/undo.c
$(srcdir)/macro.c
$(srcdir)/input.c \
112 $(srcdir)/callback.c
$(srcdir)/terminal.c
$(srcdir)/xmalloc.c \
113 $(srcdir)/history.c
$(srcdir)/histsearch.c
$(srcdir)/histexpand.c \
114 $(srcdir)/histfile.c
$(srcdir)/nls.c
$(srcdir)/search.c \
115 $(srcdir)/shell.c
$(srcdir)/savestring.c
$(srcdir)/tilde.c \
116 $(srcdir)/text.c
$(srcdir)/misc.c
$(srcdir)/compat.c \
117 $(srcdir)/mbutil.c
$(srcdir)/support
/wcwidth.c
119 # The header files for this library.
120 HSOURCES
= readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
121 posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
122 ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h \
123 rltypedefs.h rlmbutil.h
125 HISTOBJ
= history.o histexpand.o histfile.o histsearch.o
shell.o mbutil.o
127 OBJECTS
= readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
128 rltty.o complete.o bind.o isearch.o display.o signals.o \
129 util.o kill.o undo.o macro.o input.o callback.o terminal.o \
130 text.o nls.o misc.o compat.o xmalloc.o
$(HISTOBJ
) $(TILDEOBJ
) \
133 # The texinfo files which document this library.
134 DOCSOURCE
= doc
/rlman.texinfo doc
/rltech.texinfo doc
/rluser.texinfo
135 DOCOBJECT
= doc
/readline.
dvi
136 DOCSUPPORT
= doc
/Makefile
137 DOCUMENTATION
= $(DOCSOURCE
) $(DOCOBJECT
) $(DOCSUPPORT
)
139 CREATED_MAKEFILES
= Makefile doc
/Makefile examples
/Makefile shlib
/Makefile
140 CREATED_CONFIGURE
= config.status config.h config.cache config.log \
142 CREATED_TAGS
= TAGS
tags
144 INSTALLED_HEADERS
= readline.h chardefs.h keymaps.h history.h tilde.h \
145 rlstdc.h rlconf.h rltypedefs.h
147 ##########################################################################
148 TARGETS
= @STATIC_TARGET@ @SHARED_TARGET@
149 INSTALL_TARGETS
= @STATIC_INSTALL_TARGET@ @SHARED_INSTALL_TARGET@
153 everything
: all examples
155 static
: $(STATIC_LIBS
)
157 libreadline.a
: $(OBJECTS
)
159 $(AR
) $(ARFLAGS
) $@
$(OBJECTS
)
160 -test -n
"$(RANLIB)" && $(RANLIB
) $@
162 libhistory.a
: $(HISTOBJ
) xmalloc.o
164 $(AR
) $(ARFLAGS
) $@
$(HISTOBJ
) xmalloc.o
165 -test -n
"$(RANLIB)" && $(RANLIB
) $@
167 wcwidth.o
: $(srcdir)/support
/wcwidth.c
169 $(CC
) $(CCFLAGS
) -c
$(srcdir)/support
/wcwidth.c
171 # Since tilde.c is shared between readline and bash, make sure we compile
172 # it with the right flags when it's built as part of readline
175 $(CC
) $(CCFLAGS
) -DREADLINE_LIBRARY
-c
$(srcdir)/tilde.c
177 readline
: $(OBJECTS
) readline.h rldefs.h chardefs.h .
/libreadline.a
178 $(CC
) $(CCFLAGS
) -o
$@ .
/examples
/rl.c .
/libreadline.a
${TERMCAP_LIB}
181 $(MAKE
) $(MFLAGS
) CCFLAGS
='$(GCC_LINT_CFLAGS)' static
183 Makefile makefile
: config.status
$(srcdir)/Makefile.in
184 CONFIG_FILES
=Makefile CONFIG_HEADERS
= $(SHELL
) .
/config.status
186 Makefiles makefiles
: config.status
$(srcdir)/Makefile.in
187 @for mf in
$(CREATED_MAKEFILES
); do \
188 CONFIG_FILES
=$$mf CONFIG_HEADERS
= $(SHELL
) .
/config.status
; \
191 config.status
: configure
192 $(SHELL
) .
/config.status
--recheck
196 stamp-h
: config.status
$(srcdir)/config.h.in
197 CONFIG_FILES
= CONFIG_HEADERS
=config.h .
/config.status
200 #$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution
201 # cd $(srcdir) && autoconf ## Comment-me-out in distribution
204 -test -d shlib || mkdir shlib
205 -( cd shlib
; ${MAKE} ${MFLAGS} all )
208 -test -d doc || mkdir doc
209 -( cd doc
&& $(MAKE
) $(MFLAGS
) )
212 -test -d examples || mkdir examples
213 -(cd examples
&& ${MAKE} ${MFLAGS} all )
217 install-headers
: installdirs ${INSTALLED_HEADERS}
218 for f in
${INSTALLED_HEADERS}; do \
219 $(INSTALL_DATA
) $(srcdir)/$$f $(DESTDIR
)$(includedir)/readline
; \
223 -test -n
"$(includedir)" && cd
$(DESTDIR
)$(includedir)/readline
&& \
224 ${RM} ${INSTALLED_HEADERS}
226 maybe-uninstall-headers
: uninstall-headers
229 ## Don't mess with people's installed readline's.
230 ## This tries to install this version of readline over whatever
231 ## version is already installed on the system (which could be a
232 ## newer version). There is no real reason for us to install
233 ## readline along with GDB. GDB links statically against readline,
234 ## so it doesn't depend on us installing it on the system.
238 #install: $(INSTALL_TARGETS)
240 install-static
: installdirs $(STATIC_LIBS
) install-headers install-doc
241 -$(MV
) $(DESTDIR
)$(libdir)/libreadline.a
$(DESTDIR
)$(libdir)/libreadline.old
242 $(INSTALL_DATA
) libreadline.a
$(DESTDIR
)$(libdir)/libreadline.a
243 -test -n
"$(RANLIB)" && $(RANLIB
) $(DESTDIR
)$(libdir)/libreadline.a
244 -$(MV
) $(DESTDIR
)$(libdir)/libhistory.a
$(DESTDIR
)$(libdir)/libhistory.old
245 $(INSTALL_DATA
) libhistory.a
$(DESTDIR
)$(libdir)/libhistory.a
246 -test -n
"$(RANLIB)" && $(RANLIB
) $(DESTDIR
)$(libdir)/libhistory.a
248 installdirs: $(srcdir)/support
/mkinstalldirs
249 -$(SHELL
) $(srcdir)/support
/mkinstalldirs
$(DESTDIR
)$(includedir) \
250 $(DESTDIR
)$(includedir)/readline
$(DESTDIR
)$(libdir) \
251 $(DESTDIR
)$(infodir) $(DESTDIR
)$(man3dir)
253 uninstall: uninstall-headers uninstall-doc
254 -test -n
"$(DESTDIR)$(libdir)" && cd
$(DESTDIR
)$(libdir) && \
255 ${RM} libreadline.a libreadline.old libhistory.a libhistory.old
$(SHARED_LIBS
)
256 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} uninstall )
258 install-shared
: installdirs install-headers shared install-doc
259 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} install )
261 uninstall-shared
: maybe-uninstall-headers
262 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} uninstall )
264 install-doc
: installdirs
265 -( if
test -d doc
; then \
267 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR
=${DESTDIR} install; \
271 -( if
test -d doc
; then \
273 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR
=${DESTDIR} uninstall; \
277 $(ETAGS
) $(CSOURCES
) $(HSOURCES
)
280 $(CTAGS
) $(CSOURCES
) $(HSOURCES
)
283 $(RM
) $(OBJECTS
) $(STATIC_LIBS
)
284 $(RM
) readline readline.exe
285 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
286 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
287 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
290 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
291 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
292 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
294 distclean maintainer-clean
: clean
295 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
296 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
297 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
299 $(RM
) $(CREATED_CONFIGURE
)
300 $(RM
) $(CREATED_TAGS
)
303 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
312 @echo Readline distributions are created using
$(srcdir)/support
/mkdist.
313 @echo Here is a sample of the necessary commands
:
314 @echo bash
$(srcdir)/support
/mkdist
-m
$(srcdir)/MANIFEST
-s
$(srcdir) -r
$(RL_LIBRARY_NAME
) $(RL_LIBRARY_VERSION
)
315 @echo
tar cf
$(RL_LIBRARY_NAME
)-${RL_LIBRARY_VERSION}.
tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION
)
316 @echo gzip
$(RL_LIBRARY_NAME
)-$(RL_LIBRARY_VERSION
).
tar
318 # Tell versions [3.59,3.63) of GNU make not to export all variables.
319 # Otherwise a system limit (for SysV at least) may be exceeded.
323 bind.o
: ansi_stdlib.h posixstat.h
324 bind.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
325 bind.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
328 callback.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
329 callback.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
331 complete.o
: ansi_stdlib.h posixdir.h posixstat.h
332 complete.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
333 complete.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
334 display.o
: ansi_stdlib.h posixstat.h
335 display.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
337 display.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
338 display.o
: history.h rlstdc.h
339 funmap.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
340 funmap.o
: rlconf.h ansi_stdlib.h rlstdc.h
341 funmap.o
: ${BUILD_DIR}/config.h
342 histexpand.o
: ansi_stdlib.h
343 histexpand.o
: history.h histlib.h rlstdc.h rltypedefs.h
344 histexpand.o
: ${BUILD_DIR}/config.h
345 histfile.o
: ansi_stdlib.h
346 histfile.o
: history.h histlib.h rlstdc.h rltypedefs.h
347 histfile.o
: ${BUILD_DIR}/config.h
348 history.o
: ansi_stdlib.h
349 history.o
: history.h histlib.h rlstdc.h rltypedefs.h
350 history.o
: ${BUILD_DIR}/config.h
351 histsearch.o
: ansi_stdlib.h
352 histsearch.o
: history.h histlib.h rlstdc.h rltypedefs.h
353 histsearch.o
: ${BUILD_DIR}/config.h
354 input.o
: ansi_stdlib.h
355 input.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
356 input.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
357 isearch.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
358 isearch.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
359 isearch.o
: ansi_stdlib.h history.h rlstdc.h
360 keymaps.o
: emacs_keymap.c vi_keymap.c
361 keymaps.o
: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
362 keymaps.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
363 keymaps.o
: ${BUILD_DIR}/config.h rlstdc.h
364 kill.o
: ansi_stdlib.h
365 kill.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
366 kill.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
367 kill.o
: history.h rlstdc.h
368 macro.o
: ansi_stdlib.h
369 macro.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
370 macro.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
371 macro.o
: history.h rlstdc.h
372 mbutil.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
373 mbutil.o
: readline.h keymaps.h rltypedefs.h chardefs.h rlstdc.h
374 misc.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
375 misc.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
376 misc.o
: history.h rlstdc.h ansi_stdlib.h
378 nls.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
379 nls.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
380 nls.o
: history.h rlstdc.h
382 parens.o
: ${BUILD_DIR}/config.h
383 parens.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
384 readline.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
385 readline.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
386 readline.o
: history.h rlstdc.h
387 readline.o
: posixstat.h ansi_stdlib.h posixjmp.h
388 rltty.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
390 rltty.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
391 search.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
392 search.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
393 search.o
: ansi_stdlib.h history.h rlstdc.h
394 shell.o
: ${BUILD_DIR}/config.h
395 shell.o
: ansi_stdlib.h
396 signals.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
397 signals.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
398 signals.o
: history.h rlstdc.h
399 terminal.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
401 terminal.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
402 terminal.o
: history.h rlstdc.h
403 text.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
404 text.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
405 text.o
: history.h rlstdc.h ansi_stdlib.h
406 tilde.o
: ansi_stdlib.h
407 tilde.o
: ${BUILD_DIR}/config.h
409 undo.o
: ansi_stdlib.h
410 undo.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
411 undo.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
412 undo.o
: history.h rlstdc.h
413 util.o
: posixjmp.h ansi_stdlib.h
414 util.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
415 util.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
416 vi_mode.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
417 vi_mode.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
418 vi_mode.o
: history.h ansi_stdlib.h rlstdc.h
419 xmalloc.o
: ${BUILD_DIR}/config.h
420 xmalloc.o
: ansi_stdlib.h
423 histfile.o
: rlshell.h
425 readline.o
: rlshell.h
427 terminal.o
: rlshell.h
428 histexpand.o
: rlshell.h
431 callback.o
: rlprivate.h
432 complete.o
: rlprivate.h
433 display.o
: rlprivate.h
435 isearch.o
: rlprivate.h
438 mbutil.o
: rlprivate.h
441 parens.o
: rlprivate.h
442 readline.o
: rlprivate.h
444 search.o
: rlprivate.h
445 signals.o
: rlprivate.h
446 terminal.o
: rlprivate.h
450 vi_mode.o
: rlprivate.h
453 callback.o
: xmalloc.h
454 complete.o
: xmalloc.h
457 histexpand.o
: xmalloc.h
458 histfile.o
: xmalloc.h
467 readline.o
: xmalloc.h
468 savestring.o
: xmalloc.h
471 terminal.o
: xmalloc.h
479 complete.o
: rlmbutil.h
480 display.o
: rlmbutil.h
481 histexpand.o
: rlmbutil.h
483 isearch.o
: rlmbutil.h
486 readline.o
: rlmbutil.h
489 vi_mode.o
: rlmbutil.h
491 bind.o
: $(srcdir)/bind.c
492 callback.o
: $(srcdir)/callback.c
493 compat.o
: $(srcdir)/compat.c
494 complete.o
: $(srcdir)/complete.c
495 display.o
: $(srcdir)/display.c
496 funmap.o
: $(srcdir)/funmap.c
497 input.o
: $(srcdir)/input.c
498 isearch.o
: $(srcdir)/isearch.c
499 keymaps.o
: $(srcdir)/keymaps.c
$(srcdir)/emacs_keymap.c
$(srcdir)/vi_keymap.c
500 kill.o
: $(srcdir)/kill.c
501 macro.o
: $(srcdir)/macro.c
502 mbutil.o
: $(srcdir)/mbutil.c
503 misc.o
: $(srcdir)/misc.c
504 nls.o
: $(srcdir)/nls.c
505 parens.o
: $(srcdir)/parens.c
506 readline.o
: $(srcdir)/readline.c
507 rltty.o
: $(srcdir)/rltty.c
508 savestring.o
: $(srcdir)/savestring.c
509 search.o
: $(srcdir)/search.c
510 shell.o
: $(srcdir)/shell.c
511 signals.o
: $(srcdir)/signals.c
512 terminal.o
: $(srcdir)/terminal.c
513 text.o
: $(srcdir)/text.c
514 tilde.o
: $(srcdir)/tilde.c
515 undo.o
: $(srcdir)/undo.c
516 util.o
: $(srcdir)/util.c
517 vi_mode.o
: $(srcdir)/vi_mode.c
518 xmalloc.o
: $(srcdir)/xmalloc.c
520 histexpand.o
: $(srcdir)/histexpand.c
521 histfile.o
: $(srcdir)/histfile.c
522 history.o
: $(srcdir)/history.c
523 histsearch.o
: $(srcdir)/histsearch.c
526 callback.o
: callback.c
528 complete.o
: complete.c
533 keymaps.o
: keymaps.c emacs_keymap.c vi_keymap.c
540 readline.o
: readline.c
542 savestring.o
: savestring.c
546 terminal.o
: terminal.c
554 histexpand.o
: histexpand.c
555 histfile.o
: histfile.c
557 histsearch.o
: histsearch.c