3 # Copyright (C) 1990, 1991 Cygnus Support
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 bindir = $(prefix)/bin
29 datadir = $(prefix)/lib
30 libdir = $(prefix)/lib
31 mandir = $(datadir)/man
32 man1dir = $(mandir)/man1
33 man2dir = $(mandir)/man2
34 man3dir = $(mandir)/man3
35 man4dir = $(mandir)/man4
36 man5dir = $(mandir)/man5
37 man6dir = $(mandir)/man6
38 man7dir = $(mandir)/man7
39 man8dir = $(mandir)/man8
40 man9dir = $(mandir)/man9
41 infodir = $(prefix)/info
42 includedir = $(prefix)/include
43 docdir = $(datadir)/doc
48 INSTALL_PROGRAM = $(INSTALL)
49 INSTALL_DATA = $(INSTALL)
57 #### Host, target, and site specific Makefile fragments come in here.
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
75 DEBUG_FLAGS = $(MINUS_G)
76 LDFLAGS = $(DEBUG_FLAGS)
77 CFLAGS = $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES)
79 # A good alternative is gcc -traditional.
80 #CC = gcc -traditional
84 LOCAL_INCLUDES = -I$(srcdir)/../
86 CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \
87 emacs_keymap.c vi_keymap.c
89 HSOURCES = readline.h chardefs.h history.h keymaps.h
90 SOURCES = $(CSOURCES) $(HSOURCES)
92 DOCUMENTATION = readline.texi inc-read.texi \
93 history.texi inc-hist.texi
95 SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
97 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
99 ##########################################################################
113 history.info: history.texi
114 $(MAKEINFO) -o history.info $(srcdir)/history.texi
116 readline.info: readline.texi inc-read.texi
117 $(MAKEINFO) -o readline.info $(srcdir)/readline.texi
119 libreadline.a: readline.o history.o funmap.o keymaps.o tilde.o vi_mode.o
120 $(RM) -f libreadline.a
121 $(AR) $(AR_FLAGS) libreadline.a readline.o history.o funmap.o keymaps.o tilde.o vi_mode.o
122 $(RANLIB) libreadline.a
124 readline.o: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c
125 history.o: history.c history.h
127 keymaps.o: emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
129 tilde.o: $(srcdir)/../glob/tilde.c
130 $(CC) -c $(CFLAGS) $(srcdir)/../glob/tilde.c
132 libtest: libreadline.a libtest.c
133 $(CC) -o libtest $(CFLAGS) $(CPPFLAGS) -L. libtest.c -lreadline -ltermcap
135 readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h vi_mode.o
136 $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
137 $(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \
138 keymaps.o history.o vi_mode.o -L. -ltermcap
140 readline.tar: $(THINGS_TO_TAR)
141 tar -cf readline.tar $(THINGS_TO_TAR)
143 readline.tar.Z: readline.tar
144 compress -f readline.tar
147 $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
148 $(RANLIB) $(libdir)/libreadline.a
149 [ -d $(includedir)/readline ] || mkdir $(includedir)/readline
150 $(INSTALL_DATA) readline.h $(includedir)/readline/readline.h
151 $(INSTALL_DATA) keymaps.h $(includedir)/readline/keymaps.h
152 $(INSTALL_DATA) chardefs.h $(includedir)/readline/chardefs.h
155 for i in *.info* ; do \
156 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
160 if [ ! -r $(INCDIR)/readline ]; then\
161 mkdir $(INCDIR)/readline;\
162 chmod a+r $(INCDIR)/readline;\
164 $(INSTALL_FILE) $(srcdir)/readline.h $(INCDIR)/readline/
165 $(INSTALL_FILE) $(srcdir)/keymaps.h $(INCDIR)/readline/
166 $(INSTALL_FILE) $(srcdir)/chardefs.h $(INCDIR)/readline/
168 rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn
169 rm -f *.aux *.pg *.toc
171 $(DESTDIR)/libreadline.a: libreadline.a
173 # Copy the object files from a particular stage into a subdirectory.
176 -mv $(STAGESTUFF) stage1
180 -mv $(STAGESTUFF) stage2
184 -mv $(STAGESTUFF) stage3
189 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
192 -(cd stage1 ; mv -f * ..)
196 -(cd stage2 ; mv -f * ..)
200 -(cd stage3 ; mv -f * ..)
205 # with the gnu make, this is done automatically.
207 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
208 $(SHELL) ./config.status