1# Makefile for GNU termcap library.
2# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2, or (at your option)
7# any later version.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18#### Start of system configuration section. ####
19
20srcdir = @srcdir@
21VPATH = @srcdir@
22
23CC = @CC@
24AR = ar
25RANLIB = @RANLIB@
26
27INSTALL = @INSTALL@
28INSTALL_DATA = @INSTALL_DATA@
29
30MAKEINFO = makeinfo
31
32DEFS = @DEFS@ -DTERMCAP_FILE=\"$(termcapfile)\"
33
34CFLAGS = -g
35
36prefix = @prefix@
37exec_prefix = @exec_prefix@
38
39# Directory in which to install libtermcap.a.
40libdir = $(exec_prefix)/lib
41
42# Directory in which to install termcap.h.
43includedir = $(prefix)/include
44
45# Directory in which to optionally also install termcap.h,
46# so compilers besides gcc can find it by default.
47# If it is empty or not defined, termcap.h will only be installed in
48# includedir. 
49oldincludedir = /usr/include
50
51# Directory in which to install the documentation info files.
52infodir = $(prefix)/info
53
54# File to which `install-data' should install the data file
55# if --enable-install-termcap was given.
56termcapfile = @termcapfile@
57
58#### End of system configuration section. ####
59
60SHELL = /bin/sh
61
62SRCS = termcap.c tparam.c version.c
63OBJS = termcap.o tparam.o version.o
64HDRS = termcap.h
65DISTFILES = $(SRCS) $(HDRS) ChangeLog COPYING README INSTALL NEWS \
66termcap.src termcap.texi termcap.info* \
67texinfo.tex Makefile.in configure configure.in mkinstalldirs install-sh
68
69all:	libtermcap.a info
70
71.c.o:
72	$(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) $(CFLAGS) $<
73
74install: all installdirs @installdata@
75	$(INSTALL_DATA) libtermcap.a $(libdir)/libtermcap.a
76	-$(RANLIB) $(libdir)/libtermcap.a
77	cd $(srcdir); $(INSTALL_DATA) termcap.h $(includedir)/termcap.h
78	-cd $(srcdir); test -z "$(oldincludedir)" || \
79	  $(INSTALL_DATA) termcap.h $(oldincludedir)/termcap.h
80	cd $(srcdir); for f in termcap.info*; \
81	do $(INSTALL_DATA) $$f $(infodir)/$$f; done
82
83uninstall: @uninstalldata@
84	rm -f $(libdir)/libtermcap.a $(includedir)/termcap.h
85	test -z "$(oldincludedir)" || rm -f $(oldincludedir)/termcap.h
86	rm -f $(infodir)/termcap.info*
87
88# These are separate targets to avoid trashing the user's existing
89# termcap file unexpectedly.
90install-data:
91	$(INSTALL_DATA) ${srcdir}/termcap.src ${termcapfile}
92
93uninstall-data:
94	rm -f ${termcapfile}
95
96installdirs:
97	$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(libdir) \
98	$(includedir) $(infodir)
99
100Makefile: Makefile.in config.status
101	$(SHELL) config.status
102config.status: configure
103	$(SHELL) config.status --recheck
104configure: configure.in
105	cd $(srcdir) && autoconf
106
107libtermcap.a: $(OBJS)
108	$(AR) rc $@ $(OBJS)
109	-$(RANLIB) $@
110
111info: termcap.info
112
113termcap.info: termcap.texi
114	$(MAKEINFO) $(srcdir)/termcap.texi --output=$@
115
116TAGS:	$(SRCS)
117	etags $(SRCS)
118
119clean:
120	rm -f *.a *.o core
121
122mostlyclean: clean
123
124distclean: clean
125	rm -f Makefile config.status config.cache config.log
126
127maintainer-clean: distclean
128	@echo "This command is intended for maintainers to use;"
129	@echo "rebuilding the deleted files requires makeinfo."
130	rm -f TAGS *.info*
131
132dist: $(DISTFILES)
133	echo termcap-`sed -e '/version_string/!d' -e 's/[^0-9]*\([0-9a-z.]*\).*/\1/' -e q version.c` > .fname
134	rm -rf `cat .fname`
135	mkdir `cat .fname`
136	ln $(DISTFILES) `cat .fname`
137	tar chzf `cat .fname`.tar.gz `cat .fname`
138	rm -rf `cat .fname` .fname
139