2 # Master Makefile for the GNU readline library.
3 # Copyright (C) 1994, 1998 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
23 top_srcdir
= @top_srcdir@
24 BUILD_DIR
= @BUILD_DIR@
27 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
28 INSTALL_DATA
= @INSTALL_DATA@
42 exec_prefix = @
exec_prefix@
47 includedir = @
includedir@
51 man3dir = $(mandir)/man3
53 # Support an alternate destination root directory for package building
56 # Programs to make tags files.
61 LOCAL_CFLAGS
= @LOCAL_CFLAGS@
-DRL_LIBRARY_VERSION
='"$(RL_LIBRARY_VERSION)"'
65 LOCAL_DEFS
= @LOCAL_DEFS@
67 TERMCAP_LIB
= @TERMCAP_LIB@
69 # For libraries which include headers from other libraries.
70 INCLUDES
= -I.
-I
$(srcdir)
72 XCCFLAGS
= $(DEFS
) $(LOCAL_DEFS
) $(CPPFLAGS
) $(INCLUDES
)
73 CCFLAGS
= $(XCCFLAGS
) $(LOCAL_CFLAGS
) $(CFLAGS
)
75 # could add -Werror here
76 GCC_LINT_FLAGS
= -ansi
-Wall
-Wshadow
-Wpointer-arith
-Wcast-qual \
77 -Wwrite-strings
-Wstrict-prototypes \
78 -Wmissing-prototypes
-Wno-implicit
-pedantic
79 GCC_LINT_CFLAGS
= $(XCCFLAGS
) $(GCC_LINT_FLAGS
) @CFLAGS@ @LOCAL_CFLAGS@
83 $(CC
) -c
$(CCFLAGS
) $<
85 # The name of the main library target.
86 LIBRARY_NAME
= libreadline.a
87 STATIC_LIBS
= libreadline.a libhistory.a
89 # The C code source files for this library.
90 CSOURCES
= $(srcdir)/readline.c
$(srcdir)/funmap.c
$(srcdir)/keymaps.c \
91 $(srcdir)/vi_mode.c
$(srcdir)/parens.c
$(srcdir)/rltty.c \
92 $(srcdir)/complete.c
$(srcdir)/bind.c
$(srcdir)/isearch.c \
93 $(srcdir)/display.c
$(srcdir)/signals.c
$(srcdir)/emacs_keymap.c \
94 $(srcdir)/vi_keymap.c
$(srcdir)/util.c
$(srcdir)/kill.c \
95 $(srcdir)/undo.c
$(srcdir)/macro.c
$(srcdir)/input.c \
96 $(srcdir)/callback.c
$(srcdir)/terminal.c
$(srcdir)/xmalloc.c \
97 $(srcdir)/history.c
$(srcdir)/histsearch.c
$(srcdir)/histexpand.c \
98 $(srcdir)/histfile.c
$(srcdir)/nls.c
$(srcdir)/search.c \
99 $(srcdir)/shell.c
$(srcdir)/savestring.c
$(srcdir)/tilde.c \
100 $(srcdir)/text.c
$(srcdir)/misc.c
$(srcdir)/compat.c \
103 # The header files for this library.
104 HSOURCES
= readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
105 posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
106 ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h \
107 rltypedefs.h rlmbutil.h
109 HISTOBJ
= history.o histexpand.o histfile.o histsearch.o
shell.o mbutil.o
111 OBJECTS
= readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
112 rltty.o complete.o bind.o isearch.o display.o signals.o \
113 util.o kill.o undo.o macro.o input.o callback.o terminal.o \
114 text.o nls.o misc.o compat.o xmalloc.o
$(HISTOBJ
) $(TILDEOBJ
)
116 # The texinfo files which document this library.
117 DOCSOURCE
= doc
/rlman.texinfo doc
/rltech.texinfo doc
/rluser.texinfo
118 DOCOBJECT
= doc
/readline.
dvi
119 DOCSUPPORT
= doc
/Makefile
120 DOCUMENTATION
= $(DOCSOURCE
) $(DOCOBJECT
) $(DOCSUPPORT
)
122 CREATED_MAKEFILES
= Makefile doc
/Makefile examples
/Makefile shlib
/Makefile
123 CREATED_CONFIGURE
= config.status config.h config.cache config.log \
125 CREATED_TAGS
= TAGS
tags
127 INSTALLED_HEADERS
= readline.h chardefs.h keymaps.h history.h tilde.h \
128 rlstdc.h rlconf.h rltypedefs.h
130 ##########################################################################
131 TARGETS
= @STATIC_TARGET@ @SHARED_TARGET@
132 INSTALL_TARGETS
= @STATIC_INSTALL_TARGET@ @SHARED_INSTALL_TARGET@
136 everything
: all examples
138 static
: $(STATIC_LIBS
)
140 libreadline.a
: $(OBJECTS
)
142 $(AR
) $(ARFLAGS
) $@
$(OBJECTS
)
143 -test -n
"$(RANLIB)" && $(RANLIB
) $@
145 libhistory.a
: $(HISTOBJ
) xmalloc.o
147 $(AR
) $(ARFLAGS
) $@
$(HISTOBJ
) xmalloc.o
148 -test -n
"$(RANLIB)" && $(RANLIB
) $@
150 # Since tilde.c is shared between readline and bash, make sure we compile
151 # it with the right flags when it's built as part of readline
154 $(CC
) $(CCFLAGS
) -DREADLINE_LIBRARY
-c
$(srcdir)/tilde.c
156 readline
: $(OBJECTS
) readline.h rldefs.h chardefs.h .
/libreadline.a
157 $(CC
) $(CCFLAGS
) -o
$@ .
/examples
/rl.c .
/libreadline.a
${TERMCAP_LIB}
160 $(MAKE
) $(MFLAGS
) CCFLAGS
='$(GCC_LINT_CFLAGS)' static
162 Makefile makefile
: config.status
$(srcdir)/Makefile.in
163 CONFIG_FILES
=Makefile CONFIG_HEADERS
= $(SHELL
) .
/config.status
165 Makefiles makefiles
: config.status
$(srcdir)/Makefile.in
166 @for mf in
$(CREATED_MAKEFILES
); do \
167 CONFIG_FILES
=$$mf CONFIG_HEADERS
= $(SHELL
) .
/config.status
; \
170 config.status
: configure
171 $(SHELL
) .
/config.status
--recheck
175 stamp-h
: config.status
$(srcdir)/config.h.in
176 CONFIG_FILES
= CONFIG_HEADERS
=config.h .
/config.status
179 #$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution
180 # cd $(srcdir) && autoconf ## Comment-me-out in distribution
183 -test -d shlib || mkdir shlib
184 -( cd shlib
; ${MAKE} ${MFLAGS} all )
187 -test -d doc || mkdir doc
188 -( cd doc
&& $(MAKE
) $(MFLAGS
) )
191 -test -d examples || mkdir examples
192 -(cd examples
&& ${MAKE} ${MFLAGS} all )
196 install-headers
: installdirs ${INSTALLED_HEADERS}
197 for f in
${INSTALLED_HEADERS}; do \
198 $(INSTALL_DATA
) $(srcdir)/$$f $(DESTDIR
)$(includedir)/readline
; \
202 -test -n
"$(includedir)" && cd
$(DESTDIR
)$(includedir)/readline
&& \
203 ${RM} ${INSTALLED_HEADERS}
205 maybe-uninstall-headers
: uninstall-headers
208 ## Don't mess with people's installed readline's.
209 ## This tries to install this version of readline over whatever
210 ## version is already installed on the system (which could be a
211 ## newer version). There is no real reason for us to install
212 ## readline along with GDB. GDB links statically against readline,
213 ## so it doesn't depend on us installing it on the system.
217 #install: $(INSTALL_TARGETS)
219 install-static
: installdirs $(STATIC_LIBS
) install-headers
220 -$(MV
) $(DESTDIR
)$(libdir)/libreadline.a
$(DESTDIR
)$(libdir)/libreadline.old
221 $(INSTALL_DATA
) libreadline.a
$(DESTDIR
)$(libdir)/libreadline.a
222 -test -n
"$(RANLIB)" && $(RANLIB
) $(DESTDIR
)$(libdir)/libreadline.a
223 -$(MV
) $(DESTDIR
)$(libdir)/libhistory.a
$(DESTDIR
)$(libdir)/libhistory.old
224 $(INSTALL_DATA
) libhistory.a
$(DESTDIR
)$(libdir)/libhistory.a
225 -test -n
"$(RANLIB)" && $(RANLIB
) $(DESTDIR
)$(libdir)/libhistory.a
226 -( if
test -d doc
; then \
228 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR
=${DESTDIR} install; \
231 installdirs: $(srcdir)/support
/mkdirs
232 -$(SHELL
) $(srcdir)/support
/mkdirs
$(DESTDIR
)$(includedir) \
233 $(DESTDIR
)$(includedir)/readline
$(DESTDIR
)$(libdir) \
234 $(DESTDIR
)$(infodir) $(DESTDIR
)$(man3dir)
236 uninstall: uninstall-headers
237 -test -n
"$(DESTDIR)$(libdir)" && cd
$(DESTDIR
)$(libdir) && \
238 ${RM} libreadline.a libreadline.old libhistory.a libhistory.old
$(SHARED_LIBS
)
239 -( if
test -d doc
; then \
241 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR
=${DESTDIR} $@
; \
243 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} uninstall )
245 install-shared
: installdirs install-headers shared
246 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} install )
248 uninstall-shared
: maybe-uninstall-headers
249 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} uninstall )
252 $(ETAGS
) $(CSOURCES
) $(HSOURCES
)
255 $(CTAGS
) $(CSOURCES
) $(HSOURCES
)
258 $(RM
) $(OBJECTS
) $(STATIC_LIBS
)
259 $(RM
) readline readline.exe
260 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
261 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
262 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
265 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
266 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
267 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
269 distclean maintainer-clean
: clean
270 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
271 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
272 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
274 $(RM
) $(CREATED_CONFIGURE
)
275 $(RM
) $(CREATED_TAGS
)
278 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
285 @echo Readline distributions are created using
$(srcdir)/support
/mkdist.
286 @echo Here is a sample of the necessary commands
:
287 @echo bash
$(srcdir)/support
/mkdist
-m
$(srcdir)/MANIFEST
-s
$(srcdir) -r
$(RL_LIBRARY_NAME
) $(RL_LIBRARY_VERSION
)
288 @echo
tar cf
$(RL_LIBRARY_NAME
)-${RL_LIBRARY_VERSION}.
tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION
)
289 @echo gzip
$(RL_LIBRARY_NAME
)-$(RL_LIBRARY_VERSION
).
tar
291 # Tell versions [3.59,3.63) of GNU make not to export all variables.
292 # Otherwise a system limit (for SysV at least) may be exceeded.
296 bind.o
: ansi_stdlib.h posixstat.h
297 bind.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
298 bind.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
301 callback.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
302 callback.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
304 complete.o
: ansi_stdlib.h posixdir.h posixstat.h
305 complete.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
306 complete.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
307 display.o
: ansi_stdlib.h posixstat.h
308 display.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
310 display.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
311 display.o
: history.h rlstdc.h
312 funmap.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
313 funmap.o
: rlconf.h ansi_stdlib.h rlstdc.h
314 funmap.o
: ${BUILD_DIR}/config.h
315 histexpand.o
: ansi_stdlib.h
316 histexpand.o
: history.h histlib.h rlstdc.h rltypedefs.h
317 histexpand.o
: ${BUILD_DIR}/config.h
318 histfile.o
: ansi_stdlib.h
319 histfile.o
: history.h histlib.h rlstdc.h rltypedefs.h
320 histfile.o
: ${BUILD_DIR}/config.h
321 history.o
: ansi_stdlib.h
322 history.o
: history.h histlib.h rlstdc.h rltypedefs.h
323 history.o
: ${BUILD_DIR}/config.h
324 histsearch.o
: ansi_stdlib.h
325 histsearch.o
: history.h histlib.h rlstdc.h rltypedefs.h
326 histsearch.o
: ${BUILD_DIR}/config.h
327 input.o
: ansi_stdlib.h
328 input.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
329 input.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
330 isearch.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
331 isearch.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
332 isearch.o
: ansi_stdlib.h history.h rlstdc.h
333 keymaps.o
: emacs_keymap.c vi_keymap.c
334 keymaps.o
: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
335 keymaps.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
336 keymaps.o
: ${BUILD_DIR}/config.h rlstdc.h
337 kill.o
: ansi_stdlib.h
338 kill.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
339 kill.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
340 kill.o
: history.h rlstdc.h
341 macro.o
: ansi_stdlib.h
342 macro.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
343 macro.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
344 macro.o
: history.h rlstdc.h
345 mbutil.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
346 mbutil.o
: readline.h keymaps.h rltypedefs.h chardefs.h rlstdc.h
347 misc.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
348 misc.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
349 misc.o
: history.h rlstdc.h ansi_stdlib.h
351 nls.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
352 nls.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
353 nls.o
: history.h rlstdc.h
355 parens.o
: ${BUILD_DIR}/config.h
356 parens.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
357 readline.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
358 readline.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
359 readline.o
: history.h rlstdc.h
360 readline.o
: posixstat.h ansi_stdlib.h posixjmp.h
361 rltty.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
363 rltty.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
364 search.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
365 search.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
366 search.o
: ansi_stdlib.h history.h rlstdc.h
367 shell.o
: ${BUILD_DIR}/config.h
368 shell.o
: ansi_stdlib.h
369 signals.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
370 signals.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
371 signals.o
: history.h rlstdc.h
372 terminal.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
374 terminal.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
375 terminal.o
: history.h rlstdc.h
376 text.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
377 text.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
378 text.o
: history.h rlstdc.h ansi_stdlib.h
379 tilde.o
: ansi_stdlib.h
380 tilde.o
: ${BUILD_DIR}/config.h
382 undo.o
: ansi_stdlib.h
383 undo.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
384 undo.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
385 undo.o
: history.h rlstdc.h
386 util.o
: posixjmp.h ansi_stdlib.h
387 util.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
388 util.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
389 vi_mode.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
390 vi_mode.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
391 vi_mode.o
: history.h ansi_stdlib.h rlstdc.h
392 xmalloc.o
: ${BUILD_DIR}/config.h
393 xmalloc.o
: ansi_stdlib.h
396 histfile.o
: rlshell.h
398 readline.o
: rlshell.h
400 terminal.o
: rlshell.h
401 histexpand.o
: rlshell.h
404 callback.o
: rlprivate.h
405 complete.o
: rlprivate.h
406 display.o
: rlprivate.h
408 isearch.o
: rlprivate.h
411 mbutil.o
: rlprivate.h
414 parens.o
: rlprivate.h
415 readline.o
: rlprivate.h
417 search.o
: rlprivate.h
418 signals.o
: rlprivate.h
419 terminal.o
: rlprivate.h
423 vi_mode.o
: rlprivate.h
426 complete.o
: xmalloc.h
429 histexpand.o
: xmalloc.h
430 histfile.o
: xmalloc.h
439 readline.o
: xmalloc.h
440 savestring.o
: xmalloc.h
443 terminal.o
: xmalloc.h
451 complete.o
: rlmbutil.h
452 display.o
: rlmbutil.h
453 histexpand.o
: rlmbutil.h
455 isearch.o
: rlmbutil.h
458 readline.o
: rlmbutil.h
461 vi_mode.o
: rlmbutil.h
463 bind.o
: $(srcdir)/bind.c
464 callback.o
: $(srcdir)/callback.c
465 compat.o
: $(srcdir)/compat.c
466 complete.o
: $(srcdir)/complete.c
467 display.o
: $(srcdir)/display.c
468 funmap.o
: $(srcdir)/funmap.c
469 input.o
: $(srcdir)/input.c
470 isearch.o
: $(srcdir)/isearch.c
471 keymaps.o
: $(srcdir)/keymaps.c
$(srcdir)/emacs_keymap.c
$(srcdir)/vi_keymap.c
472 kill.o
: $(srcdir)/kill.c
473 macro.o
: $(srcdir)/macro.c
474 mbutil.o
: $(srcdir)/mbutil.c
475 misc.o
: $(srcdir)/misc.c
476 nls.o
: $(srcdir)/nls.c
477 parens.o
: $(srcdir)/parens.c
478 readline.o
: $(srcdir)/readline.c
479 rltty.o
: $(srcdir)/rltty.c
480 savestring.o
: $(srcdir)/savestring.c
481 search.o
: $(srcdir)/search.c
482 shell.o
: $(srcdir)/shell.c
483 signals.o
: $(srcdir)/signals.c
484 terminal.o
: $(srcdir)/terminal.c
485 text.o
: $(srcdir)/text.c
486 tilde.o
: $(srcdir)/tilde.c
487 undo.o
: $(srcdir)/undo.c
488 util.o
: $(srcdir)/util.c
489 vi_mode.o
: $(srcdir)/vi_mode.c
490 xmalloc.o
: $(srcdir)/xmalloc.c
492 histexpand.o
: $(srcdir)/histexpand.c
493 histfile.o
: $(srcdir)/histfile.c
494 history.o
: $(srcdir)/history.c
495 histsearch.o
: $(srcdir)/histsearch.c
498 callback.o
: callback.c
500 complete.o
: complete.c
505 keymaps.o
: keymaps.c emacs_keymap.c vi_keymap.c
512 readline.o
: readline.c
514 savestring.o
: savestring.c
518 terminal.o
: terminal.c
526 histexpand.o
: histexpand.c
527 histfile.o
: histfile.c
529 histsearch.o
: histsearch.c