2 # Makefile for readline and history libraries. #
8 INSTALL_PROG
= install -c
9 INSTALL_FILE
= $(INSTALL_PROG
)
11 #### host and target dependent Makefile fragments come in here.
14 # Destination installation directory. The libraries are copied to DESTDIR
15 # when you do a `make install', and the header files to INCDIR/readline/*.h.
16 DESTDIR
= $(ddestdir
)/lib
17 INCDIR
= $(ddestdir
)/include
19 # Define TYPES as -DVOID_SIGHANDLER if your operating system uses
20 # a return type of "void" for signal handlers.
21 TYPES
= -DVOID_SIGHANDLER
23 # HP-UX compilation requires the BSD library.
26 # Xenix compilation requires -ldir -lx
27 #LOCAL_LIBS = -ldir -lx
29 # Comment out "-DVI_MODE" if you don't think that anyone will ever desire
30 # the vi line editing mode and features.
31 READLINE_DEFINES
= $(TYPES
) -DVI_MODE
34 DEBUG_FLAGS
= $(MINUS_G
)
35 LDFLAGS
= $(DEBUG_FLAGS
)
36 CFLAGS
= $(DEBUG_FLAGS
) $(USG
) -I.
$(LOCAL_INCLUDES
) $(CPPFLAGS
) $(READLINE_DEFINES
)
38 # A good alternative is gcc -traditional.
39 #CC = gcc -traditional
46 LOCAL_INCLUDES
= -I
$(srcdir)/..
/
48 CSOURCES
= readline.c history.c funmap.c keymaps.c vi_mode.c \
49 emacs_keymap.c vi_keymap.c
51 HSOURCES
= readline.h chardefs.h history.h keymaps.h
52 SOURCES
= $(CSOURCES
) $(HSOURCES
)
54 DOCUMENTATION
= readline.texi inc-read.texi \
55 history.texi inc-hist.texi
57 SUPPORT
= COPYING Makefile
$(DOCUMENTATION
) ChangeLog
59 THINGS_TO_TAR
= $(SOURCES
) $(SUPPORT
)
61 ##########################################################################
67 all-info
: history.
info readline.
info
69 history.
info: history.texi
70 $(MAKEINFO
) -o history.
info $(srcdir)/history.texi
72 readline.
info: readline.texi inc-read.texi
73 $(MAKEINFO
) -o readline.
info $(srcdir)/readline.texi
75 libreadline.a
: readline.o history.o funmap.o keymaps.o tilde.o vi_mode.o
76 $(RM
) -f libreadline.a
77 $(AR
) $(AR_FLAGS
) libreadline.a readline.o history.o funmap.o keymaps.o tilde.o vi_mode.o
78 $(RANLIB
) libreadline.a
80 readline.o
: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c
81 history.o
: history.c history.h
83 keymaps.o
: emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
85 tilde.o
: $(srcdir)/..
/glob
/tilde.c
86 $(CC
) -c
$(CFLAGS
) $(srcdir)/..
/glob
/tilde.c
88 libtest
: libreadline.a libtest.c
89 $(CC
) -o libtest
$(CFLAGS
) $(CPPFLAGS
) -L. libtest.c
-lreadline
-ltermcap
91 readline
: readline.c history.o keymaps.o funmap.o readline.h chardefs.h vi_mode.o
92 $(CC
) $(CFLAGS
) $(CPPFLAGS
) $(READLINE_DEFINES
) \
93 $(LOCAL_INCLUDES
) -DTEST
-o readline readline.c funmap.o \
94 keymaps.o history.o vi_mode.o
-L.
-ltermcap
96 readline.
tar: $(THINGS_TO_TAR
)
97 tar -cf readline.
tar $(THINGS_TO_TAR
)
99 readline.
tar.Z
: readline.
tar
100 compress
-f readline.
tar
103 $(INSTALL_PROG
) libreadline.a
$(DESTDIR
)/libreadline.an
104 -mv
$(DESTDIR
)/libreadline.an
$(DESTDIR
)/libreadline.a
105 $(RANLIB
) $(DESTDIR
)/libreadline.a
107 install-info
: all-info
108 for i in
*.
info* ; do \
109 echo Installing
$$i...
; \
110 cp
$$i $(idestdir
)/info/$$i ; \
114 if
[ ! -r
$(INCDIR
)/readline
]; then\
115 mkdir
$(INCDIR
)/readline
;\
116 chmod a
+r
$(INCDIR
)/readline
;\
118 $(INSTALL_FILE
) $(srcdir)/readline.h
$(INCDIR
)/readline
/
119 $(INSTALL_FILE
) $(srcdir)/keymaps.h
$(INCDIR
)/readline
/
120 $(INSTALL_FILE
) $(srcdir)/chardefs.h
$(INCDIR
)/readline
/
122 rm -f
$(STAGESTUFF
) *.a
*.log
*.cp
*.tp
*.vr
*.fn
123 rm -f
*.aux
*.pg
*.toc
*.
info*
125 $(DESTDIR
)/libreadline.a
: libreadline.a
127 # Copy the object files from a particular stage into a subdirectory.
130 -mv
$(STAGESTUFF
) stage1
134 -mv
$(STAGESTUFF
) stage2
138 -mv
$(STAGESTUFF
) stage3
143 for i in
$(STAGESTUFF
) ; do cmp
$$i $(against
)/$$i ; done
146 - (cd stage1
; mv
-f
* ..
)
150 - (cd stage2
; mv
-f
* ..
)
154 - (cd stage3
; mv
-f
* ..
)
159 # with the gnu make, this is done automatically.
161 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
162 $(SHELL
) .
/config.status