allow +foo bar options. stolen from texinfo configure
[deliverable/binutils-gdb.git] / readline / Makefile.in
CommitLineData
bd5635a1
RP
1# #
2# Makefile for readline and history libraries. #
3# #
bcb14db5 4
bd5635a1 5
7da15eff
RP
6srcdir = .
7destdir = /usr/local
8
7187e60c
RP
9INSTALL_PROG = install -c
10INSTALL_FILE = $(INSTALL_PROG)
11
7da15eff
RP
12#### host and target dependent Makefile fragments come in here.
13##
14
bd5635a1
RP
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.
7da15eff
RP
22DESTDIR = $(destdir)/lib
23INCDIR = $(destdir)/include
bd5635a1
RP
24
25# Define TYPES as -DVOID_SIGHANDLER if your operating system uses
26# a return type of "void" for signal handlers.
27TYPES = -DVOID_SIGHANDLER
28
bd5635a1
RP
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.
37READLINE_DEFINES = $(TYPES) -DVI_MODE
38
39DEBUG_FLAGS = -g
40LDFLAGS = $(DEBUG_FLAGS)
41CFLAGS = $(DEBUG_FLAGS) $(SYSV) -I.
42
43# A good alternative is gcc -traditional.
44#CC = gcc -traditional
45CC = cc
7da15eff 46RANLIB = /bin/ranlib
bd5635a1 47AR = ar
7da15eff 48AR_FLAGS = clq
bd5635a1
RP
49RM = rm
50CP = cp
51
7da15eff 52LOCAL_INCLUDES = -I$(srcdir)/../
bd5635a1
RP
53
54CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \
55 emacs_keymap.c vi_keymap.c
56
57HSOURCES = readline.h chardefs.h history.h keymaps.h
58SOURCES = $(CSOURCES) $(HSOURCES)
59
60DOCUMENTATION = readline.texinfo inc-readline.texinfo \
61 history.texinfo inc-history.texinfo
62
63SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
64
65THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
66
67##########################################################################
68
502ef32a 69STAGESTUFF = *.o
7da15eff 70
bd5635a1
RP
71all: libreadline.a
72
73libreadline.a: readline.o history.o funmap.o keymaps.o
74 $(RM) -f libreadline.a
7da15eff
RP
75 $(AR) $(AR_FLAGS) libreadline.a readline.o history.o funmap.o keymaps.o
76 $(RANLIB) libreadline.a
bd5635a1
RP
77
78readline.o: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c
79history.o: history.c history.h
80funmap.o: readline.h
81keymaps.o: emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
82
83libtest: libreadline.a libtest.c
84 $(CC) -o libtest $(CFLAGS) $(CPPFLAGS) -L. libtest.c -lreadline -ltermcap
85
86readline: 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
90
91readline.tar: $(THINGS_TO_TAR)
92 tar -cf readline.tar $(THINGS_TO_TAR)
93
94readline.tar.Z: readline.tar
95 compress -f readline.tar
96
97install: $(DESTDIR)/libreadline.a includes
98
99includes:
100 if [ ! -r $(INCDIR)/readline ]; then\
101 mkdir $(INCDIR)/readline;\
102 chmod a+r $(INCDIR)/readline;\
103 fi
bcb14db5
RP
104 $(INSTALL_FILE) $(srcdir)/readline.h $(INCDIR)/readline/
105 $(INSTALL_FILE) $(srcdir)/keymaps.h $(INCDIR)/readline/
106 $(INSTALL_FILE) $(srcdir)/chardefs.h $(INCDIR)/readline/
bd5635a1 107clean:
502ef32a 108 rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn *.aux *.pg *.toc
bd5635a1
RP
109
110$(DESTDIR)/libreadline.a: libreadline.a
111 -mv $(DESTDIR)/libreadline.a $(DESTDIR)/libreadline.old
7187e60c 112 $(INSTALL_PROG) libreadline.a $(DESTDIR)/libreadline.a
bcb14db5 113 $(RANLIB) $(DESTDIR)/libreadline.a
7da15eff
RP
114
115# Copy the object files from a particular stage into a subdirectory.
116stage1: force
117 -mkdir stage1
118 -mv $(STAGESTUFF) stage1
119
120stage2: force
121 -mkdir stage2
122 -mv $(STAGESTUFF) stage2
123
124stage3: force
125 -mkdir stage3
126 -mv $(STAGESTUFF) stage3
127
30ba1dfe
RP
128against=stage2
129
130comparison: force
131 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
132
7da15eff
RP
133de-stage1: force
134 - (cd stage1 ; mv -f * ..)
135 - rmdir stage1
136
137de-stage2: force
138 - (cd stage2 ; mv -f * ..)
139 - rmdir stage2
140
141de-stage3: force
142 - (cd stage3 ; mv -f * ..)
143 - rmdir stage3
144
145force:
146
147# with the gnu make, this is done automatically.
148
bcb14db5
RP
149Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(host_makefile_frag) $(target_makefile_frag)
150 $(SHELL) ./config.status
This page took 0.054822 seconds and 4 git commands to generate.