Add diclaimer of copyright to _osname() manual page.
[unix-history] / gnu / usr.bin / kgdb / readline / Makefile.gnu
CommitLineData
04497f0b
NW
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) $*.c
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.
14DESTDIR = /usr/gnu/lib
15INCDIR = /usr/gnu/include
16
17# Define TYPES as -DVOID_SIGHANDLER if your operating system uses
18# a return type of "void" for signal handlers.
19TYPES = -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 this out if you don't think that anyone will ever desire
31# the vi line editing mode and features.
32READLINE_DEFINES = -DVI_MODE
33
34DEBUG_FLAGS = -g
35LDFLAGS = $(DEBUG_FLAGS)
36CFLAGS = $(DEBUG_FLAGS) $(TYPE) $(SYSV) -I.
37
38# A good alternative is gcc -traditional.
39#CC = gcc -traditional
40CC = cc
41RANLIB = /usr/bin/ranlib
42AR = ar
43RM = rm
44CP = cp
45
46LOCAL_INCLUDES = -I../
47
48CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \
49 emacs_keymap.c vi_keymap.c keymaps.c
50
51HSOURCES = readline.h chardefs.h history.h keymaps.h
52SOURCES = $(CSOURCES) $(HSOURCES)
53
54DOCUMENTATION = readline.texinfo inc-readline.texinfo \
55 history.texinfo inc-history.texinfo
56
57SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog
58
59THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
60
61##########################################################################
62
63all: libreadline.a
64
65libreadline.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
70readline.o: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c
71 $(CC) -c $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
72 $(LOCAL_INCLUDES) $*.c
73
74history.o: history.c history.h
75 $(CC) -c $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
76 $(LOCAL_INCLUDES) $*.c
77
78funmap.o: readline.h
79 $(CC) -c $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
80 $(LOCAL_INCLUDES) $*.c
81
82keymaps.o: emacs_keymap.c vi_keymap.c keymaps.h chardefs.h keymaps.c
83 $(CC) -c $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
84 $(LOCAL_INCLUDES) $*.c
85
86libtest: libreadline.a libtest.c
87 $(CC) -o libtest $(CFLAGS) $(CPPFLAGS) -L. libtest.c -lreadline -ltermcap
88
89readline: readline.c history.o keymaps.o funmap.o readline.h chardefs.h
90 $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
91 $(LOCAL_INCLUDES) -DTEST -o readline readline.c funmap.o \
92 keymaps.o history.o -L. -ltermcap
93
94readline.tar: $(THINGS_TO_TAR)
95 tar -cf readline.tar $(THINGS_TO_TAR)
96
97readline.tar.Z: readline.tar
98 compress -f readline.tar
99
100install: $(DESTDIR)/libreadline.a includes
101
102includes:
103 if [ ! -r $(INCDIR)/readline ]; then\
104 mkdir $(INCDIR)/readline;\
105 chmod a+r $(INCDIR)/readline;\
106 fi
107 $(CP) readline.h keymaps.h chardefs.h $(INCDIR)/readline/
108clean:
109 rm -f *.o *.a *.log *.cp *.tp *.vr *.fn *.aux *.pg *.toc
110
111$(DESTDIR)/libreadline.a: libreadline.a
112 -mv $(DESTDIR)/libreadline.a $(DESTDIR)/libreadline.old
113 cp libreadline.a $(DESTDIR)/libreadline.a
114 $(RANLIB) -t $(DESTDIR)/libreadline.a