* Makefile.in: Clean up ../glob/tilde.c -> tilde.o path.
[external/binutils.git] / readline / Makefile.in
1 #                                                                  #
2 # Makefile for readline and history libraries.                     #
3 #                                                                  #
4
5 srcdir = .
6 ddestdir = /usr/local
7 idestdir = /usr/local
8 INSTALL_PROG = install -c
9 INSTALL_FILE = $(INSTALL_PROG)
10
11 #### host and target dependent Makefile fragments come in here.
12 ##
13
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
18
19 # Define TYPES as -DVOID_SIGHANDLER if your operating system uses
20 # a return type of "void" for signal handlers.
21 TYPES = -DVOID_SIGHANDLER
22
23 # HP-UX compilation requires the BSD library.
24 #LOCAL_LIBS = -lBSD
25
26 # Xenix compilation requires -ldir -lx
27 #LOCAL_LIBS = -ldir -lx
28
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
32
33 MINUS_G=-g
34 DEBUG_FLAGS = $(MINUS_G)
35 LDFLAGS = $(DEBUG_FLAGS) 
36 CFLAGS = $(DEBUG_FLAGS) $(USG) -I. $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES)
37
38 # A good alternative is gcc -traditional.
39 #CC = gcc -traditional
40 RANLIB = /bin/ranlib
41 AR = ar
42 AR_FLAGS = clq
43 RM = rm
44 CP = cp
45
46 LOCAL_INCLUDES = -I$(srcdir)/../
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.texi inc-read.texi \
55                 history.texi inc-hist.texi
56
57 SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
58
59 THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
60
61 ##########################################################################
62
63 STAGESTUFF = *.o
64
65 all: libreadline.a
66
67 all-info: history.info readline.info
68
69 history.info: history.texi
70         $(MAKEINFO) -o history.info $(srcdir)/history.texi
71
72 readline.info: readline.texi inc-read.texi
73         $(MAKEINFO) -o readline.info $(srcdir)/readline.texi
74
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
79
80 readline.o:     readline.h chardefs.h  keymaps.h history.h readline.c vi_mode.c
81 history.o:      history.c history.h
82 funmap.o:       readline.h
83 keymaps.o:      emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
84
85 tilde.o:        $(srcdir)/../glob/tilde.c
86         $(CC) -c $(CFLAGS) $(srcdir)/../glob/tilde.c
87
88 libtest:        libreadline.a libtest.c
89         $(CC) -o libtest $(CFLAGS) $(CPPFLAGS) -L. libtest.c -lreadline -ltermcap
90
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
95
96 readline.tar:   $(THINGS_TO_TAR)
97                 tar -cf readline.tar $(THINGS_TO_TAR)
98
99 readline.tar.Z: readline.tar
100                 compress -f readline.tar
101
102 install:        includes
103                 $(INSTALL_PROG) libreadline.a $(DESTDIR)/libreadline.an
104                 -mv $(DESTDIR)/libreadline.an $(DESTDIR)/libreadline.a
105                 $(RANLIB) $(DESTDIR)/libreadline.a
106
107 install-info: all-info
108                 for i in *.info* ; do \
109                         echo Installing $$i... ; \
110                         cp $$i $(idestdir)/info/$$i ; \
111                 done
112
113 includes:
114                 if [ ! -r $(INCDIR)/readline ]; then\
115                  mkdir $(INCDIR)/readline;\
116                  chmod a+r $(INCDIR)/readline;\
117                 fi
118                 $(INSTALL_FILE) $(srcdir)/readline.h $(INCDIR)/readline/
119                 $(INSTALL_FILE) $(srcdir)/keymaps.h $(INCDIR)/readline/
120                 $(INSTALL_FILE) $(srcdir)/chardefs.h $(INCDIR)/readline/
121 clean:
122                 rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn
123                 rm -f *.aux *.pg *.toc *.info*
124
125 $(DESTDIR)/libreadline.a: libreadline.a
126
127 # Copy the object files from a particular stage into a subdirectory.
128 stage1: force
129         -mkdir stage1
130         -mv $(STAGESTUFF) stage1
131
132 stage2: force
133         -mkdir stage2
134         -mv $(STAGESTUFF) stage2
135
136 stage3: force
137         -mkdir stage3
138         -mv $(STAGESTUFF) stage3
139
140 against=stage2
141
142 comparison: force
143         for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
144
145 de-stage1: force
146         - (cd stage1 ; mv -f * ..)
147         - rmdir stage1
148
149 de-stage2: force
150         - (cd stage2 ; mv -f * ..)
151         - rmdir stage2
152
153 de-stage3: force
154         - (cd stage3 ; mv -f * ..)
155         - rmdir stage3
156
157 force:
158
159 # with the gnu make, this is done automatically.
160
161 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
162         $(SHELL) ./config.status