Imported from ../bash-1.14.7.tar.gz.
[platform/upstream/bash.git] / lib / termcap / Makefile
1 ## -*- text -*- ####################################################
2 #                                                                  #
3 # Makefile for termcap replacement libbrary.                       #
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'.
14 DESTDIR = /usr/local/lib
15
16 DEBUG_FLAGS = -g
17 #OPTIMIZE_FLAGS = -O
18 LDFLAGS = $(DEBUG_FLAGS) 
19 CFLAGS = $(DEBUG_FLAGS) $(OPTIMIZE_FLAGS)
20
21 SHELL = /bin/sh
22
23 # A good alternative is gcc -traditional.
24 #CC = gcc -traditional
25 CC = cc
26 RANLIB = ranlib
27 AR = ar
28 RM = rm
29 CP = cp
30
31 CSOURCES = termcap.c tparam.c
32
33 SOURCES  = $(CSOURCES)
34
35 OBJECTS = termcap.o tparam.o
36
37 DOCUMENTATION = termcap.texinfo
38
39 THINGS_TO_TAR = $(SOURCES) $(DOCUMENTATION)
40
41 ##########################################################################
42
43 all: libtermcap.a
44
45 libtermcap.a:   $(OBJECTS)
46                 $(RM) -f $@
47                 $(AR) clq $@ $(OBJECTS)
48                 -[ -n "$(RANLIB)" ] && $(RANLIB) $@
49
50 termcap.tar:    $(THINGS_TO_TAR)
51                 tar -cf $@ $(THINGS_TO_TAR)
52
53 termcap.tar.Z:  termcap.tar
54                 compress -f termcap.tar
55
56 install:        $(DESTDIR)/libtermcap.a
57
58 clean:
59                 rm -f *.o *.a *.log *.cp *.tp *.vr *.fn *.aux *.pg *.toc
60
61 maintainer-clean realclean mostlyclean distclean: clean
62
63
64 $(DESTDIR)/libtermcap.a: libtermcap.a
65                 -mv $(DESTDIR)/libtermcap.a $(DESTDIR)/libtermcap.old
66                 cp libtermcap.a $@
67                 -[ -n "$(RANLIB) ] && $(RANLIB) -t $@