# Generated automatically from Makefile.in by configure.
## -*- text -*- ##
# Master Makefile for the GNU readline library.
# Copyright (C) 1994, 1998 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
RL_LIBRARY_VERSION = 4.3
RL_LIBRARY_NAME = readline

srcdir = ..
VPATH = ..
top_srcdir = ..
BUILD_DIR = .

INSTALL = install -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644

CC = gcc -mno-cygwin
AR = ar
ARFLAGS = rcs
RM = rm -f
CP = cp
MV = mv

ifeq ($(DLL),0)
  TARGET = static
  LOCAL_CFLAGS = -DREADLINE_STATIC
else
  TARGET = shared
  DLL = 1
endif

SHELL = /bin/sh

prefix = /usr/local
exec_prefix = $(prefix)

bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
mandir = $(prefix)/man
includedir = $(prefix)/include

infodir = $(prefix)/info

man3dir = $(mandir)/man3

# Programs to make tags files.
ETAGS = etags -tw
CTAGS = ctags -tw

CFLAGS = -Os
CPPFLAGS = 

DEFS = -DHAVE_CONFIG_H
LOCAL_DEFS = 

# For libraries which include headers from other libraries.
INCLUDES = -I. -I$(srcdir)

CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES) $(LOCAL_CFLAGS) $(CFLAGS)

.c.o:
	$(CC) -c $(CCFLAGS) $<

# The name of the main library target.
LIBRARY_NAME = libreadline-static.a
STATIC_LIBS = libreadline-static.a libhistory-static.a

