c5ac183cf0cc2da4ff7fbce86c1e2dcdcf044a79
[platform/upstream/bash.git] / lib / readline / Makefile.in
1 ## -*- text -*- ####################################################
2 #                                                                  #
3 # Makefile for the GNU Readline and History Libraries.             #
4 #                                                                  #
5 ####################################################################
6
7 srcdir = @srcdir@
8 VPATH = .:@srcdir@
9 topdir = @top_srcdir@
10 BUILD_DIR = @BUILD_DIR@
11
12 INSTALL = @INSTALL@
13 INSTALL_PROGRAM = @INSTALL_PROGRAM@
14 INSTALL_DATA = @INSTALL_DATA@
15
16 CC = @CC@
17 RANLIB = @RANLIB@
18 AR = @AR@
19 RM = rm -f
20 CP = cp
21 MV = mv
22
23 # See the file STANDALONE for the -D defines that readline understands
24
25 CFLAGS = @CFLAGS@
26 LOCAL_CFLAGS = @LOCAL_CFLAGS@
27 CPPFLAGS = @CPPFLAGS@
28 LDFLAGS = @LDFLAGS@
29
30 DEFS = @DEFS@
31
32 INCLUDES = -I. -I$(BUILD_DIR) -I$(topdir) -I$(topdir)/lib
33
34 CCFLAGS = $(DEFS) $(APP_CFLAGS) $(CPPFLAGS) ${INCLUDES} $(LOCAL_CFLAGS) $(CFLAGS)
35
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.
38 .c.o:
39         $(CC) -c $(CCFLAGS) $<
40
41 # The name of the main library target.
42 LIBRARY_NAME = libreadline.a
43
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 \
54            $(srcdir)/tilde.c \
55
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
59
60 HISTOBJ = history.o histexpand.o histfile.o histsearch.o
61 TILDEOBJ= tilde.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 \
65           nls.o xmalloc.o \
66           $(HISTOBJ) $(TILDEOBJ)
67
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)
73
74 SUPPORT = Makefile ChangeLog $(DOCSUPPORT) examples/[-a-z.]*
75
76 SOURCES  = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
77
78 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
79
80 INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h
81
82 ##########################################################################
83
84 all: libreadline.a libhistory.a
85
86 libreadline.a: $(OBJECTS)
87         $(RM) -f $@
88         $(AR) cr $@ $(OBJECTS)
89         -test -n "$(RANLIB)" && $(RANLIB) $@
90
91 libhistory.a: $(HISTOBJ) xmalloc.o
92         $(RM) -f $@
93         $(AR) cr $@ $(HISTOBJ) xmalloc.o
94         -test -n "$(RANLIB)" && $(RANLIB) $@
95
96 documentation: force
97         test -d doc || mkdir doc
98         -( cd doc && $(MAKE) $(MFLAGS) )
99
100 force:
101
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
104 # include files.
105 install: installdirs libreadline.a
106         for file in $(INSTALLED_HEADERS) ; do \
107                 $(INSTALL_DATA) $(srcdir)/$$file $(includedir)/readline ; \
108         done
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
112
113 installdirs:    $(topdir)/support/mkdirs
114         $(SHELL) $(topdir)/support/mkdirs $(includedir) \
115                 $(includedir)/readline $(libdir) $(infodir) $(man3dir)
116
117 uninstall:
118         cd $(includedir)/readline && ${RM} -f ${INSTALLED_HEADERS}
119         cd $(libdir) && ${RM} -f libreadline.a libreadline.old
120
121 tags:   force
122         etags $(CSOURCES) $(HSOURCES)
123
124 TAGS:   force
125         ctags -x $(CSOURCES) $(HSOURCES) > $@
126
127 readline: readline.h rldefs.h chardefs.h
128 readline: $(OBJECTS)
129         $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
130           $(LOCAL_INCLUDES) -DTEST -o readline readline.c vi_mode.o funmap.o \
131           keymaps.o -ltermcap
132
133 clean:  force
134         $(RM) $(OBJECTS) *.a
135         -( cd doc && $(MAKE) $(MFLAGS) $@ )
136
137 distclean realclean maintainer-clean: clean
138         -( cd doc && $(MAKE) $(MFLAGS) $@ )
139         $(RM) Makefile
140
141 mostlyclean: clean
142         -( cd doc && $(MAKE) $(MFLAGS) $@ )
143
144 # Dependencies
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
161 parens.o: readline.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
168
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