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@
41 exec_prefix = @exec_prefix@
46 includedir = @includedir@
50 man3dir = $(mandir)/man3
52 # Programs to make tags files.
57 LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
61 LOCAL_DEFS = @LOCAL_DEFS@
63 TERMCAP_LIB = @TERMCAP_LIB@
65 # For libraries which include headers from other libraries.
66 INCLUDES = -I. -I$(srcdir) -I$(includedir)
68 CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES) $(LOCAL_CFLAGS) $(CFLAGS)
72 $(CC) -c $(CCFLAGS) $<
74 # The name of the main library target.
75 LIBRARY_NAME = libreadline.a
76 STATIC_LIBS = libreadline.a libhistory.a
78 # The C code source files for this library.
79 CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
80 $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
81 $(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \
82 $(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \
83 $(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \
84 $(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \
85 $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
86 $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
87 $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
88 $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c
90 # The header files for this library.
91 HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
92 posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
93 ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h
95 HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o
97 OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
98 rltty.o complete.o bind.o isearch.o display.o signals.o \
99 util.o kill.o undo.o macro.o input.o callback.o terminal.o \
100 nls.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
102 # The texinfo files which document this library.
103 DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
104 DOCOBJECT = doc/readline.dvi
105 DOCSUPPORT = doc/Makefile
106 DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
108 CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile shlib/Makefile
109 CREATED_CONFIGURE = config.status config.h config.cache config.log \
111 CREATED_TAGS = TAGS tags
113 INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
116 ##########################################################################
120 everything: static shared examples
122 static: $(STATIC_LIBS)
124 libreadline.a: $(OBJECTS)
126 $(AR) $(ARFLAGS) $@ $(OBJECTS)
127 -test -n "$(RANLIB)" && $(RANLIB) $@
129 libhistory.a: $(HISTOBJ) xmalloc.o
131 $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
132 -test -n "$(RANLIB)" && $(RANLIB) $@
134 readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a
135 $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a ${TERMCAP_LIB}
137 Makefile makefile: config.status $(srcdir)/Makefile.in
138 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
140 Makefiles makefiles: config.status $(srcdir)/Makefile.in
141 @for mf in $(CREATED_MAKEFILES); do \
142 CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \
145 config.status: configure
146 $(SHELL) ./config.status --recheck
150 stamp-h: config.status $(srcdir)/config.h.in
151 CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
154 #$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution
155 # cd $(srcdir) && autoconf ## Comment-me-out in distribution
159 -test -d shlib || mkdir shlib
160 -( cd shlib ; ${MAKE} ${MFLAGS} all )
163 -test -d doc || mkdir doc
164 -( cd doc && $(MAKE) $(MFLAGS) )
167 -test -d examples || mkdir examples
168 -(cd examples && ${MAKE} ${MFLAGS} all )
172 install-headers: installdirs ${INSTALLED_HEADERS}
173 for f in ${INSTALLED_HEADERS}; do \
174 $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \
178 -test -n "$(includedir)" && cd $(includedir)/readline && \
179 ${RM} ${INSTALLED_HEADERS}
181 maybe-uninstall-headers: uninstall-headers
183 install: installdirs $(STATIC_LIBS) install-headers
184 -$(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old
185 $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
186 -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libreadline.a
187 -$(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old
188 $(INSTALL_DATA) libhistory.a $(libdir)/libhistory.a
189 -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libhistory.a
190 -( if test -d doc ; then \
192 ${MAKE} ${MFLAGS} infodir=$(infodir) $@; \
195 installdirs: $(srcdir)/support/mkdirs
196 -$(SHELL) $(srcdir)/support/mkdirs $(includedir) \
197 $(includedir)/readline $(libdir) $(infodir) $(man3dir)
199 uninstall: uninstall-headers
200 -test -n "$(libdir)" && cd $(libdir) && \
201 ${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
203 install-shared: installdirs install-headers shared
204 -( cd shlib ; ${MAKE} ${MFLAGS} install )
206 uninstall-shared: maybe-uninstall-headers
207 -( cd shlib; ${MAKE} ${MFLAGS} uninstall )
210 $(ETAGS) $(CSOURCES) $(HSOURCES)
213 $(CTAGS) $(CSOURCES) $(HSOURCES)
216 $(RM) $(OBJECTS) $(STATIC_LIBS)
217 $(RM) readline readline.exe
218 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
219 -( cd doc && $(MAKE) $(MFLAGS) $@ )
220 -( cd examples && $(MAKE) $(MFLAGS) $@ )
223 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
224 -( cd doc && $(MAKE) $(MFLAGS) $@ )
225 -( cd examples && $(MAKE) $(MFLAGS) $@ )
227 distclean maintainer-clean: clean
228 -( cd shlib && $(MAKE) $(MFLAGS) $@ )
229 -( cd doc && $(MAKE) $(MFLAGS) $@ )
230 -( cd examples && $(MAKE) $(MFLAGS) $@ )
232 $(RM) $(CREATED_CONFIGURE)
233 $(RM) $(CREATED_TAGS)
236 -( cd doc && $(MAKE) $(MFLAGS) $@ )
243 @echo Readline distributions are created using $(srcdir)/support/mkdist.
244 @echo Here is a sample of the necessary commands:
245 @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME) $(RL_LIBRARY_VERSION)
246 @echo tar cf $(RL_LIBRARY_NAME)-${RL_LIBRARY_VERSION}.tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION)
247 @echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar
249 # Tell versions [3.59,3.63) of GNU make not to export all variables.
250 # Otherwise a system limit (for SysV at least) may be exceeded.
254 bind.o: ansi_stdlib.h posixstat.h
255 bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
256 bind.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
259 callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
260 callback.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
261 complete.o: ansi_stdlib.h posixdir.h posixstat.h
262 complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
263 complete.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
264 display.o: ansi_stdlib.h posixstat.h
265 display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
267 display.o: readline.h keymaps.h chardefs.h tilde.h
268 display.o: history.h rlstdc.h
269 funmap.o: readline.h keymaps.h chardefs.h tilde.h
270 funmap.o: rlconf.h ansi_stdlib.h rlstdc.h
271 funmap.o: ${BUILD_DIR}/config.h
272 histexpand.o: ansi_stdlib.h
273 histexpand.o: history.h histlib.h rlstdc.h
274 histexpand.o: ${BUILD_DIR}/config.h
275 histfile.o: ansi_stdlib.h
276 histfile.o: history.h histlib.h rlstdc.h
277 histfile.o: ${BUILD_DIR}/config.h
278 history.o: ansi_stdlib.h
279 history.o: history.h histlib.h rlstdc.h
280 history.o: ${BUILD_DIR}/config.h
281 histsearch.o: ansi_stdlib.h
282 histsearch.o: history.h histlib.h rlstdc.h
283 histsearch.o: ${BUILD_DIR}/config.h
284 input.o: ansi_stdlib.h
285 input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
286 input.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
287 isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
288 isearch.o: readline.h keymaps.h chardefs.h tilde.h
289 isearch.o: ansi_stdlib.h history.h rlstdc.h
290 keymaps.o: emacs_keymap.c vi_keymap.c
291 keymaps.o: keymaps.h chardefs.h rlconf.h ansi_stdlib.h
292 keymaps.o: readline.h keymaps.h chardefs.h tilde.h
293 keymaps.o: ${BUILD_DIR}/config.h rlstdc.h
294 kill.o: ansi_stdlib.h
295 kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
296 kill.o: readline.h keymaps.h chardefs.h tilde.h
297 kill.o: history.h rlstdc.h
298 macro.o: ansi_stdlib.h
299 macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
300 macro.o: readline.h keymaps.h chardefs.h tilde.h
301 macro.o: history.h rlstdc.h
303 nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
304 nls.o: readline.h keymaps.h chardefs.h tilde.h
305 nls.o: history.h rlstdc.h
307 parens.o: ${BUILD_DIR}/config.h
308 parens.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
309 readline.o: readline.h keymaps.h chardefs.h tilde.h
310 readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
311 readline.o: history.h rlstdc.h
312 readline.o: posixstat.h ansi_stdlib.h posixjmp.h
313 rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
315 rltty.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
316 search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
317 search.o: readline.h keymaps.h chardefs.h tilde.h
318 search.o: ansi_stdlib.h history.h rlstdc.h
319 shell.o: ${BUILD_DIR}/config.h
320 shell.o: ansi_stdlib.h
321 signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
322 signals.o: readline.h keymaps.h chardefs.h tilde.h
323 signals.o: history.h rlstdc.h
324 terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
326 terminal.o: readline.h keymaps.h chardefs.h tilde.h
327 terminal.o: history.h rlstdc.h
328 tilde.o: ansi_stdlib.h
329 tilde.o: ${BUILD_DIR}/config.h
331 undo.o: ansi_stdlib.h
332 undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
333 undo.o: readline.h keymaps.h chardefs.h tilde.h
334 undo.o: history.h rlstdc.h
335 util.o: posixjmp.h ansi_stdlib.h
336 util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
337 util.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
338 vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
339 vi_mode.o: readline.h keymaps.h chardefs.h tilde.h
340 vi_mode.o: history.h ansi_stdlib.h rlstdc.h
341 xmalloc.o: ${BUILD_DIR}/config.h
342 xmalloc.o: ansi_stdlib.h
345 histfile.o: rlshell.h
347 readline.o: rlshell.h
349 terminal.o: rlshell.h
350 histexpand.o: rlshell.h
353 callback.o: rlprivate.h
354 complete.o: rlprivate.h
355 display.o: rlprivate.h
357 isearch.o: rlprivate.h
361 parens.o: rlprivate.h
362 readline.o: rlprivate.h
364 search.o: rlprivate.h
365 signals.o: rlprivate.h
366 terminal.o: rlprivate.h
369 vi_mode.o: rlprivate.h
372 complete.o: xmalloc.h
375 histexpand.o: xmalloc.h
376 histfile.o: xmalloc.h
383 readline.o: xmalloc.h
384 savestring.o: xmalloc.h
392 readline.o: $(srcdir)/readline.c
393 vi_mode.o: $(srcdir)/vi_mode.c
394 funmap.o: $(srcdir)/funmap.c
395 keymaps.o: $(srcdir)/keymaps.c
396 parens.o: $(srcdir)/parens.c
397 search.o: $(srcdir)/search.c
398 rltty.o: $(srcdir)/rltty.c
399 complete.o: $(srcdir)/complete.c
400 bind.o: $(srcdir)/bind.c
401 isearch.o: $(srcdir)/isearch.c
402 display.o: $(srcdir)/display.c
403 signals.o: $(srcdir)/signals.c
404 util.o: $(srcdir)/util.c
405 kill.o: $(srcdir)/kill.c
406 undo.o: $(srcdir)/undo.c
407 macro.o: $(srcdir)/macro.c
408 input.o: $(srcdir)/input.c
409 callback.o: $(srcdir)/callback.c
410 terminal.o: $(srcdir)/terminal.c
411 nls.o: $(srcdir)/nls.c
412 xmalloc.o: $(srcdir)/xmalloc.c
413 history.o: $(srcdir)/history.c
414 histexpand.o: $(srcdir)/histexpand.c
415 histfile.o: $(srcdir)/histfile.c
416 histsearch.o: $(srcdir)/histsearch.c
417 savestring.o: $(srcdir)/savestring.c
418 shell.o: $(srcdir)/shell.c
419 tilde.o: $(srcdir)/tilde.c
421 readline.o: readline.c
428 complete.o: complete.c
438 callback.o: callback.c
439 terminal.o: terminal.c
443 histexpand.o: histexpand.c
444 histfile.o: histfile.c
445 histsearch.o: histsearch.c
446 savestring.o: savestring.c