# The C code source files for this library.
CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
	   $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
	   $(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \
	   $(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \
	   $(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \
	   $(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \
	   $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
	   $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
	   $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
	   $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c

# The header files for this library.
HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
	   posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
	   ansi_stdlib.h tcap.h rlstdc.h rldynlink.h

HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o 
TILDEOBJ = tilde.o
OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
	  rltty.o complete.o bind.o isearch.o display.o signals.o \
	  util.o kill.o undo.o macro.o input.o callback.o terminal.o \
	  text.o nls.o mbutil.o misc.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)

# The texinfo files which document this library.
DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
DOCOBJECT = doc/readline.dvi
DOCSUPPORT = doc/Makefile
DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)

CREATED_MAKEFILES = Makefile doc/Makefile examples/Makefile shlib/Makefile
CREATED_CONFIGURE = config.status config.h config.cache config.log \
		    stamp-config stamp-h
CREATED_TAGS = TAGS tags

INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
		    rlstdc.h rlconf.h rldynlink.h rltypedefs.h

##########################################################################

all: $(TARGET)

install: install-$(TARGET)

uninstall: uninstall-$(TARGET)

static: $(STATIC_LIBS)

libreadline-static.a: $(OBJECTS)
	$(RM) $@
	$(AR) $(ARFLAGS) $@ $(OBJECTS)

libhistory-static.a: $(HISTOBJ) xmalloc.o
	$(RM) $@
	$(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o

readline: $(OBJECTS) readline.h rldefs.h chardefs.h
	$(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline-static.a 

shared:	force
	-test -d shlib || mkdir shlib
	-( cd shlib ; $(MAKE) $(MFLAGS) all )

documentation: force
	-test -d doc || mkdir doc
	-( cd doc && $(MAKE) $(MFLAGS) )

examples: force
	-test -d examples || mkdir examples
	-(cd examples && $(MAKE) DLL=$(DLL) $(MFLAGS) all )

force:

install-static: installdirs $(STATIC_LIBS)
	for f in $(INSTALLED_HEADERS); do \
		$(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \
	done
	$(INSTALL_DATA) libreadline-static.a $(libdir)/libreadline-static.a
	$(INSTALL_DATA) libhistory-static.a $(libdir)/libhistory-static.a

installdirs: $(srcdir)/support/mkdirs
	-$(SHELL) $(srcdir)/support/mkdirs $(includedir) \
		$(includedir)/readline $(libdir) $(infodir) $(man3dir)

uninstall-static:
	-test -n "$(includedir)" && cd $(includedir)/readline && \
		$(RM) $(INSTALLED_HEADERS)
	-test -n "$(libdir)" && cd $(libdir) && \
		$(RM) libreadline-static.a libreadline-static.old libhistory-static.a libhistory-static.old $(SHARED_LIBS)

install-shared: installdirs shared
	-( cd shlib ; $(MAKE) $(MFLAGS) install )

uninstall-shared:
	-( cd shlib; $(MAKE) $(MFLAGS) uninstall )

TAGS:	force
	$(ETAGS) $(CSOURCES) $(HSOURCES)

tags:	force
	$(CTAGS) $(CSOURCES) $(HSOURCES)

clean:	force
	$(RM) *.o *~ $(STATIC_LIBS)
	-( cd shlib && $(MAKE) $(MFLAGS) $@ )
#	-( cd doc && $(MAKE) $(MFLAGS) $@ )
	-( cd examples && $(MAKE) $(MFLAGS) $@ )

info dvi:
	-( cd doc && $(MAKE) $(MFLAGS) $@ )

install-info:
check:
installcheck:

dist:   force
	@echo Readline distributions are created using $(srcdir)/support/mkdist.
	@echo Here is a sample of the necessary commands:
	@echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION)
	@echo tar cf $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION)
	@echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar

# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

# Dependencies
bind.o: ansi_stdlib.h posixstat.h
bind.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
bind.o: readline.h keymaps.h chardefs.h
bind.o: tilde.h history.h rldynlink.h
callback.o: rlconf.h
callback.o: rldefs.h $(BUILD_DIR)/config.h
callback.o: readline.h keymaps.h chardefs.h
callback.o: tilde.h rldynlink.h
complete.o: ansi_stdlib.h posixdir.h posixstat.h
complete.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
complete.o: readline.h keymaps.h chardefs.h
complete.o: tilde.h rldynlink.h
display.o: ansi_stdlib.h posixstat.h
display.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
display.o: tcap.h
display.o: readline.h keymaps.h chardefs.h
display.o: tilde.h history.h rldynlink.h
funmap.o: readline.h keymaps.h chardefs.h
funmap.o: rlconf.h ansi_stdlib.h
funmap.o: $(BUILD_DIR)/config.h tilde.h rldynlink.h
histexpand.o: ansi_stdlib.h
histexpand.o: history.h histlib.h
histexpand.o: $(BUILD_DIR)/config.h rldynlink.h
histfile.o: ansi_stdlib.h
histfile.o: history.h histlib.h
histfile.o: $(BUILD_DIR)/config.h
history.o: ansi_stdlib.h
history.o: history.h histlib.h
history.o: $(BUILD_DIR)/config.h rldynlink.h
histsearch.o: ansi_stdlib.h
histsearch.o: history.h histlib.h
histsearch.o: $(BUILD_DIR)/config.h rldynlink.h
input.o: ansi_stdlib.h
input.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
input.o: readline.h keymaps.h chardefs.h
input.o: tilde.h rldynlink.h
isearch.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
isearch.o: readline.h keymaps.h chardefs.h
isearch.o: ansi_stdlib.h history.h tilde.h
isearch.o: rldynlink.h
keymaps.o: emacs_keymap.c vi_keymap.c
keymaps.o: keymaps.h chardefs.h rlconf.h
keymaps.o: readline.h keymaps.h chardefs.h
keymaps.o: $(BUILD_DIR)/config.h ansi_stdlib.h tilde.h
keymaps.o: rldynlink.h
kill.o: ansi_stdlib.h
kill.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
kill.o: readline.h keymaps.h chardefs.h
kill.o: tilde.h history.h rldynlink.h
macro.o: ansi_stdlib.h
macro.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
macro.o: readline.h keymaps.h chardefs.h
macro.o: tilde.h history.h rldynlink.h
nls.o: ansi_stdlib.h
nls.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
parens.o: rlconf.h $(BUILD_DIR)/config.h
parens.o: readline.h keymaps.h chardefs.h
parens.o: tilde.h rldynlink.h
readline.o: readline.h keymaps.h chardefs.h
readline.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
readline.o: history.h tilde.h rldynlink.h
readline.o: posixstat.h ansi_stdlib.h posixjmp.h
rltty.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
rltty.o: rltty.h tilde.h rldynlink.h
rltty.o: readline.h keymaps.h chardefs.h
search.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
search.o: readline.h keymaps.h chardefs.h
search.o: ansi_stdlib.h history.h tilde.h
search.o: rldynlink.h
signals.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
signals.o: readline.h keymaps.h chardefs.h
signals.o: history.h tilde.h rldynlink.h
terminal.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
terminal.o: tcap.h
terminal.o: readline.h keymaps.h chardefs.h
terminal.o: tilde.h history.h rldynlink.h
tilde.o: ansi_stdlib.h $(BUILD_DIR)/config.h tilde.h
tilde.o: rldynlink.h
undo.o: ansi_stdlib.h
undo.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
undo.o: readline.h keymaps.h chardefs.h
undo.o: tilde.h history.h rldynlink.h
util.o: posixjmp.h ansi_stdlib.h
util.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
util.o: readline.h keymaps.h chardefs.h
util.o: tilde.h rldynlink.h
vi_mode.o: rldefs.h $(BUILD_DIR)/config.h rlconf.h
vi_mode.o: readline.h keymaps.h chardefs.h
vi_mode.o: history.h ansi_stdlib.h tilde.h
vi_mode.o: rldynlink.h
xmalloc.o: $(BUILD_DIR)/config.h
xmalloc.o: ansi_stdlib.h

readline.o: $(srcdir)/readline.c
vi_mode.o: $(srcdir)/vi_mode.c
funmap.o: $(srcdir)/funmap.c
keymaps.o: $(srcdir)/keymaps.c
parens.o: $(srcdir)/parens.c
search.o: $(srcdir)/search.c
rltty.o: $(srcdir)/rltty.c
complete.o: $(srcdir)/complete.c
bind.o: $(srcdir)/bind.c
isearch.o: $(srcdir)/isearch.c
display.o: $(srcdir)/display.c
signals.o: $(srcdir)/signals.c
util.o: $(srcdir)/util.c
kill.o: $(srcdir)/kill.c
undo.o: $(srcdir)/undo.c
macro.o: $(srcdir)/macro.c
input.o: $(srcdir)/input.c
callback.o: $(srcdir)/callback.c
terminal.o: $(srcdir)/terminal.c
nls.o: $(srcdir)/nls.c
xmalloc.o: $(srcdir)/xmalloc.c
history.o: $(srcdir)/history.c
histexpand.o: $(srcdir)/histexpand.c
histfile.o: $(srcdir)/histfile.c
histsearch.o: $(srcdir)/histsearch.c
savestring.o: $(srcdir)/savestring.c
shell.o: $(srcdir)/shell.c
tilde.o: $(srcdir)/tilde.c

readline.o: readline.c
vi_mode.o: vi_mode.c
funmap.o: funmap.c
keymaps.o: keymaps.c
parens.o: parens.c
search.o: search.c
rltty.o: rltty.c
complete.o: complete.c
bind.o: bind.c
isearch.o: isearch.c
display.o: display.c
signals.o: signals.c
util.o: util.c
kill.o: kill.c
undo.o: undo.c
macro.o: macro.c
input.o: input.c
callback.o: callback.c
terminal.o: terminal.c
nls.o: nls.c
xmalloc.o: xmalloc.c
history.o: history.c
histexpand.o: histexpand.c
histfile.o: histfile.c
histsearch.o: histsearch.c
savestring.o: savestring.c
shell.o: shell.c
tilde.o: tilde.c
