3 # Copyright (C) 1990, 1991, 1992 Free Software Foundation
5 # This file 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 of the License, or
8 # (at your option) any later version.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
21 # Makefile for readline and history libraries.
28 exec_prefix = $(prefix)
29 bindir = $(exec_prefix)/bin
30 libdir = $(exec_prefix)/lib
32 datadir = $(prefix)/lib
33 mandir = $(prefix)/man
34 man1dir = $(mandir)/man1
35 man2dir = $(mandir)/man2
36 man3dir = $(mandir)/man3
37 man4dir = $(mandir)/man4
38 man5dir = $(mandir)/man5
39 man6dir = $(mandir)/man6
40 man7dir = $(mandir)/man7
41 man8dir = $(mandir)/man8
42 man9dir = $(mandir)/man9
43 infodir = $(prefix)/info
44 includedir = $(prefix)/include
45 docdir = $(datadir)/doc
50 INSTALL_PROGRAM = $(INSTALL)
51 INSTALL_DATA = $(INSTALL)
60 # Define TYPES as -DVOID_SIGHANDLER if your operating system uses
61 # a return type of "void" for signal handlers.
62 TYPES = -DVOID_SIGHANDLER
64 # HP-UX compilation requires the BSD library.
67 # Xenix compilation requires -ldir -lx
68 #LOCAL_LIBS = -ldir -lx
70 # Comment out "-DVI_MODE" if you don't think that anyone will ever desire
71 # the vi line editing mode and features.
72 READLINE_DEFINES = $(TYPES) -DVI_MODE
74 DEBUG_FLAGS = $(MINUS_G)
75 LDFLAGS = $(DEBUG_FLAGS)
77 # A good alternative is gcc -traditional.
78 #CC = gcc -traditional
82 LOCAL_INCLUDES = -I$(srcdir)/../
84 # The name of the main library target.
85 LIBRARY_NAME = libreadline.a
87 # The C code source files for this library.
88 CSOURCES = readline.c funmap.c keymaps.c vi_mode.c parens.c \
89 rltty.c complete.c bind.c isearch.c display.c signals.c \
90 emacs_keymap.c vi_keymap.c history.c tilde.c xmalloc.c
92 # The header files for this library.
93 HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h \
96 OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
97 rltty.o complete.o bind.o isearch.o display.o signals.o \
98 history.o tilde.o xmalloc.o
100 SOURCES = $(CSOURCES) $(HSOURCES)
102 DOCUMENTATION = readline.texi inc-read.texi \
103 history.texi inc-hist.texi
105 SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
107 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
111 "exec_prefix=$(exec_prefix)" \
112 "against=$(against)" \
113 "MAKEINFO=$(MAKEINFO)" \
114 "INSTALL=$(INSTALL)" \
115 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
116 "INSTALL_DATA=$(INSTALL_DATA)"
120 #### Host, target, and site specific Makefile fragments come in here.
124 $(CC) -c $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $<
133 info dvi install-info clean-info clean-dvi: force
134 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
137 @for i in $(DODIRS); do \
138 if [ -f ./$$i/Makefile ] ; then \
140 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
145 libreadline.a: $(OBJECTS)
146 $(RM) -f libreadline.a
147 $(AR) $(AR_FLAGS) libreadline.a $(OBJECTS)
148 $(RANLIB) libreadline.a
150 readline.o: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c
151 history.o: history.c history.h
153 keymaps.o: emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
156 tilde.o: $(srcdir)/../glob/tilde.c
157 $(CC) -c $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $(srcdir)/../glob/tilde.c
159 libtest: libreadline.a libtest.c
160 $(CC) -o libtest $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) -L. libtest.c -lreadline -ltermcap
162 readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h vi_mode.o
163 $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
164 $(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \
165 keymaps.o history.o vi_mode.o -L. -ltermcap
167 readline.tar: $(THINGS_TO_TAR)
168 tar -cf readline.tar $(THINGS_TO_TAR)
170 readline.tar.Z: readline.tar
171 compress -f readline.tar
174 $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
175 $(RANLIB) $(libdir)/libreadline.a
176 $(INSTALL_DATA) $(srcdir)/readline.h $(includedir)/readline/readline.h
177 $(INSTALL_DATA) $(srcdir)/keymaps.h $(includedir)/readline/keymaps.h
178 $(INSTALL_DATA) $(srcdir)/chardefs.h $(includedir)/readline/chardefs.h
181 $(INSTALL_FILE) $(srcdir)/readline.h $(includedir)/readline/readline.h
182 $(INSTALL_FILE) $(srcdir)/keymaps.h $(includedir)/readline/keymaps.h
183 $(INSTALL_FILE) $(srcdir)/chardefs.h $(includedir)/readline/chardefs.h
186 rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn
187 rm -f *.aux *.pg *.toc
189 mostlyclean: local-clean
190 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
193 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
195 distclean: local-clean
196 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
197 rm -f Makefile config.status sysdep.h
199 realclean: local-clean
200 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
201 rm -f Makefile config.status sysdep.h
203 $(DESTDIR)/libreadline.a: libreadline.a
205 # Copy the object files from a particular stage into a subdirectory.
208 -mv $(STAGESTUFF) stage1
212 -mv $(STAGESTUFF) stage2
216 -mv $(STAGESTUFF) stage3
221 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
224 -(cd stage1 ; mv -f * ..)
228 -(cd stage2 ; mv -f * ..)
232 -(cd stage3 ; mv -f * ..)
237 # with the gnu make, this is done automatically.
239 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
240 $(SHELL) ./config.status