1 ## -*- text -*- ####################################################
3 # Makefile for the GNU Readline and History Libraries. #
5 ####################################################################
10 BUILD_DIR = @BUILD_DIR@
13 INSTALL_PROGRAM = @INSTALL_PROGRAM@
14 INSTALL_DATA = @INSTALL_DATA@
23 # See the file STANDALONE for the -D defines that readline understands
26 LOCAL_CFLAGS = @LOCAL_CFLAGS@
32 INCLUDES = -I. -I$(BUILD_DIR) -I$(topdir) -I$(topdir)/lib
34 CCFLAGS = $(DEFS) $(APP_CFLAGS) $(CPPFLAGS) ${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS)
36 # Here is a rule for making .o files from .c files that doesn't force
37 # the type of the machine (like -sun3) into the flags.
39 $(CC) -c $(CCFLAGS) $<
41 # The name of the main library target.
42 LIBRARY_NAME = libreadline.a
44 # The C code source files for this library.
45 CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
46 $(srcdir)/vi_mode.c $(srcdir)/parens.c $(srcdir)/rltty.c \
47 $(srcdir)/complete.c $(srcdir)/bind.c $(srcdir)/isearch.c \
48 $(srcdir)/display.c $(srcdir)/signals.c $(srcdir)/emacs_keymap.c \
49 $(srcdir)/vi_keymap.c $(srcdir)/util.c $(srcdir)/kill.c \
50 $(srcdir)/undo.c $(srcdir)/macro.c $(srcdir)/input.c \
51 $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
52 $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
53 $(srcdir)/histfile.c $(srcdir)/nls.c \
56 # The header files for this library.
57 HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
58 posixstat.h tilde.h rlconf.h tcap.h
60 HISTOBJ = history.o histexpand.o histfile.o histsearch.o
62 OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
63 rltty.o complete.o bind.o isearch.o display.o signals.o \
64 util.o kill.o undo.o macro.o input.o callback.o terminal.o \
66 $(HISTOBJ) $(TILDEOBJ)
68 # The texinfo files which document this library.
69 DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
70 DOCOBJECT = doc/readline.dvi
71 DOCSUPPORT = doc/Makefile
72 DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
74 SUPPORT = Makefile ChangeLog $(DOCSUPPORT) examples/[-a-z.]*
76 SOURCES = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
78 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
80 INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h
82 ##########################################################################
84 all: libreadline.a libhistory.a
86 libreadline.a: $(OBJECTS)
88 $(AR) cr $@ $(OBJECTS)
89 -test -n "$(RANLIB)" && $(RANLIB) $@
91 libhistory.a: $(HISTOBJ) xmalloc.o
93 $(AR) cr $@ $(HISTOBJ) xmalloc.o
94 -test -n "$(RANLIB)" && $(RANLIB) $@
97 test -d doc || mkdir doc
98 -( cd doc && $(MAKE) $(MFLAGS) )
102 # The rule for 'includes' is written funny so that the if statement
103 # always returns TRUE unless there really was an error installing the
105 install: installdirs libreadline.a
106 for file in $(INSTALLED_HEADERS) ; do \
107 $(INSTALL_DATA) $(srcdir)/$$file $(includedir)/readline ; \
109 -${MV} $(libdir)/libreadline.a $(libdir)/libreadline.old
110 ${INSTALL_DATA} libreadline.a $(libdir)/libreadline.a
111 -test -n "$(RANLIB)" && $(RANLIB) -t $(bindir)/libreadline.a
113 installdirs: $(topdir)/support/mkdirs
114 $(SHELL) $(topdir)/support/mkdirs $(includedir) \
115 $(includedir)/readline $(libdir) $(infodir) $(man3dir)
118 cd $(includedir)/readline && ${RM} -f ${INSTALLED_HEADERS}
119 cd $(libdir) && ${RM} -f libreadline.a libreadline.old
122 etags $(CSOURCES) $(HSOURCES)
125 ctags -x $(CSOURCES) $(HSOURCES) > $@
127 readline: readline.h rldefs.h chardefs.h
129 $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
130 $(LOCAL_INCLUDES) -DTEST -o readline readline.c vi_mode.o funmap.o \
135 -( cd doc && $(MAKE) $(MFLAGS) $@ )
137 distclean realclean maintainer-clean: clean
138 -( cd doc && $(MAKE) $(MFLAGS) $@ )
142 -( cd doc && $(MAKE) $(MFLAGS) $@ )
145 readline.o: readline.c readline.h rldefs.h rlconf.h chardefs.h tcap.h
146 readline.o: keymaps.h history.h
147 vi_mode.o: rldefs.h rlconf.h readline.h history.h
148 funmap.o: funmap.c readline.h rlconf.h
149 keymaps.o: keymaps.c emacs_keymap.c vi_keymap.c keymaps.h chardefs.h rlconf.h
150 history.o: history.h histlib.h
151 histexpand.o: history.h histlib.h
152 histsearch.o: history.h histlib.h
153 histfile.o: history.h histlib.h
154 isearch.o: readline.h history.h
155 search.o: readline.h history.h
156 display.o: readline.h history.h rldefs.h rlconf.h tcap.h
157 complete.o: readline.h rldefs.h rlconf.h posixdir.h posixstat.h
158 rltty.o: rldefs.h rlconf.h readline.h rltty.h
159 bind.o: rldefs.h rlconf.h readline.h history.h
160 signals.o: rldefs.h rlconf.h readline.h history.h
162 kill.o: rldefs.h rlconf.h readline.h history.h
163 macro.o: rldefs.h rlconf.h readline.h history.h
164 undo.o: rldefs.h rlconf.h readline.h history.h
165 input.o: rldefs.h rlconf.h readline.h history.h
166 callback.o: rlconf.h rldefs.h readline.h
167 terminal.o: rlconf.h rldefs.h readline.h tcap.h history.h
169 bind.o: $(BUILD_DIR)/config.h
170 callback.o: $(BUILD_DIR)/config.h
171 complete.o: $(BUILD_DIR)/config.h
172 display.o: $(BUILD_DIR)/config.h
173 funmap.o: $(BUILD_DIR)/config.h
174 histexpand.o: $(BUILD_DIR)/config.h
175 histfile.o: $(BUILD_DIR)/config.h
176 history.o: $(BUILD_DIR)/config.h
177 histsearch.o: $(BUILD_DIR)/config.h
178 input.o: $(BUILD_DIR)/config.h
179 isearch.o: $(BUILD_DIR)/config.h
180 keymaps.o: $(BUILD_DIR)/config.h
181 kill.o: $(BUILD_DIR)/config.h
182 macro.o: $(BUILD_DIR)/config.h
183 parens.o: $(BUILD_DIR)/config.h
184 readline.o: $(BUILD_DIR)/config.h
185 rltty.o: $(BUILD_DIR)/config.h
186 search.o: $(BUILD_DIR)/config.h
187 signals.o: $(BUILD_DIR)/config.h
188 tilde.o: $(BUILD_DIR)/config.h
189 undo.o: $(BUILD_DIR)/config.h
190 util.o: $(BUILD_DIR)/config.h
191 vi_mode.o: $(BUILD_DIR)/config.h
192 xmalloc.o: $(BUILD_DIR)/config.h