| 1 | # |
| 2 | # Makefile |
| 3 | # Copyright (C) 1990, 1991, 1992 Free Software Foundation |
| 4 | # |
| 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. |
| 9 | # |
| 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. |
| 14 | # |
| 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. */ |
| 18 | # |
| 19 | |
| 20 | # |
| 21 | # Makefile for readline and history libraries. |
| 22 | # |
| 23 | |
| 24 | srcdir = . |
| 25 | |
| 26 | prefix = /usr/local |
| 27 | |
| 28 | exec_prefix = $(prefix) |
| 29 | bindir = $(exec_prefix)/bin |
| 30 | libdir = $(exec_prefix)/lib |
| 31 | |
| 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 |
| 46 | |
| 47 | SHELL = /bin/sh |
| 48 | |
| 49 | INSTALL = install -c |
| 50 | INSTALL_PROGRAM = $(INSTALL) |
| 51 | INSTALL_DATA = $(INSTALL) |
| 52 | |
| 53 | AR = ar |
| 54 | AR_FLAGS = qv |
| 55 | CFLAGS = -g |
| 56 | BISON = bison |
| 57 | MAKEINFO = makeinfo |
| 58 | RANLIB = ranlib |
| 59 | |
| 60 | # Define TYPES as -DVOID_SIGHANDLER if your operating system uses |
| 61 | # a return type of "void" for signal handlers. |
| 62 | TYPES = -DVOID_SIGHANDLER |
| 63 | |
| 64 | # HP-UX compilation requires the BSD library. |
| 65 | #LOCAL_LIBS = -lBSD |
| 66 | |
| 67 | # Xenix compilation requires -ldir -lx |
| 68 | #LOCAL_LIBS = -ldir -lx |
| 69 | |
| 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 |
| 73 | |
| 74 | DEBUG_FLAGS = $(MINUS_G) |
| 75 | LDFLAGS = $(DEBUG_FLAGS) |
| 76 | |
| 77 | # A good alternative is gcc -traditional. |
| 78 | #CC = gcc -traditional |
| 79 | RM = rm |
| 80 | CP = cp |
| 81 | |
| 82 | LOCAL_INCLUDES = -I$(srcdir)/../ |
| 83 | |
| 84 | CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \ |
| 85 | emacs_keymap.c vi_keymap.c |
| 86 | |
| 87 | HSOURCES = readline.h chardefs.h history.h keymaps.h |
| 88 | SOURCES = $(CSOURCES) $(HSOURCES) |
| 89 | |
| 90 | DOCUMENTATION = readline.texi inc-read.texi \ |
| 91 | history.texi inc-hist.texi |
| 92 | |
| 93 | SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog |
| 94 | |
| 95 | THINGS_TO_TAR = $(SOURCES) $(SUPPORT) |
| 96 | |
| 97 | #### Host, target, and site specific Makefile fragments come in here. |
| 98 | ### |
| 99 | |
| 100 | .c.o: |
| 101 | $(CC) -c $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $< |
| 102 | |
| 103 | STAGESTUFF = *.o |
| 104 | |
| 105 | all: libreadline.a |
| 106 | |
| 107 | check: |
| 108 | installcheck: |
| 109 | info: |
| 110 | dvi: |
| 111 | |
| 112 | clean-info: force |
| 113 | -rm -f *.info* |
| 114 | |
| 115 | history.info: $(srcdir)/history.texi |
| 116 | $(MAKEINFO) -o history.info $(srcdir)/history.texi |
| 117 | |
| 118 | readline.info: $(srcdir)/readline.texi $(srcdir)/inc-read.texi |
| 119 | $(MAKEINFO) -o readline.info $(srcdir)/readline.texi |
| 120 | |
| 121 | libreadline.a: readline.o history.o funmap.o keymaps.o tilde.o vi_mode.o |
| 122 | $(RM) -f libreadline.a |
| 123 | $(AR) $(AR_FLAGS) libreadline.a readline.o history.o funmap.o keymaps.o tilde.o vi_mode.o |
| 124 | $(RANLIB) libreadline.a |
| 125 | |
| 126 | readline.o: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c |
| 127 | history.o: history.c history.h |
| 128 | funmap.o: readline.h |
| 129 | keymaps.o: emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c |
| 130 | |
| 131 | tilde.o: $(srcdir)/../glob/tilde.c |
| 132 | $(CC) -c $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $(srcdir)/../glob/tilde.c |
| 133 | |
| 134 | libtest: libreadline.a libtest.c |
| 135 | $(CC) -o libtest $(CFLAGS) $(H_CFLAGS) $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) -L. libtest.c -lreadline -ltermcap |
| 136 | |
| 137 | readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h vi_mode.o |
| 138 | $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \ |
| 139 | $(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \ |
| 140 | keymaps.o history.o vi_mode.o -L. -ltermcap |
| 141 | |
| 142 | readline.tar: $(THINGS_TO_TAR) |
| 143 | tar -cf readline.tar $(THINGS_TO_TAR) |
| 144 | |
| 145 | readline.tar.Z: readline.tar |
| 146 | compress -f readline.tar |
| 147 | |
| 148 | install: |
| 149 | -parent=`echo $(libdir)|sed -e 's@/[^/]*$$@@'`; \ |
| 150 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi |
| 151 | -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi |
| 152 | $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a |
| 153 | $(RANLIB) $(libdir)/libreadline.a |
| 154 | -parent=`echo $(includedir)|sed -e 's@/[^/]*$$@@'`; \ |
| 155 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi |
| 156 | -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; fi |
| 157 | -if [ -d $(includedir)/readline ] ; then true ; else mkdir $(includedir)/readline ; fi |
| 158 | $(INSTALL_DATA) $(srcdir)/readline.h $(includedir)/readline/readline.h |
| 159 | $(INSTALL_DATA) $(srcdir)/keymaps.h $(includedir)/readline/keymaps.h |
| 160 | $(INSTALL_DATA) $(srcdir)/chardefs.h $(includedir)/readline/chardefs.h |
| 161 | |
| 162 | install-info: info |
| 163 | # -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \ |
| 164 | # if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi |
| 165 | # -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi |
| 166 | # for i in *.info* ; do \ |
| 167 | # $(INSTALL_DATA) $$i $(infodir)/$$i ; \ |
| 168 | # done |
| 169 | |
| 170 | includes: |
| 171 | -parent=`echo $(includedir)|sed -e 's@/[^/]*$$@@'`; \ |
| 172 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi |
| 173 | -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; fi |
| 174 | -if [ ! -r $(includedir)/readline ]; then\ |
| 175 | mkdir $(includedir)/readline;\ |
| 176 | chmod a+r $(includedir)/readline;\ |
| 177 | fi |
| 178 | $(INSTALL_FILE) $(srcdir)/readline.h $(includedir)/readline/readline.h |
| 179 | $(INSTALL_FILE) $(srcdir)/keymaps.h $(includedir)/readline/keymaps.h |
| 180 | $(INSTALL_FILE) $(srcdir)/chardefs.h $(includedir)/readline/chardefs.h |
| 181 | |
| 182 | clean mostlyclean: |
| 183 | rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn |
| 184 | rm -f *.aux *.pg *.toc |
| 185 | |
| 186 | distclean realclean: clean |
| 187 | rm -f Makefile config.status sysdep.h |
| 188 | |
| 189 | $(DESTDIR)/libreadline.a: libreadline.a |
| 190 | |
| 191 | # Copy the object files from a particular stage into a subdirectory. |
| 192 | stage1: force |
| 193 | -mkdir stage1 |
| 194 | -mv $(STAGESTUFF) stage1 |
| 195 | |
| 196 | stage2: force |
| 197 | -mkdir stage2 |
| 198 | -mv $(STAGESTUFF) stage2 |
| 199 | |
| 200 | stage3: force |
| 201 | -mkdir stage3 |
| 202 | -mv $(STAGESTUFF) stage3 |
| 203 | |
| 204 | against=stage2 |
| 205 | |
| 206 | comparison: force |
| 207 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done |
| 208 | |
| 209 | de-stage1: force |
| 210 | -(cd stage1 ; mv -f * ..) |
| 211 | -rmdir stage1 |
| 212 | |
| 213 | de-stage2: force |
| 214 | -(cd stage2 ; mv -f * ..) |
| 215 | -rmdir stage2 |
| 216 | |
| 217 | de-stage3: force |
| 218 | -(cd stage3 ; mv -f * ..) |
| 219 | -rmdir stage3 |
| 220 | |
| 221 | force: |
| 222 | |
| 223 | # with the gnu make, this is done automatically. |
| 224 | |
| 225 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
| 226 | $(SHELL) ./config.status |