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 # Programs to make tags files.
58 LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
62 LOCAL_DEFS = @LOCAL_DEFS@
64 TERMCAP_LIB = @TERMCAP_LIB@
66 # For libraries which include headers from other libraries.
67 INCLUDES = -I. -I$(srcdir) -I$(includedir)
69 XCCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES)
70 CCFLAGS = $(XCCFLAGS) $(LOCAL_CFLAGS) $(CFLAGS)
72 # could add -Werror here
73 GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \
74 -Wwrite-strings -Wstrict-prototypes \
75 -Wmissing-prototypes -Wno-implicit
76 GCC_LINT_CFLAGS = $(XCCFLAGS) $(GCC_LINT_FLAGS) @CFLAGS@ @LOCAL_CFLAGS@
80 $(CC) -c $(CCFLAGS) $<
82 # The name of the main library target.
83 LIBRARY_NAME = libreadline.a
84 STATIC_LIBS = libreadline.a libhistory.a
86 # The C code source files for this library.
87 CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
88 $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
89 $(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \
90 $(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \
91 $(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \
92 $(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \
93 $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
94 $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
95 $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
96 $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c \
99 # The header files for this library.
100 HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
101 posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
102 ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h \
105 HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o
107 OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
108 rltty.o complete.o bind.o isearch.o display.o signals.o \
109 util.o kill.o undo.o macro.o input.o callback.o terminal.o \
110 nls.o compat.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
112 # The texinfo files which document this library.
113 DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
114 DOCOBJECT = doc/readline.dvi
115 DOCSUPPORT = doc/Makefile
116 DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
118 CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile shlib/Makefile
119 CREATED_CONFIGURE = config.status config.h config.cache config.log \
121 CREATED_TAGS = TAGS tags
123 INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
124 rlstdc.h rlconf.h rltypedefs.h
126 ##########################################################################
130 everything: static shared examples
132 static: $(STATIC_LIBS)
134 libreadline.a: $(OBJECTS)
136 $(AR) $(ARFLAGS) $@ $(OBJECTS)
137 -test -n "$(RANLIB)" && $(RANLIB) $@
139 libhistory.a: $(HISTOBJ) xmalloc.o
141 $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
142 -test -n "$(RANLIB)" && $(RANLIB) $@
144 readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a
145 $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a ${TERMCAP_LIB}
148 $(MAKE) $(MFLAGS) CCFLAGS='$(GCC_LINT_CFLAGS)' static
150 Makefile makefile: config.status $(srcdir)/Makefile.in
151 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
153 Makefiles makefiles: config.status $(srcdir)/Makefile.in
154 @for mf in $(CREATED_MAKEFILES); do \
155 CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \
158 config.status: configure
159 $(SHELL) ./config.status --recheck
163 stamp-h: config.status $(srcdir)/config.h.in
164 CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
167 #$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution
168 # cd $(srcdir) && autoconf ## Comment-me-out in distribution
172 -test -d shlib || mkdir shlib
173 -( cd shlib ; ${MAKE} ${MFLAGS} all )
176 -test -d doc || mkdir doc
177 -( cd doc && $(MAKE) $(MFLAGS) )
180 -test -d examples || mkdir examples
181 -(cd examples && ${MAKE} ${MFLAGS} all )
185 install-headers: installdirs ${INSTALLED_HEADERS}
186 for f in ${INSTALLED_HEADERS}; do \
187 $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \
191 -test -n "$(includedir)" && cd $(includedir)/readline && \
192 ${RM} ${INSTALLED_HEADERS}
194 maybe-uninstall-headers: uninstall-headers
196 install: installdirs $(STATIC_LIBS) install-headers
197 -$(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old
198 $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
199 -test -n "$(RANLIB)" && $(RANLIB) $(libdir)/libreadline.a
200 -$(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old
201 $(INSTALL_DATA) libhistory.a $(libdir)/libhistory.a
202 -test -n "$(RANLIB)" && $(RANLIB) $(libdir)/libhistory.a
203 -( if test -d doc ; then \
205 ${MAKE} ${MFLAGS} infodir=$(infodir) $@; \
208 installdirs: $(srcdir)/support/mkdirs
209 -$(SHELL) $(srcdir)/support/mkdirs $(includedir) \
210 $(includedir)/readline $(libdir) $(infodir) $(man3dir)
212 uninstall: uninstall-headers
213 -test -n "$(libdir)" && cd $(libdir) && \
214 ${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
216 install-shared: installdirs install-headers shared
217 -( cd shlib ; ${MAKE} ${MFLAGS} install )
219 uninstall-shared: maybe-uninstall-headers
220 -( cd shlib; ${MAKE} ${MFLAGS} uninstall )
223 $(ETAGS) $(CSOURCES) $(HSOURCES)
226 $(CTAGS) $(CSOURCES) $(HSOURCES)
229 $(RM) $(OBJECTS) $(STATIC_LIBS)
230 $(RM) readline readline.exe
231 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
232 -( cd doc && $(MAKE) $(MFLAGS) $@ )
233 -( cd examples && $(MAKE) $(MFLAGS) $@ )
236 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
237 -( cd doc && $(MAKE) $(MFLAGS) $@ )
238 -( cd examples && $(MAKE) $(MFLAGS) $@ )
240 distclean maintainer-clean: clean
241 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
242 -( cd doc && $(MAKE) $(MFLAGS) $@ )
243 -( cd examples && $(MAKE) $(MFLAGS) $@ )
245 $(RM) $(CREATED_CONFIGURE)
246 $(RM) $(CREATED_TAGS)
249 -( cd doc && $(MAKE) $(MFLAGS) $@ )
256 @echo Readline distributions are created using $(srcdir)/support/mkdist.
257 @echo Here is a sample of the necessary commands:
258 @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME) $(RL_LIBRARY_VERSION)
259 @echo tar cf $(RL_LIBRARY_NAME)-${RL_LIBRARY_VERSION}.tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION)
260 @echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar
262 # Tell versions [3.59,3.63) of GNU make not to export all variables.
263 # Otherwise a system limit (for SysV at least) may be exceeded.
267 bind.o: ansi_stdlib.h posixstat.h
268 bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
269 bind.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
272 callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
273 callback.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
275 complete.o: ansi_stdlib.h posixdir.h posixstat.h
276 complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
277 complete.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
278 display.o: ansi_stdlib.h posixstat.h
279 display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
281 display.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
282 display.o: history.h rlstdc.h
283 funmap.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
284 funmap.o: rlconf.h ansi_stdlib.h rlstdc.h
285 funmap.o: ${BUILD_DIR}/config.h
286 histexpand.o: ansi_stdlib.h
287 histexpand.o: history.h histlib.h rlstdc.h rltypedefs.h
288 histexpand.o: ${BUILD_DIR}/config.h
289 histfile.o: ansi_stdlib.h
290 histfile.o: history.h histlib.h rlstdc.h rltypedefs.h
291 histfile.o: ${BUILD_DIR}/config.h
292 history.o: ansi_stdlib.h
293 history.o: history.h histlib.h rlstdc.h rltypedefs.h
294 history.o: ${BUILD_DIR}/config.h
295 histsearch.o: ansi_stdlib.h
296 histsearch.o: history.h histlib.h rlstdc.h rltypedefs.h
297 histsearch.o: ${BUILD_DIR}/config.h
298 input.o: ansi_stdlib.h
299 input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
300 input.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
301 isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
302 isearch.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
303 isearch.o: ansi_stdlib.h history.h rlstdc.h
304 keymaps.o: emacs_keymap.c vi_keymap.c
305 keymaps.o: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
306 keymaps.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
307 keymaps.o: ${BUILD_DIR}/config.h rlstdc.h
308 kill.o: ansi_stdlib.h
309 kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
310 kill.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
311 kill.o: history.h rlstdc.h
312 macro.o: ansi_stdlib.h
313 macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
314 macro.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
315 macro.o: history.h rlstdc.h
317 nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
318 nls.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
319 nls.o: history.h rlstdc.h
321 parens.o: ${BUILD_DIR}/config.h
322 parens.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
323 readline.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
324 readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
325 readline.o: history.h rlstdc.h
326 readline.o: posixstat.h ansi_stdlib.h posixjmp.h
327 rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
329 rltty.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
330 search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
331 search.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
332 search.o: ansi_stdlib.h history.h rlstdc.h
333 shell.o: ${BUILD_DIR}/config.h
334 shell.o: ansi_stdlib.h
335 signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
336 signals.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
337 signals.o: history.h rlstdc.h
338 terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
340 terminal.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
341 terminal.o: history.h rlstdc.h
342 tilde.o: ansi_stdlib.h
343 tilde.o: ${BUILD_DIR}/config.h
345 undo.o: ansi_stdlib.h
346 undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
347 undo.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
348 undo.o: history.h rlstdc.h
349 util.o: posixjmp.h ansi_stdlib.h
350 util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
351 util.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
352 vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
353 vi_mode.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
354 vi_mode.o: history.h ansi_stdlib.h rlstdc.h
355 xmalloc.o: ${BUILD_DIR}/config.h
356 xmalloc.o: ansi_stdlib.h
359 histfile.o: rlshell.h
361 readline.o: rlshell.h
363 terminal.o: rlshell.h
364 histexpand.o: rlshell.h
367 callback.o: rlprivate.h
368 complete.o: rlprivate.h
369 display.o: rlprivate.h
371 isearch.o: rlprivate.h
375 parens.o: rlprivate.h
376 readline.o: rlprivate.h
378 search.o: rlprivate.h
379 signals.o: rlprivate.h
380 terminal.o: rlprivate.h
383 vi_mode.o: rlprivate.h
386 complete.o: xmalloc.h
389 histexpand.o: xmalloc.h
390 histfile.o: xmalloc.h
397 readline.o: xmalloc.h
398 savestring.o: xmalloc.h
406 readline.o: $(srcdir)/readline.c
407 vi_mode.o: $(srcdir)/vi_mode.c
408 funmap.o: $(srcdir)/funmap.c
409 keymaps.o: $(srcdir)/keymaps.c
410 parens.o: $(srcdir)/parens.c
411 search.o: $(srcdir)/search.c
412 rltty.o: $(srcdir)/rltty.c
413 compat.o: $(srcdir)/compat.c
414 complete.o: $(srcdir)/complete.c
415 bind.o: $(srcdir)/bind.c
416 isearch.o: $(srcdir)/isearch.c
417 display.o: $(srcdir)/display.c
418 signals.o: $(srcdir)/signals.c
419 util.o: $(srcdir)/util.c
420 kill.o: $(srcdir)/kill.c
421 undo.o: $(srcdir)/undo.c
422 macro.o: $(srcdir)/macro.c
423 input.o: $(srcdir)/input.c
424 callback.o: $(srcdir)/callback.c
425 terminal.o: $(srcdir)/terminal.c
426 nls.o: $(srcdir)/nls.c
427 xmalloc.o: $(srcdir)/xmalloc.c
428 history.o: $(srcdir)/history.c
429 histexpand.o: $(srcdir)/histexpand.c
430 histfile.o: $(srcdir)/histfile.c
431 histsearch.o: $(srcdir)/histsearch.c
432 savestring.o: $(srcdir)/savestring.c
433 shell.o: $(srcdir)/shell.c
434 tilde.o: $(srcdir)/tilde.c
436 readline.o: readline.c
444 complete.o: complete.c
454 callback.o: callback.c
455 terminal.o: terminal.c
459 histexpand.o: histexpand.c
460 histfile.o: histfile.c
461 histsearch.o: histsearch.c
462 savestring.o: savestring.c