* c-exp.y, m2-exp.y: Lint.
[deliverable/binutils-gdb.git] / readline / Makefile.in
CommitLineData
bd5635a1
RP
1## -*- text -*- ####################################################
2# #
3# Makefile for readline and history libraries. #
4# #
5####################################################################
6
7da15eff
RP
7srcdir = .
8destdir = /usr/local
9
7187e60c
RP
10INSTALL_PROG = install -c
11INSTALL_FILE = $(INSTALL_PROG)
12
7da15eff
RP
13#### host and target dependent Makefile fragments come in here.
14##
15
bd5635a1
RP
16# Here is a rule for making .o files from .c files that doesn't force
17# the type of the machine (like -sun3) into the flags.
18.c.o:
19 $(CC) -c $(CFLAGS) $(LOCAL_INCLUDES) $(CPPFLAGS) $(READLINE_DEFINES) $<
20
21# Destination installation directory. The libraries are copied to DESTDIR
22# when you do a `make install', and the header files to INCDIR/readline/*.h.
7da15eff
RP
23DESTDIR = $(destdir)/lib
24INCDIR = $(destdir)/include
bd5635a1
RP
25
26# Define TYPES as -DVOID_SIGHANDLER if your operating system uses
27# a return type of "void" for signal handlers.
28TYPES = -DVOID_SIGHANDLER
29
30# Define SYSV as -DSYSV if you are using a System V operating system.
31#SYSV = -DSYSV
32
33# HP-UX compilation requires the BSD library.
34#LOCAL_LIBS = -lBSD
35
36# Xenix compilation requires -ldir -lx
37#LOCAL_LIBS = -ldir -lx
38
39# Comment out "-DVI_MODE" if you don't think that anyone will ever desire
40# the vi line editing mode and features.
41READLINE_DEFINES = $(TYPES) -DVI_MODE
42
43DEBUG_FLAGS = -g
44LDFLAGS = $(DEBUG_FLAGS)
45CFLAGS = $(DEBUG_FLAGS) $(SYSV) -I.
46
47# A good alternative is gcc -traditional.
48#CC = gcc -traditional
49CC = cc
7da15eff 50RANLIB = /bin/ranlib
bd5635a1 51AR = ar
7da15eff 52AR_FLAGS = clq
bd5635a1
RP
53RM = rm
54CP = cp
55
7da15eff 56LOCAL_INCLUDES = -I$(srcdir)/../
bd5635a1
RP
57
58CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \
59 emacs_keymap.c vi_keymap.c
60
61HSOURCES = readline.h chardefs.h history.h keymaps.h
62SOURCES = $(CSOURCES) $(HSOURCES)
63
64DOCUMENTATION = readline.texinfo inc-readline.texinfo \
65 history.texinfo inc-history.texinfo
66
67SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
68
69THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
70
71##########################################################################
72
502ef32a 73STAGESTUFF = *.o
7da15eff 74
bd5635a1
RP
75all: libreadline.a
76
77libreadline.a: readline.o history.o funmap.o keymaps.o
78 $(RM) -f libreadline.a
7da15eff
RP
79 $(AR) $(AR_FLAGS) libreadline.a readline.o history.o funmap.o keymaps.o
80 $(RANLIB) libreadline.a
bd5635a1
RP
81
82readline.o: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c
83history.o: history.c history.h
84funmap.o: readline.h
85keymaps.o: emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
86
87libtest: libreadline.a libtest.c
88 $(CC) -o libtest $(CFLAGS) $(CPPFLAGS) -L. libtest.c -lreadline -ltermcap
89
90readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h
91 $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
92 $(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \
93 keymaps.o history.o -L. -ltermcap
94
95readline.tar: $(THINGS_TO_TAR)
96 tar -cf readline.tar $(THINGS_TO_TAR)
97
98readline.tar.Z: readline.tar
99 compress -f readline.tar
100
101install: $(DESTDIR)/libreadline.a includes
102
103includes:
104 if [ ! -r $(INCDIR)/readline ]; then\
105 mkdir $(INCDIR)/readline;\
106 chmod a+r $(INCDIR)/readline;\
107 fi
7187e60c 108 $(INSTALL_FILE) readline.h keymaps.h chardefs.h $(INCDIR)/readline/
bd5635a1 109clean:
502ef32a 110 rm -f $(STAGESTUFF) *.a *.log *.cp *.tp *.vr *.fn *.aux *.pg *.toc
bd5635a1
RP
111
112$(DESTDIR)/libreadline.a: libreadline.a
113 -mv $(DESTDIR)/libreadline.a $(DESTDIR)/libreadline.old
7187e60c 114 $(INSTALL_PROG) libreadline.a $(DESTDIR)/libreadline.a
bd5635a1 115 $(RANLIB) -t $(DESTDIR)/libreadline.a
7da15eff
RP
116
117# Copy the object files from a particular stage into a subdirectory.
118stage1: force
119 -mkdir stage1
120 -mv $(STAGESTUFF) stage1
121
122stage2: force
123 -mkdir stage2
124 -mv $(STAGESTUFF) stage2
125
126stage3: force
127 -mkdir stage3
128 -mv $(STAGESTUFF) stage3
129
30ba1dfe
RP
130against=stage2
131
132comparison: force
133 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
134
7da15eff
RP
135de-stage1: force
136 - (cd stage1 ; mv -f * ..)
137 - rmdir stage1
138
139de-stage2: force
140 - (cd stage2 ; mv -f * ..)
141 - rmdir stage2
142
143de-stage3: force
144 - (cd stage3 ; mv -f * ..)
145 - rmdir stage3
146
147force:
148
149# with the gnu make, this is done automatically.
150
151Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
152 (cd $(srcdir) ; \
153 ./configure +destdir=$(destdir) +norecurse \
154 `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
155 $(host) +target=$(target))
156
This page took 0.036193 seconds and 4 git commands to generate.