2 # Master Makefile for the GNU readline library.
3 # Copyright (C) 1994 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
184 -test -d shlib || mkdir shlib
185 -( cd shlib
; ${MAKE} ${MFLAGS} all )
188 -test -d doc || mkdir doc
189 -( cd doc
&& $(MAKE
) $(MFLAGS
) )
192 -test -d examples || mkdir examples
193 -(cd examples
&& ${MAKE} ${MFLAGS} all )
197 install-headers
: installdirs ${INSTALLED_HEADERS}
198 for f in
${INSTALLED_HEADERS}; do \
199 $(INSTALL_DATA
) $(srcdir)/$$f $(DESTDIR
)$(includedir)/readline
; \
203 -test -n
"$(includedir)" && cd
$(DESTDIR
)$(includedir)/readline
&& \
204 ${RM} ${INSTALLED_HEADERS}
206 maybe-uninstall-headers
: uninstall-headers
208 install: $(INSTALL_TARGETS
)
210 install-static
: installdirs $(STATIC_LIBS
) install-headers
211 -$(MV
) $(DESTDIR
)$(libdir)/libreadline.a
$(DESTDIR
)$(libdir)/libreadline.old
212 $(INSTALL_DATA
) libreadline.a
$(DESTDIR
)$(libdir)/libreadline.a
213 -test -n
"$(RANLIB)" && $(RANLIB
) $(DESTDIR
)$(libdir)/libreadline.a
214 -$(MV
) $(DESTDIR
)$(libdir)/libhistory.a
$(DESTDIR
)$(libdir)/libhistory.old
215 $(INSTALL_DATA
) libhistory.a
$(DESTDIR
)$(libdir)/libhistory.a
216 -test -n
"$(RANLIB)" && $(RANLIB
) $(DESTDIR
)$(libdir)/libhistory.a
217 -( if
test -d doc
; then \
219 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR
=${DESTDIR} install; \
222 installdirs: $(srcdir)/support
/mkdirs
223 -$(SHELL
) $(srcdir)/support
/mkdirs
$(DESTDIR
)$(includedir) \
224 $(DESTDIR
)$(includedir)/readline
$(DESTDIR
)$(libdir) \
225 $(DESTDIR
)$(infodir) $(DESTDIR
)$(man3dir)
227 uninstall: uninstall-headers
228 -test -n
"$(DESTDIR)$(libdir)" && cd
$(DESTDIR
)$(libdir) && \
229 ${RM} libreadline.a libreadline.old libhistory.a libhistory.old
$(SHARED_LIBS
)
230 -( if
test -d doc
; then \
232 ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR
=${DESTDIR} $@
; \
234 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} uninstall )
236 install-shared
: installdirs install-headers shared
237 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} install )
239 uninstall-shared
: maybe-uninstall-headers
240 -( cd shlib
; ${MAKE} ${MFLAGS} DESTDIR
=${DESTDIR} uninstall )
243 $(ETAGS
) $(CSOURCES
) $(HSOURCES
)
246 $(CTAGS
) $(CSOURCES
) $(HSOURCES
)
249 $(RM
) $(OBJECTS
) $(STATIC_LIBS
)
250 $(RM
) readline readline.exe
251 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
252 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
253 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
256 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
257 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
258 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
260 distclean maintainer-clean
: clean
261 -( cd shlib
&& $(MAKE
) $(MFLAGS
) $@
)
262 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
263 -( cd examples
&& $(MAKE
) $(MFLAGS
) $@
)
265 $(RM
) $(CREATED_CONFIGURE
)
266 $(RM
) $(CREATED_TAGS
)
269 -( cd doc
&& $(MAKE
) $(MFLAGS
) $@
)
276 @echo Readline distributions are created using
$(srcdir)/support
/mkdist.
277 @echo Here is a sample of the necessary commands
:
278 @echo bash
$(srcdir)/support
/mkdist
-m
$(srcdir)/MANIFEST
-s
$(srcdir) -r
$(RL_LIBRARY_NAME
) $(RL_LIBRARY_VERSION
)
279 @echo
tar cf
$(RL_LIBRARY_NAME
)-${RL_LIBRARY_VERSION}.
tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION
)
280 @echo gzip
$(RL_LIBRARY_NAME
)-$(RL_LIBRARY_VERSION
).
tar
282 # Tell versions [3.59,3.63) of GNU make not to export all variables.
283 # Otherwise a system limit (for SysV at least) may be exceeded.
287 bind.o
: ansi_stdlib.h posixstat.h
288 bind.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
289 bind.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
292 callback.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
293 callback.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
295 complete.o
: ansi_stdlib.h posixdir.h posixstat.h
296 complete.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
297 complete.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
298 display.o
: ansi_stdlib.h posixstat.h
299 display.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
301 display.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
302 display.o
: history.h rlstdc.h
303 funmap.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
304 funmap.o
: rlconf.h ansi_stdlib.h rlstdc.h
305 funmap.o
: ${BUILD_DIR}/config.h
306 histexpand.o
: ansi_stdlib.h
307 histexpand.o
: history.h histlib.h rlstdc.h rltypedefs.h
308 histexpand.o
: ${BUILD_DIR}/config.h
309 histfile.o
: ansi_stdlib.h
310 histfile.o
: history.h histlib.h rlstdc.h rltypedefs.h
311 histfile.o
: ${BUILD_DIR}/config.h
312 history.o
: ansi_stdlib.h
313 history.o
: history.h histlib.h rlstdc.h rltypedefs.h
314 history.o
: ${BUILD_DIR}/config.h
315 histsearch.o
: ansi_stdlib.h
316 histsearch.o
: history.h histlib.h rlstdc.h rltypedefs.h
317 histsearch.o
: ${BUILD_DIR}/config.h
318 input.o
: ansi_stdlib.h
319 input.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
320 input.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
321 isearch.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
322 isearch.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
323 isearch.o
: ansi_stdlib.h history.h rlstdc.h
324 keymaps.o
: emacs_keymap.c vi_keymap.c
325 keymaps.o
: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
326 keymaps.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
327 keymaps.o
: ${BUILD_DIR}/config.h rlstdc.h
328 kill.o
: ansi_stdlib.h
329 kill.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
330 kill.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
331 kill.o
: history.h rlstdc.h
332 macro.o
: ansi_stdlib.h
333 macro.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
334 macro.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
335 macro.o
: history.h rlstdc.h
336 mbutil.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
337 mbutil.o
: readline.h keymaps.h rltypedefs.h chardefs.h rlstdc.h
338 misc.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
339 misc.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
340 misc.o
: history.h rlstdc.h ansi_stdlib.h
342 nls.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
343 nls.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
344 nls.o
: history.h rlstdc.h
346 parens.o
: ${BUILD_DIR}/config.h
347 parens.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
348 readline.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
349 readline.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
350 readline.o
: history.h rlstdc.h
351 readline.o
: posixstat.h ansi_stdlib.h posixjmp.h
352 rltty.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
354 rltty.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
355 search.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
356 search.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
357 search.o
: ansi_stdlib.h history.h rlstdc.h
358 shell.o
: ${BUILD_DIR}/config.h
359 shell.o
: ansi_stdlib.h
360 signals.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
361 signals.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
362 signals.o
: history.h rlstdc.h
363 terminal.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
365 terminal.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
366 terminal.o
: history.h rlstdc.h
367 text.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
368 text.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
369 text.o
: history.h rlstdc.h ansi_stdlib.h
370 tilde.o
: ansi_stdlib.h
371 tilde.o
: ${BUILD_DIR}/config.h
373 undo.o
: ansi_stdlib.h
374 undo.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
375 undo.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
376 undo.o
: history.h rlstdc.h
377 util.o
: posixjmp.h ansi_stdlib.h
378 util.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
379 util.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
380 vi_mode.o
: rldefs.h
${BUILD_DIR}/config.h rlconf.h
381 vi_mode.o
: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
382 vi_mode.o
: history.h ansi_stdlib.h rlstdc.h
383 xmalloc.o
: ${BUILD_DIR}/config.h
384 xmalloc.o
: ansi_stdlib.h
387 histfile.o
: rlshell.h
389 readline.o
: rlshell.h
391 terminal.o
: rlshell.h
392 histexpand.o
: rlshell.h
395 callback.o
: rlprivate.h
396 complete.o
: rlprivate.h
397 display.o
: rlprivate.h
399 isearch.o
: rlprivate.h
402 mbutil.o
: rlprivate.h
405 parens.o
: rlprivate.h
406 readline.o
: rlprivate.h
408 search.o
: rlprivate.h
409 signals.o
: rlprivate.h
410 terminal.o
: rlprivate.h
414 vi_mode.o
: rlprivate.h
417 complete.o
: xmalloc.h
420 histexpand.o
: xmalloc.h
421 histfile.o
: xmalloc.h
430 readline.o
: xmalloc.h
431 savestring.o
: xmalloc.h
434 terminal.o
: xmalloc.h
442 complete.o
: rlmbutil.h
443 display.o
: rlmbutil.h
444 histexpand.o
: rlmbutil.h
446 isearch.o
: rlmbutil.h
449 readline.o
: rlmbutil.h
452 vi_mode.o
: rlmbutil.h
454 bind.o
: $(srcdir)/bind.c
455 callback.o
: $(srcdir)/callback.c
456 compat.o
: $(srcdir)/compat.c
457 complete.o
: $(srcdir)/complete.c
458 display.o
: $(srcdir)/display.c
459 funmap.o
: $(srcdir)/funmap.c
460 input.o
: $(srcdir)/input.c
461 isearch.o
: $(srcdir)/isearch.c
462 keymaps.o
: $(srcdir)/keymaps.c
$(srcdir)/emacs_keymap.c
$(srcdir)/vi_keymap.c
463 kill.o
: $(srcdir)/kill.c
464 macro.o
: $(srcdir)/macro.c
465 mbutil.o
: $(srcdir)/mbutil.c
466 misc.o
: $(srcdir)/misc.c
467 nls.o
: $(srcdir)/nls.c
468 parens.o
: $(srcdir)/parens.c
469 readline.o
: $(srcdir)/readline.c
470 rltty.o
: $(srcdir)/rltty.c
471 savestring.o
: $(srcdir)/savestring.c
472 search.o
: $(srcdir)/search.c
473 shell.o
: $(srcdir)/shell.c
474 signals.o
: $(srcdir)/signals.c
475 terminal.o
: $(srcdir)/terminal.c
476 text.o
: $(srcdir)/text.c
477 tilde.o
: $(srcdir)/tilde.c
478 undo.o
: $(srcdir)/undo.c
479 util.o
: $(srcdir)/util.c
480 vi_mode.o
: $(srcdir)/vi_mode.c
481 xmalloc.o
: $(srcdir)/xmalloc.c
483 histexpand.o
: $(srcdir)/histexpand.c
484 histfile.o
: $(srcdir)/histfile.c
485 history.o
: $(srcdir)/history.c
486 histsearch.o
: $(srcdir)/histsearch.c
489 callback.o
: callback.c
491 complete.o
: complete.c
496 keymaps.o
: keymaps.c emacs_keymap.c vi_keymap.c
503 readline.o
: readline.c
505 savestring.o
: savestring.c
509 terminal.o
: terminal.c
517 histexpand.o
: histexpand.c
518 histfile.o
: histfile.c
520 histsearch.o
: histsearch.c