Initial revision
[external/binutils.git] / readline / Makefile.in
1 ## -*- text -*- ####################################################
2 #                                                                  #
3 # Makefile for readline and history libraries.                     #
4 #                                                                  #
5 ####################################################################
6
7 # Here is a rule for making .o files from .c files that doesn't force
8 # the type of the machine (like -sun3) into the flags.
9 .c.o:
10         $(CC) -c $(CFLAGS) $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $<
11
12 # Destination installation directory.  The libraries are copied to DESTDIR
13 # when you do a `make install', and the header files to INCDIR/readline/*.h.
14 DESTDIR = /usr/local/lib
15 INCDIR = /usr/local/include
16
17 # Define TYPES as -DVOID_SIGHANDLER if your operating system uses
18 # a return type of "void" for signal handlers.
19 TYPES = -DVOID_SIGHANDLER
20
21 # Define SYSV as -DSYSV if you are using a System V operating system.
22 #SYSV = -DSYSV
23
24 # HP-UX compilation requires the BSD library.
25 #LOCAL_LIBS = -lBSD
26
27 # Xenix compilation requires -ldir -lx
28 #LOCAL_LIBS = -ldir -lx
29
30 # Comment out "-DVI_MODE" if you don't think that anyone will ever desire
31 # the vi line editing mode and features.
32 READLINE_DEFINES = $(TYPES) -DVI_MODE
33
34 DEBUG_FLAGS = -g
35 LDFLAGS = $(DEBUG_FLAGS) 
36 CFLAGS = $(DEBUG_FLAGS) $(SYSV) -I.
37
38 # A good alternative is gcc -traditional.
39 #CC = gcc -traditional
40 CC = cc
41 RANLIB = /usr/bin/ranlib
42 AR = ar
43 RM = rm
44 CP = cp
45
46 LOCAL_INCLUDES = -I../
47
48 CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \
49            emacs_keymap.c vi_keymap.c
50
51 HSOURCES = readline.h chardefs.h history.h keymaps.h
52 SOURCES  = $(CSOURCES) $(HSOURCES)
53
54 DOCUMENTATION = readline.texinfo inc-readline.texinfo \
55                 history.texinfo inc-history.texinfo
56
57 SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
58
59 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
60
61 ##########################################################################
62
63 all: libreadline.a
64
65 libreadline.a:  readline.o history.o funmap.o keymaps.o
66                 $(RM) -f libreadline.a
67                 $(AR) clq libreadline.a readline.o history.o funmap.o keymaps.o
68                 -if [ -f $(RANLIB) ]; then $(RANLIB) libreadline.a; fi
69
70 readline.o:     readline.h chardefs.h  keymaps.h history.h readline.c vi_mode.c
71 history.o:      history.c history.h
72 funmap.o:       readline.h
73 keymaps.o:      emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
74
75 libtest:        libreadline.a libtest.c
76                 $(CC) -o libtest $(CFLAGS) $(CPPFLAGS) -L. libtest.c -lreadline -ltermcap
77
78 readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h
79         $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
80                 $(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \
81                  keymaps.o history.o -L. -ltermcap
82
83 readline.tar:   $(THINGS_TO_TAR)
84                 tar -cf readline.tar $(THINGS_TO_TAR)
85
86 readline.tar.Z: readline.tar
87                 compress -f readline.tar
88
89 install:        $(DESTDIR)/libreadline.a includes
90
91 includes:
92                 if [ ! -r $(INCDIR)/readline ]; then\
93                  mkdir $(INCDIR)/readline;\
94                  chmod a+r $(INCDIR)/readline;\
95                 fi
96                 $(CP) readline.h keymaps.h chardefs.h $(INCDIR)/readline/
97 clean:
98                 rm -f *.o *.a *.log *.cp *.tp *.vr *.fn *.aux *.pg *.toc
99
100 $(DESTDIR)/libreadline.a: libreadline.a
101                 -mv $(DESTDIR)/libreadline.a $(DESTDIR)/libreadline.old
102                 cp libreadline.a $(DESTDIR)/libreadline.a
103                 $(RANLIB) -t $(DESTDIR)/libreadline.a