| 1 | ## -*- text -*- ## |
| 2 | # Master Makefile for the GNU readline library. |
| 3 | # Copyright (C) 1994 Free Software Foundation, Inc. |
| 4 | |
| 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) |
| 8 | # any later version. |
| 9 | |
| 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. |
| 14 | |
| 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 |
| 20 | |
| 21 | srcdir = @srcdir@ |
| 22 | VPATH = .:@srcdir@ |
| 23 | top_srcdir = @top_srcdir@ |
| 24 | BUILD_DIR = @BUILD_DIR@ |
| 25 | |
| 26 | INSTALL = @INSTALL@ |
| 27 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
| 28 | INSTALL_DATA = @INSTALL_DATA@ |
| 29 | |
| 30 | CC = @CC@ |
| 31 | RANLIB = @RANLIB@ |
| 32 | AR = @AR@ |
| 33 | ARFLAGS = @ARFLAGS@ |
| 34 | RM = rm -f |
| 35 | CP = cp |
| 36 | MV = mv |
| 37 | |
| 38 | SHELL = @MAKE_SHELL@ |
| 39 | |
| 40 | prefix = @prefix@ |
| 41 | exec_prefix = @exec_prefix@ |
| 42 | |
| 43 | bindir = @bindir@ |
| 44 | libdir = @libdir@ |
| 45 | mandir = @mandir@ |
| 46 | includedir = @includedir@ |
| 47 | |
| 48 | infodir = @infodir@ |
| 49 | |
| 50 | man3dir = $(mandir)/man3 |
| 51 | |
| 52 | # Programs to make tags files. |
| 53 | ETAGS = etags -tw |
| 54 | CTAGS = ctags -tw |
| 55 | |
| 56 | CFLAGS = @CFLAGS@ |
| 57 | LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"' |
| 58 | CPPFLAGS = @CPPFLAGS@ |
| 59 | |
| 60 | DEFS = @DEFS@ |
| 61 | LOCAL_DEFS = @LOCAL_DEFS@ |
| 62 | |
| 63 | # For libraries which include headers from other libraries. |
| 64 | INCLUDES = -I. -I$(srcdir) -I$(includedir) |
| 65 | |
| 66 | CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES) $(LOCAL_CFLAGS) $(CFLAGS) |
| 67 | |
| 68 | .c.o: |
| 69 | ${RM} $@ |
| 70 | $(CC) -c $(CCFLAGS) $< |
| 71 | |
| 72 | # The name of the main library target. |
| 73 | LIBRARY_NAME = libreadline.a |
| 74 | STATIC_LIBS = libreadline.a libhistory.a |
| 75 | |
| 76 | # The C code source files for this library. |
| 77 | CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \ |
| 78 | $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \ |
| 79 | $(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \ |
| 80 | $(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \ |
| 81 | $(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \ |
| 82 | $(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \ |
| 83 | $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \ |
| 84 | $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \ |
| 85 | $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \ |
| 86 | $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c |
| 87 | |
| 88 | # The header files for this library. |
| 89 | HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \ |
| 90 | posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \ |
| 91 | ansi_stdlib.h tcap.h rlstdc.h |
| 92 | |
| 93 | HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o |
| 94 | TILDEOBJ = tilde.o |
| 95 | OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \ |
| 96 | rltty.o complete.o bind.o isearch.o display.o signals.o \ |
| 97 | util.o kill.o undo.o macro.o input.o callback.o terminal.o \ |
| 98 | nls.o xmalloc.o $(HISTOBJ) $(TILDEOBJ) |
| 99 | |
| 100 | # The texinfo files which document this library. |
| 101 | DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo |
| 102 | DOCOBJECT = doc/readline.dvi |
| 103 | DOCSUPPORT = doc/Makefile |
| 104 | DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT) |
| 105 | |
| 106 | CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile shlib/Makefile |
| 107 | CREATED_CONFIGURE = config.status config.h config.cache config.log \ |
| 108 | stamp-config stamp-h |
| 109 | CREATED_TAGS = TAGS tags |
| 110 | |
| 111 | INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \ |
| 112 | rlstdc.h rlconf.h |
| 113 | |
| 114 | ########################################################################## |
| 115 | |
| 116 | all: static |
| 117 | |
| 118 | static: $(STATIC_LIBS) |
| 119 | |
| 120 | libreadline.a: $(OBJECTS) |
| 121 | $(RM) $@ |
| 122 | $(AR) $(ARFLAGS) $@ $(OBJECTS) |
| 123 | -test -n "$(RANLIB)" && $(RANLIB) $@ |
| 124 | |
| 125 | libhistory.a: $(HISTOBJ) xmalloc.o |
| 126 | $(RM) $@ |
| 127 | $(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o |
| 128 | -test -n "$(RANLIB)" && $(RANLIB) $@ |
| 129 | |
| 130 | readline: $(OBJECTS) readline.h rldefs.h chardefs.h |
| 131 | $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a -ltermcap |
| 132 | |
| 133 | Makefile makefile: config.status $(srcdir)/Makefile.in |
| 134 | CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status |
| 135 | |
| 136 | Makefiles makefiles: config.status $(srcdir)/Makefile.in |
| 137 | @for mf in $(CREATED_MAKEFILES); do \ |
| 138 | CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \ |
| 139 | done |
| 140 | |
| 141 | config.status: configure |
| 142 | $(SHELL) ./config.status --recheck |
| 143 | |
| 144 | config.h: stamp-h |
| 145 | |
| 146 | stamp-h: config.status $(srcdir)/config.h.in |
| 147 | CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status |
| 148 | echo > $@ |
| 149 | |
| 150 | $(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution |
| 151 | cd $(srcdir) && autoconf ## Comment-me-out in distribution |
| 152 | |
| 153 | |
| 154 | shared: force |
| 155 | -test -d shlib || mkdir shlib |
| 156 | -( cd shlib ; ${MAKE} ${MFLAGS} all ) |
| 157 | |
| 158 | documentation: force |
| 159 | -test -d doc || mkdir doc |
| 160 | -( cd doc && $(MAKE) $(MFLAGS) ) |
| 161 | |
| 162 | examples: force |
| 163 | -test -d examples || mkdir examples |
| 164 | -(cd examples && ${MAKE} ${MFLAGS} all ) |
| 165 | |
| 166 | force: |
| 167 | |
| 168 | install: installdirs $(STATIC_LIBS) |
| 169 | for f in ${INSTALLED_HEADERS}; do \ |
| 170 | $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \ |
| 171 | done |
| 172 | -$(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old |
| 173 | $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a |
| 174 | -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libreadline.a |
| 175 | -$(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old |
| 176 | $(INSTALL_DATA) libhistory.a $(libdir)/libhistory.a |
| 177 | -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libhistory.a |
| 178 | -( if test -d doc ; then \ |
| 179 | cd doc && \ |
| 180 | ${MAKE} ${MFLAGS} infodir=$(infodir) $@; \ |
| 181 | fi ) |
| 182 | |
| 183 | installdirs: $(srcdir)/support/mkdirs |
| 184 | -$(SHELL) $(srcdir)/support/mkdirs $(includedir) \ |
| 185 | $(includedir)/readline $(libdir) $(infodir) $(man3dir) |
| 186 | |
| 187 | uninstall: |
| 188 | -test -n "$(includedir)" && cd $(includedir)/readline && \ |
| 189 | ${RM} ${INSTALLED_HEADERS} |
| 190 | -test -n "$(libdir)" && cd $(libdir) && \ |
| 191 | ${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS) |
| 192 | |
| 193 | install-shared: installdirs shared |
| 194 | -( cd shlib ; ${MAKE} ${MFLAGS} install ) |
| 195 | |
| 196 | uninstall-shared: |
| 197 | -( cd shlib; ${MAKE} ${MFLAGS} uninstall ) |
| 198 | |
| 199 | TAGS: force |
| 200 | $(ETAGS) $(CSOURCES) $(HSOURCES) |
| 201 | |
| 202 | tags: force |
| 203 | $(CTAGS) $(CSOURCES) $(HSOURCES) |
| 204 | |
| 205 | clean: force |
| 206 | $(RM) $(OBJECTS) $(STATIC_LIBS) |
| 207 | -( cd shlib && $(MAKE) $(MFLAGS) $@ ) |
| 208 | -( cd doc && $(MAKE) $(MFLAGS) $@ ) |
| 209 | -( cd examples && $(MAKE) $(MFLAGS) $@ ) |
| 210 | |
| 211 | mostlyclean: clean |
| 212 | -( cd shlib && $(MAKE) $(MFLAGS) $@ ) |
| 213 | -( cd doc && $(MAKE) $(MFLAGS) $@ ) |
| 214 | -( cd examples && $(MAKE) $(MFLAGS) $@ ) |
| 215 | |
| 216 | distclean maintainer-clean: clean |
| 217 | -( cd shlib && $(MAKE) $(MFLAGS) $@ ) |
| 218 | -( cd doc && $(MAKE) $(MFLAGS) $@ ) |
| 219 | -( cd examples && $(MAKE) $(MFLAGS) $@ ) |
| 220 | $(RM) Makefile |
| 221 | $(RM) $(CREATED_CONFIGURE) |
| 222 | $(RM) $(CREATED_TAGS) |
| 223 | |
| 224 | info dvi: |
| 225 | -( cd doc && $(MAKE) $(MFLAGS) $@ ) |
| 226 | |
| 227 | install-info: |
| 228 | check: |
| 229 | installcheck: |
| 230 | |
| 231 | dist: force |
| 232 | @echo Readline distributions are created using $(srcdir)/support/mkdist. |
| 233 | @echo Here is a sample of the necessary commands: |
| 234 | @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION) |
| 235 | @echo tar cf $(RL_LIBRARY_NAME)-${RL_LIBRARY_VERSION}.tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION) |
| 236 | @echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar |
| 237 | |
| 238 | # Tell versions [3.59,3.63) of GNU make not to export all variables. |
| 239 | # Otherwise a system limit (for SysV at least) may be exceeded. |
| 240 | .NOEXPORT: |
| 241 | |
| 242 | # Dependencies |
| 243 | bind.o: ansi_stdlib.h posixstat.h |
| 244 | bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 245 | bind.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h |
| 246 | bind.o: history.h |
| 247 | callback.o: rlconf.h |
| 248 | callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 249 | callback.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h |
| 250 | complete.o: ansi_stdlib.h posixdir.h posixstat.h |
| 251 | complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 252 | complete.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h |
| 253 | display.o: ansi_stdlib.h posixstat.h |
| 254 | display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 255 | display.o: tcap.h |
| 256 | display.o: readline.h keymaps.h chardefs.h tilde.h |
| 257 | display.o: history.h rlstdc.h |
| 258 | funmap.o: readline.h keymaps.h chardefs.h tilde.h |
| 259 | funmap.o: rlconf.h ansi_stdlib.h rlstdc.h |
| 260 | funmap.o: ${BUILD_DIR}/config.h |
| 261 | histexpand.o: ansi_stdlib.h |
| 262 | histexpand.o: history.h histlib.h rlstdc.h |
| 263 | histexpand.o: ${BUILD_DIR}/config.h |
| 264 | histfile.o: ansi_stdlib.h |
| 265 | histfile.o: history.h histlib.h rlstdc.h |
| 266 | histfile.o: ${BUILD_DIR}/config.h |
| 267 | history.o: ansi_stdlib.h |
| 268 | history.o: history.h histlib.h rlstdc.h |
| 269 | history.o: ${BUILD_DIR}/config.h |
| 270 | histsearch.o: ansi_stdlib.h |
| 271 | histsearch.o: history.h histlib.h rlstdc.h |
| 272 | histsearch.o: ${BUILD_DIR}/config.h |
| 273 | input.o: ansi_stdlib.h |
| 274 | input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 275 | input.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h |
| 276 | isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 277 | isearch.o: readline.h keymaps.h chardefs.h tilde.h |
| 278 | isearch.o: ansi_stdlib.h history.h rlstdc.h |
| 279 | keymaps.o: emacs_keymap.c vi_keymap.c |
| 280 | keymaps.o: keymaps.h chardefs.h rlconf.h ansi_stdlib.h |
| 281 | keymaps.o: readline.h keymaps.h chardefs.h tilde.h |
| 282 | keymaps.o: ${BUILD_DIR}/config.h rlstdc.h |
| 283 | kill.o: ansi_stdlib.h |
| 284 | kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 285 | kill.o: readline.h keymaps.h chardefs.h tilde.h |
| 286 | kill.o: history.h rlstdc.h |
| 287 | macro.o: ansi_stdlib.h |
| 288 | macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 289 | macro.o: readline.h keymaps.h chardefs.h tilde.h |
| 290 | macro.o: history.h rlstdc.h |
| 291 | nls.o: ansi_stdlib.h |
| 292 | nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 293 | parens.o: rlconf.h |
| 294 | parens.o: ${BUILD_DIR}/config.h |
| 295 | parens.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h |
| 296 | readline.o: readline.h keymaps.h chardefs.h tilde.h |
| 297 | readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 298 | readline.o: history.h rlstdc.h |
| 299 | readline.o: posixstat.h ansi_stdlib.h posixjmp.h |
| 300 | rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 301 | rltty.o: rltty.h |
| 302 | rltty.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h |
| 303 | search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 304 | search.o: readline.h keymaps.h chardefs.h tilde.h |
| 305 | search.o: ansi_stdlib.h history.h rlstdc.h |
| 306 | shell.o: ${BUILD_DIR}/config.h |
| 307 | shell.o: ansi_stdlib.h |
| 308 | signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 309 | signals.o: readline.h keymaps.h chardefs.h tilde.h |
| 310 | signals.o: history.h rlstdc.h |
| 311 | terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 312 | terminal.o: tcap.h |
| 313 | terminal.o: readline.h keymaps.h chardefs.h tilde.h |
| 314 | terminal.o: history.h rlstdc.h |
| 315 | tilde.o: ansi_stdlib.h |
| 316 | tilde.o: ${BUILD_DIR}/config.h |
| 317 | tilde.o: tilde.h |
| 318 | undo.o: ansi_stdlib.h |
| 319 | undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 320 | undo.o: readline.h keymaps.h chardefs.h tilde.h |
| 321 | undo.o: history.h rlstdc.h |
| 322 | util.o: posixjmp.h ansi_stdlib.h |
| 323 | util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 324 | util.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h |
| 325 | vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h |
| 326 | vi_mode.o: readline.h keymaps.h chardefs.h tilde.h |
| 327 | vi_mode.o: history.h ansi_stdlib.h rlstdc.h |
| 328 | xmalloc.o: ${BUILD_DIR}/config.h |
| 329 | xmalloc.o: ansi_stdlib.h |
| 330 | |
| 331 | readline.o: $(srcdir)/readline.c |
| 332 | vi_mode.o: $(srcdir)/vi_mode.c |
| 333 | funmap.o: $(srcdir)/funmap.c |
| 334 | keymaps.o: $(srcdir)/keymaps.c |
| 335 | parens.o: $(srcdir)/parens.c |
| 336 | search.o: $(srcdir)/search.c |
| 337 | rltty.o: $(srcdir)/rltty.c |
| 338 | complete.o: $(srcdir)/complete.c |
| 339 | bind.o: $(srcdir)/bind.c |
| 340 | isearch.o: $(srcdir)/isearch.c |
| 341 | display.o: $(srcdir)/display.c |
| 342 | signals.o: $(srcdir)/signals.c |
| 343 | util.o: $(srcdir)/util.c |
| 344 | kill.o: $(srcdir)/kill.c |
| 345 | undo.o: $(srcdir)/undo.c |
| 346 | macro.o: $(srcdir)/macro.c |
| 347 | input.o: $(srcdir)/input.c |
| 348 | callback.o: $(srcdir)/callback.c |
| 349 | terminal.o: $(srcdir)/terminal.c |
| 350 | nls.o: $(srcdir)/nls.c |
| 351 | xmalloc.o: $(srcdir)/xmalloc.c |
| 352 | history.o: $(srcdir)/history.c |
| 353 | histexpand.o: $(srcdir)/histexpand.c |
| 354 | histfile.o: $(srcdir)/histfile.c |
| 355 | histsearch.o: $(srcdir)/histsearch.c |
| 356 | savestring.o: $(srcdir)/savestring.c |
| 357 | shell.o: $(srcdir)/shell.c |
| 358 | tilde.o: $(srcdir)/tilde.c |
| 359 | |
| 360 | readline.o: readline.c |
| 361 | vi_mode.o: vi_mode.c |
| 362 | funmap.o: funmap.c |
| 363 | keymaps.o: keymaps.c |
| 364 | parens.o: parens.c |
| 365 | search.o: search.c |
| 366 | rltty.o: rltty.c |
| 367 | complete.o: complete.c |
| 368 | bind.o: bind.c |
| 369 | isearch.o: isearch.c |
| 370 | display.o: display.c |
| 371 | signals.o: signals.c |
| 372 | util.o: util.c |
| 373 | kill.o: kill.c |
| 374 | undo.o: undo.c |
| 375 | macro.o: macro.c |
| 376 | input.o: input.c |
| 377 | callback.o: callback.c |
| 378 | terminal.o: terminal.c |
| 379 | nls.o: nls.c |
| 380 | xmalloc.o: xmalloc.c |
| 381 | history.o: history.c |
| 382 | histexpand.o: histexpand.c |
| 383 | histfile.o: histfile.c |
| 384 | histsearch.o: histsearch.c |
| 385 | savestring.o: savestring.c |
| 386 | shell.o: shell.c |
| 387 | tilde.o: tilde.c |