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., 675 Mass Ave, Cambridge, MA 02139, 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@
31 LD = ld # needed when building shared libraries
39 exec_prefix = @exec_prefix@
44 includedir = @includedir@
48 man3dir = $(mandir)/man3
52 # Programs to make tags files.
57 LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
59 LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@ @CFLAGS@
62 LOCAL_DEFS = @LOCAL_DEFS@
64 # For libraries which include headers from other libraries.
65 INCLUDES = -I. -I$(srcdir) -I$(includedir)
67 CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES) $(LOCAL_CFLAGS) $(CFLAGS)
69 # these two options need tweaking for compiler/OS versions other than gcc
71 PICFLAG= -fpic # -pic for some versions of cc
72 SHLIB_OPTS= -assert pure-text -ldl # -Bshareable for some versions of gcc
75 # shared library systems like SVR4's do not use minor versions
81 $(CC) -c $(CCFLAGS) $<
85 $(CC) -c $(PICFLAG) $(CCFLAGS) $<
89 # The name of the main library target.
90 LIBRARY_NAME = libreadline.a
91 STATIC_LIBS = libreadline.a libhistory.a
93 SHARED_READLINE = libreadline.so.$(MAJOR)$(MINOR)
94 SHARED_HISTORY = libhistory.so.$(MAJOR)$(MINOR)
95 SHARED_LIBS = $(SHARED_READLINE) $(SHARED_HISTORY)
97 # The C code source files for this library.
98 CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
99 $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
100 $(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \
101 $(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \
102 $(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \
103 $(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \
104 $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
105 $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
106 $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
107 $(srcdir)/shell.c $(srcdir)/tilde.c
109 # The header files for this library.
110 HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
111 posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
114 HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o
116 OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
117 rltty.o complete.o bind.o isearch.o display.o signals.o \
118 util.o kill.o undo.o macro.o input.o callback.o terminal.o \
119 nls.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
121 SHARED_HISTOBJ = history.so histexpand.so histfile.so histsearch.so shell.so
122 SHARED_TILDEOBJ = tilde.so
123 SHARED_OBJ = readline.so vi_mode.so funmap.so keymaps.so parens.so search.so \
124 rltty.so complete.so bind.so isearch.so display.so signals.so \
125 util.so kill.so undo.so macro.so input.so callback.so terminal.so \
126 nls.so xmalloc.so $(SHARED_HISTOBJ) $(SHARED_TILDEOBJ)
128 # The texinfo files which document this library.
129 DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
130 DOCOBJECT = doc/readline.dvi
131 DOCSUPPORT = doc/Makefile
132 DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
134 CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile
135 CREATED_CONFIGURE = config.status config.h config.cache config.log \
137 CREATED_TAGS = TAGS tags
139 INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h
141 ##########################################################################
145 static: $(STATIC_LIBS)
146 shared: $(SHARED_LIBS)
148 libreadline.a: $(OBJECTS)
150 $(AR) cr $@ $(OBJECTS)
151 -test -n "$(RANLIB)" && $(RANLIB) $@
153 libhistory.a: $(HISTOBJ) xmalloc.o
155 $(AR) cr $@ $(HISTOBJ) xmalloc.o
156 -test -n "$(RANLIB)" && $(RANLIB) $@
158 $(SHARED_READLINE): $(SHARED_OBJ)
160 $(LD) ${SHLIB_OPTS} -o $@ $(SHARED_OBJ)
162 $(SHARED_HISTORY): $(SHARED_HISTOBJ) xmalloc.so
164 $(LD) ${SHLIB_OPTS} -o $@ $(SHARED_HISTOBJ) xmalloc.so
166 readline: $(OBJECTS) readline.h rldefs.h chardefs.h
167 $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a -ltermcap
169 Makefile makefile: config.status $(srcdir)/Makefile.in
170 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
172 Makefiles makefiles: config.status $(srcdir)/Makefile.in
173 @for mf in $(CREATED_MAKEFILES); do \
174 CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \
177 config.status: configure
178 $(SHELL) ./config.status --recheck
182 stamp-h: config.status $(srcdir)/config.h.in
183 CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
186 #$(srcdir)/configure: $(srcdir)/configure.in Comment-me-out in distribution
187 # cd $(srcdir) && autoconf Comment-me-out in distribution
190 -test -d doc || mkdir doc
191 -( cd doc && $(MAKE) $(MFLAGS) )
194 -test -d examples || mkdir examples
195 -(cd examples && ${MAKE} ${MFLAGS} all )
199 install: installdirs $(STATIC_LIBS)
200 for f in ${INSTALLED_HEADERS}; do \
201 $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \
203 -$(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old
204 $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
205 -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libreadline.a
206 -$(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old
207 $(INSTALL_DATA) libhistory.a $(libdir)/libhistory.a
208 -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libhistory.a
209 -( if test -d doc ; then \
211 ${MAKE} ${MFLAGS} infodir=$(infodir) $@; \
214 installdirs: $(srcdir)/support/mkdirs
215 -$(SHELL) $(srcdir)/support/mkdirs $(includedir) \
216 $(includedir)/readline $(libdir) $(infodir) $(man3dir)
219 -test -n "$(includedir)" && cd $(includedir)/readline && \
220 ${RM} ${INSTALLED_HEADERS}
221 -test -n "$(libdir)" && cd $(libdir) && \
222 ${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
224 install-shared: installdirs shared
225 -$(MV) $(libdir)/$(SHARED_HISTORY) $(libdir)/$(SHARED_HISTORY).old
226 $(INSTALL_DATA) $(SHARED_HISTORY) $(libdir)/$(SHARED_HISTORY)
227 -$(MV) $(libdir)/$(SHARED_READLINE) $(libdir)/$(SHARED_READLINE).old
228 $(INSTALL_DATA) $(SHARED_READLINE) $(libdir)/$(SHARED_READLINE)
231 -test -n "$(libdir)" && cd $(libdir) && ${RM} ${SHARED_LIBS}
234 $(ETAGS) $(CSOURCES) $(HSOURCES)
237 $(CTAGS) $(CSOURCES) $(HSOURCES)
240 $(RM) $(OBJECTS) $(STATIC_LIBS)
241 $(RM) $(SHARED_OBJ) $(SHARED_LIBS)
242 -( cd doc && $(MAKE) $(MFLAGS) $@ )
243 -( cd examples && $(MAKE) $(MFLAGS) $@ )
246 -( cd doc && $(MAKE) $(MFLAGS) $@ )
247 -( cd examples && $(MAKE) $(MFLAGS) $@ )
249 distclean maintainer-clean: clean
250 -( cd doc && $(MAKE) $(MFLAGS) $@ )
251 -( cd examples && $(MAKE) $(MFLAGS) $@ )
253 $(RM) $(CREATED_CONFIGURE)
254 $(RM) $(CREATED_TAGS)
257 -( cd doc && $(MAKE) $(MFLAGS) $@ )
264 @echo Readline distributions are created using $(srcdir)/support/mkdist.
265 @echo Here is a sample of the necessary commands:
266 @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION)
267 @echo tar cf $(RL_LIBRARY_NAME)-${RL_LIBRARY_VERSION}.tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION)
268 @echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar
270 # Tell versions [3.59,3.63) of GNU make not to export all variables.
271 # Otherwise a system limit (for SysV at least) may be exceeded.
275 bind.o: ansi_stdlib.h posixstat.h
276 bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
277 bind.o: readline.h keymaps.h chardefs.h tilde.h
280 callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
281 callback.o: readline.h keymaps.h chardefs.h tilde.h
282 complete.o: ansi_stdlib.h posixdir.h posixstat.h
283 complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
284 complete.o: readline.h keymaps.h chardefs.h tilde.h
285 display.o: ansi_stdlib.h posixstat.h
286 display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
288 display.o: readline.h keymaps.h chardefs.h tilde.h
290 funmap.o: readline.h keymaps.h chardefs.h tilde.h
291 funmap.o: rlconf.h ansi_stdlib.h
292 funmap.o: ${BUILD_DIR}/config.h
293 histexpand.o: ansi_stdlib.h
294 histexpand.o: history.h histlib.h
295 histexpand.o: ${BUILD_DIR}/config.h
296 histfile.o: ansi_stdlib.h
297 histfile.o: history.h histlib.h
298 histfile.o: ${BUILD_DIR}/config.h
299 history.o: ansi_stdlib.h
300 history.o: history.h histlib.h
301 history.o: ${BUILD_DIR}/config.h
302 histsearch.o: ansi_stdlib.h
303 histsearch.o: history.h histlib.h
304 histsearch.o: ${BUILD_DIR}/config.h
305 input.o: ansi_stdlib.h
306 input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
307 input.o: readline.h keymaps.h chardefs.h tilde.h
308 isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
309 isearch.o: readline.h keymaps.h chardefs.h tilde.h
310 isearch.o: ansi_stdlib.h history.h
311 keymaps.o: emacs_keymap.c vi_keymap.c
312 keymaps.o: keymaps.h chardefs.h rlconf.h ansi_stdlib.h
313 keymaps.o: readline.h keymaps.h chardefs.h tilde.h
314 keymaps.o: ${BUILD_DIR}/config.h
315 kill.o: ansi_stdlib.h
316 kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
317 kill.o: readline.h keymaps.h chardefs.h tilde.h
319 macro.o: ansi_stdlib.h
320 macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
321 macro.o: readline.h keymaps.h chardefs.h tilde.h
324 nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
326 parens.o: ${BUILD_DIR}/config.h
327 parens.o: readline.h keymaps.h chardefs.h tilde.h
328 readline.o: readline.h keymaps.h chardefs.h tilde.h
329 readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
330 readline.o: history.h
331 readline.o: posixstat.h ansi_stdlib.h posixjmp.h
332 rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
334 rltty.o: readline.h keymaps.h chardefs.h tilde.h
335 search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
336 search.o: readline.h keymaps.h chardefs.h tilde.h
337 search.o: ansi_stdlib.h history.h
338 shell.o: ${BUILD_DIR}/config.h
339 shell.o: ansi_stdlib.h
340 signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
341 signals.o: readline.h keymaps.h chardefs.h tilde.h
343 terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
345 terminal.o: readline.h keymaps.h chardefs.h tilde.h
346 terminal.o: history.h
347 tilde.o: ansi_stdlib.h
348 tilde.o: ${BUILD_DIR}/config.h
350 undo.o: ansi_stdlib.h
351 undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
352 undo.o: readline.h keymaps.h chardefs.h tilde.h
354 util.o: posixjmp.h ansi_stdlib.h
355 util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
356 util.o: readline.h keymaps.h chardefs.h tilde.h
357 vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
358 vi_mode.o: readline.h keymaps.h chardefs.h tilde.h
359 vi_mode.o: history.h ansi_stdlib.h
360 xmalloc.o: ${BUILD_DIR}/config.h
361 xmalloc.o: ansi_stdlib.h
363 readline.o: $(srcdir)/readline.c
364 vi_mode.o: $(srcdir)/vi_mode.c
365 funmap.o: $(srcdir)/funmap.c
366 keymaps.o: $(srcdir)/keymaps.c
367 parens.o: $(srcdir)/parens.c
368 search.o: $(srcdir)/search.c
369 rltty.o: $(srcdir)/rltty.c
370 complete.o: $(srcdir)/complete.c
371 bind.o: $(srcdir)/bind.c
372 isearch.o: $(srcdir)/isearch.c
373 display.o: $(srcdir)/display.c
374 signals.o: $(srcdir)/signals.c
375 util.o: $(srcdir)/util.c
376 kill.o: $(srcdir)/kill.c
377 undo.o: $(srcdir)/undo.c
378 macro.o: $(srcdir)/macro.c
379 input.o: $(srcdir)/input.c
380 callback.o: $(srcdir)/callback.c
381 terminal.o: $(srcdir)/terminal.c
382 nls.o: $(srcdir)/nls.c
383 xmalloc.o: $(srcdir)/xmalloc.c
384 history.o: $(srcdir)/history.c
385 histexpand.o: $(srcdir)/histexpand.c
386 histfile.o: $(srcdir)/histfile.c
387 histsearch.o: $(srcdir)/histsearch.c
388 shell.o: $(srcdir)/shell.c
389 tilde.o: $(srcdir)/tilde.c
391 bind.so: ansi_stdlib.h posixstat.h
392 bind.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
393 bind.so: readline.h keymaps.h chardefs.h tilde.h
395 callback.so: rlconf.h
396 callback.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
397 callback.so: readline.h keymaps.h chardefs.h tilde.h
398 complete.so: ansi_stdlib.h posixdir.h posixstat.h
399 complete.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
400 complete.so: readline.h keymaps.h chardefs.h tilde.h
401 display.so: ansi_stdlib.h posixstat.h
402 display.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
404 display.so: readline.h keymaps.h chardefs.h tilde.h
405 display.so: history.h
406 funmap.so: readline.h keymaps.h chardefs.h tilde.h
407 funmap.so: rlconf.h ansi_stdlib.h
408 funmap.so: ${BUILD_DIR}/config.h
409 histexpand.so: ansi_stdlib.h
410 histexpand.so: history.h histlib.h
411 histexpand.so: ${BUILD_DIR}/config.h
412 histfile.so: ansi_stdlib.h
413 histfile.so: history.h histlib.h
414 histfile.so: ${BUILD_DIR}/config.h
415 history.so: ansi_stdlib.h
416 history.so: history.h histlib.h
417 history.so: ${BUILD_DIR}/config.h
418 histsearch.so: ansi_stdlib.h
419 histsearch.so: history.h histlib.h
420 histsearch.so: ${BUILD_DIR}/config.h
421 input.so: ansi_stdlib.h
422 input.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
423 input.so: readline.h keymaps.h chardefs.h tilde.h
424 isearch.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
425 isearch.so: readline.h keymaps.h chardefs.h tilde.h
426 isearch.so: ansi_stdlib.h history.h
427 keymaps.so: emacs_keymap.c vi_keymap.c
428 keymaps.so: keymaps.h chardefs.h rlconf.h ansi_stdlib.h
429 keymaps.so: readline.h keymaps.h chardefs.h tilde.h
430 keymaps.so: ${BUILD_DIR}/config.h
431 kill.so: ansi_stdlib.h
432 kill.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
433 kill.so: readline.h keymaps.h chardefs.h tilde.h
435 macro.so: ansi_stdlib.h
436 macro.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
437 macro.so: readline.h keymaps.h chardefs.h tilde.h
439 nls.so: ansi_stdlib.h
440 nls.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
442 parens.so: ${BUILD_DIR}/config.h
443 parens.so: readline.h keymaps.h chardefs.h tilde.h
444 readline.so: readline.h keymaps.h chardefs.h tilde.h
445 readline.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
446 readline.so: history.h
447 readline.so: posixstat.h ansi_stdlib.h posixjmp.h
448 rltty.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
450 rltty.so: readline.h keymaps.h chardefs.h tilde.h
451 search.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
452 search.so: readline.h keymaps.h chardefs.h tilde.h
453 search.so: ansi_stdlib.h history.h
454 signals.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
455 signals.so: readline.h keymaps.h chardefs.h tilde.h
456 signals.so: history.h
457 terminal.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
459 terminal.so: readline.h keymaps.h chardefs.h tilde.h
460 terminal.so: history.h
461 tilde.so: ansi_stdlib.h
462 tilde.so: ${BUILD_DIR}/config.h
464 undo.so: ansi_stdlib.h
465 undo.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
466 undo.so: readline.h keymaps.h chardefs.h tilde.h
468 util.so: posixjmp.h ansi_stdlib.h
469 util.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
470 util.so: readline.h keymaps.h chardefs.h tilde.h
471 vi_mode.so: rldefs.h ${BUILD_DIR}/config.h rlconf.h
472 vi_mode.so: readline.h keymaps.h chardefs.h tilde.h
473 vi_mode.so: history.h ansi_stdlib.h
474 xmalloc.so: ${BUILD_DIR}/config.h
475 xmalloc.so: ansi_stdlib.h
477 readline.o: readline.c
484 complete.o: complete.c
494 callback.o: callback.c
495 terminal.o: terminal.c
499 histexpand.o: histexpand.c
500 histfile.o: histfile.c
501 histsearch.o: histsearch.c
505 readline.so: $(srcdir)/readline.c
506 vi_mode.so: $(srcdir)/vi_mode.c
507 funmap.so: $(srcdir)/funmap.c
508 keymaps.so: $(srcdir)/keymaps.c
509 parens.so: $(srcdir)/parens.c
510 search.so: $(srcdir)/search.c
511 rltty.so: $(srcdir)/rltty.c
512 complete.so: $(srcdir)/complete.c
513 bind.so: $(srcdir)/bind.c
514 isearch.so: $(srcdir)/isearch.c
515 display.so: $(srcdir)/display.c
516 signals.so: $(srcdir)/signals.c
517 util.so: $(srcdir)/util.c
518 kill.so: $(srcdir)/kill.c
519 undo.so: $(srcdir)/undo.c
520 macro.so: $(srcdir)/macro.c
521 input.so: $(srcdir)/input.c
522 callback.so: $(srcdir)/callback.c
523 terminal.so: $(srcdir)/terminal.c
524 nls.so: $(srcdir)/nls.c
525 xmalloc.so: $(srcdir)/xmalloc.c
526 history.so: $(srcdir)/history.c
527 histexpand.so: $(srcdir)/histexpand.c
528 histfile.so: $(srcdir)/histfile.c
529 histsearch.so: $(srcdir)/histsearch.c
530 shell.so: $(srcdir)/shell.c
531 tilde.so: $(srcdir)/tilde.c
533 readline.so: readline.c
534 vi_mode.so: vi_mode.c
536 keymaps.so: keymaps.c
540 complete.so: complete.c
542 isearch.so: isearch.c
543 display.so: display.c
544 signals.so: signals.c
550 callback.so: callback.c
551 terminal.so: terminal.c
553 xmalloc.so: xmalloc.c
554 history.so: history.c
555 histexpand.so: histexpand.c
556 histfile.so: histfile.c
557 histsearch.so: histsearch.c