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