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 = $(destdir)/lib
23 INCDIR = $(destdir)/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 LDFLAGS = $(DEBUG_FLAGS)
41 CFLAGS = $(DEBUG_FLAGS) $(SYSV) -I.
43 # A good alternative is gcc -traditional.
44 #CC = gcc -traditional
52 LOCAL_INCLUDES = -I$(srcdir)/../
54 CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \
55 emacs_keymap.c vi_keymap.c
57 HSOURCES = readline.h chardefs.h history.h keymaps.h
58 SOURCES = $(CSOURCES) $(HSOURCES)
60 DOCUMENTATION = readline.texinfo inc-readline.texinfo \
61 history.texinfo inc-history.texinfo
63 SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
65 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
67 ##########################################################################
73 libreadline.a: readline.o history.o funmap.o keymaps.o
74 $(RM) -f libreadline.a
75 $(AR) $(AR_FLAGS) libreadline.a readline.o history.o funmap.o keymaps.o
76 $(RANLIB) libreadline.a
78 readline.o: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c
79 history.o: history.c history.h
81 keymaps.o: emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
83 libtest: libreadline.a libtest.c
84 $(CC) -o libtest $(CFLAGS) $(CPPFLAGS) -L. libtest.c -lreadline -ltermcap
86 readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h
87 $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
88 $(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \
89 keymaps.o history.o -L. -ltermcap
91 readline.tar: $(THINGS_TO_TAR)
92 tar -cf readline.tar $(THINGS_TO_TAR)
94 readline.tar.Z: readline.tar
95 compress -f readline.tar
97 install: $(DESTDIR)/libreadline.a includes
100 if [ ! -r $(INCDIR)/readline ]; then\
101 mkdir $(INCDIR)/readline;\
102 chmod a+r $(INCDIR)/readline;\
104 $(INSTALL_FILE) $(srcdir)/readline.h $(INCDIR)/readline/
105 $(INSTALL_FILE) $(srcdir)/keymaps.h $(INCDIR)/readline/
106 $(INSTALL_FILE) $(srcdir)/chardefs.h $(INCDIR)/readline/
108 rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn *.aux *.pg *.toc
110 $(DESTDIR)/libreadline.a: libreadline.a
111 -mv $(DESTDIR)/libreadline.a $(DESTDIR)/libreadline.old
112 $(INSTALL_PROG) libreadline.a $(DESTDIR)/libreadline.a
113 $(RANLIB) $(DESTDIR)/libreadline.a
115 # Copy the object files from a particular stage into a subdirectory.
118 -mv $(STAGESTUFF) stage1
122 -mv $(STAGESTUFF) stage2
126 -mv $(STAGESTUFF) stage3
131 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
134 - (cd stage1 ; mv -f * ..)
138 - (cd stage2 ; mv -f * ..)
142 - (cd stage3 ; mv -f * ..)
147 # with the gnu make, this is done automatically.
149 Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(host_makefile_frag) $(target_makefile_frag)
150 $(SHELL) ./config.status