2 # Makefile for readline and history libraries. #
9 INSTALL_PROG
= install -c
10 INSTALL_FILE
= $(INSTALL_PROG
)
12 #### host and target dependent Makefile fragments come in here.
15 # Here is a rule for making .o files from .c files that doesn't force
16 # the type of the machine (like -sun3) into the flags.
18 $(CC
) -c
$(CFLAGS
) $(LOCAL_INCLUDES
) $(CPPFLAGS
) $(READLINE_DEFINES
) $<
20 # Destination installation directory. The libraries are copied to DESTDIR
21 # when you do a `make install', and the header files to INCDIR/readline/*.h.
22 DESTDIR
= $(ddestdir
)/lib
23 INCDIR
= $(ddestdir
)/include
25 # Define TYPES as -DVOID_SIGHANDLER if your operating system uses
26 # a return type of "void" for signal handlers.
27 TYPES
= -DVOID_SIGHANDLER
29 # HP-UX compilation requires the BSD library.
32 # Xenix compilation requires -ldir -lx
33 #LOCAL_LIBS = -ldir -lx
35 # Comment out "-DVI_MODE" if you don't think that anyone will ever desire
36 # the vi line editing mode and features.
37 READLINE_DEFINES
= $(TYPES
) -DVI_MODE
40 DEBUG_FLAGS
= $(MINUS_G
)
41 LDFLAGS
= $(DEBUG_FLAGS
)
42 CFLAGS
= $(DEBUG_FLAGS
) $(SYSV
) -I.
44 # A good alternative is gcc -traditional.
45 #CC = gcc -traditional
53 LOCAL_INCLUDES
= -I
$(srcdir)/..
/
55 CSOURCES
= readline.c history.c funmap.c keymaps.c vi_mode.c \
56 emacs_keymap.c vi_keymap.c
58 HSOURCES
= readline.h chardefs.h history.h keymaps.h
59 SOURCES
= $(CSOURCES
) $(HSOURCES
)
61 DOCUMENTATION
= readline.texi inc-read.texi \
62 history.texi inc-hist.texi
64 SUPPORT
= COPYING Makefile
$(DOCUMENTATION
) ChangeLog
66 THINGS_TO_TAR
= $(SOURCES
) $(SUPPORT
)
68 ##########################################################################
74 all-info
: history.
info readline.
info
76 history.
info: history.texi
77 - $(MAKEINFO
) -o history.
info $(srcdir)/history.texi
79 readline.
info: readline.texi
80 - $(MAKEINFO
) -o readline.
info $(srcdir)/readline.texi
82 libreadline.a
: readline.o history.o funmap.o keymaps.o
83 $(RM
) -f libreadline.a
84 $(AR
) $(AR_FLAGS
) libreadline.a readline.o history.o funmap.o keymaps.o
85 $(RANLIB
) libreadline.a
87 readline.o
: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c
88 history.o
: history.c history.h
90 keymaps.o
: emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
92 libtest
: libreadline.a libtest.c
93 $(CC
) -o libtest
$(CFLAGS
) $(CPPFLAGS
) -L. libtest.c
-lreadline
-ltermcap
95 readline
: readline.c history.o keymaps.o funmap.o readline.h chardefs.h
96 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(READLINE_DEFINES
) \
97 $(LOCAL_INCLUDES
) -DTEST
-o readline readline.c funmap.o \
98 keymaps.o history.o
-L.
-ltermcap
100 readline.
tar: $(THINGS_TO_TAR
)
101 tar -cf readline.
tar $(THINGS_TO_TAR
)
103 readline.
tar.Z
: readline.
tar
104 compress
-f readline.
tar
107 $(INSTALL_PROG
) libreadline.a
$(DESTDIR
)/libreadline.an
108 -mv
$(DESTDIR
)/libreadline.an
$(DESTDIR
)/libreadline.a
109 $(RANLIB
) $(DESTDIR
)/libreadline.a
111 install-info
: all-info
112 for i in
*.
info* ; do \
113 echo Installing
$$i...
; \
114 cp
$$i $(idestdir
)/info/$$i ; \
118 if
[ ! -r
$(INCDIR
)/readline
]; then\
119 mkdir
$(INCDIR
)/readline
;\
120 chmod a
+r
$(INCDIR
)/readline
;\
122 $(INSTALL_FILE
) $(srcdir)/readline.h
$(INCDIR
)/readline
/
123 $(INSTALL_FILE
) $(srcdir)/keymaps.h
$(INCDIR
)/readline
/
124 $(INSTALL_FILE
) $(srcdir)/chardefs.h
$(INCDIR
)/readline
/
126 rm -f
$(STAGESTUFF
) *.a
*.log
*.cp
*.tp
*.vr
*.fn
127 rm -f
*.aux
*.pg
*.toc
*.
info*
129 $(DESTDIR
)/libreadline.a
: libreadline.a
131 # Copy the object files from a particular stage into a subdirectory.
134 -mv
$(STAGESTUFF
) stage1
138 -mv
$(STAGESTUFF
) stage2
142 -mv
$(STAGESTUFF
) stage3
147 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
150 - (cd stage1
; mv
-f
* ..
)
154 - (cd stage2
; mv
-f
* ..
)
158 - (cd stage3
; mv
-f
* ..
)
163 # with the gnu make, this is done automatically.
165 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
166 $(SHELL
) .
/config.status