xref: /titanic_50/usr/src/cmd/terminfo/Makefile (revision b5d3ab78446c645a1150b57b7a58b535229ee742)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22#ident	"%Z%%M%	%I%	%E% SMI"
23#
24# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27
28PROG=	terminfo
29
30TABSETSRC= \
31	3101 beehive hds hds3 std stdcrt teleray vt100 wyse-adds xerox1720
32
33TXTS=	Doc.sed README ckout cvt.ex cvt.sed $(TABSETSRCS) termcap
34
35TISRC=	adds.ti annarbor.ti ansi.ti att.ti beehive.ti \
36	cdc.ti colorscan.ti datamedia.ti dec.ti diablo.ti \
37	fortune.ti general.ti hardcopy.ti hazeltine.ti hds.ti \
38	heath.ti homebrew.ti hp.ti lsi.ti microterm.ti \
39	misc.ti pc.ti perkinelmer.ti print.ti screen.ti special.ti \
40	sperry.ti tektronix.ti teleray.ti televideo.ti ti.ti \
41	tymshare.ti visual.ti wyse.ti
42
43PARTS=	header $(TISRC) trailer
44
45include ../Makefile.cmd
46
47DIRMODE=	0755
48FILEMODE=	0644
49TIC=		tic
50CAT=		/usr/bin/cat
51ECHO=		echo
52
53ROOTSHARELIBDIR	= $(ROOT)/usr/share/lib
54ROOTTABDIR	= $(ROOTSHARELIBDIR)/tabset
55ROOTTERMDIR	= $(ROOTSHARELIBDIR)/terminfo
56OWNER		= root
57GROUP		= bin
58DIRS=		$(ROOTTERMDIR) $(ROOTTABDIR)
59
60ROOTSYMLINK	= $(ROOTETC)/termcap
61RELROOTETC	= ../usr/share/lib
62ROOTLIBSYMLINK	= $(ROOTLIB)/tabset
63RELROOTLIB	= ../share/lib
64
65ROOTTABSET	= $(TABSETSRC:%=$(ROOTTABDIR)/%)
66
67$(ROOTTABDIR)/% :	tabset/%
68	$(INS.file)
69
70$(ROOTSHARELIBDIR)/% :	%
71	$(INS.file)
72
73.KEEP_STATE:
74
75all:		$(PROG).src $(TXTS)
76
77$(DIRS):
78	$(INS.dir)
79
80$(PROG).src:	$(PARTS)
81		@$(CAT) $(PARTS) > $(PROG).src
82
83$(ROOTTERMDIR)/s/sun: $(PROG).src
84	TERMINFO=$(ROOTTERMDIR) 2>&1 $(TIC) -v $(PROG).src > errs
85	$(CHOWN) -R $(OWNER) $(ROOTTERMDIR)
86	$(CHGRP) -R $(GROUP) $(ROOTTERMDIR)
87	@$(ECHO) "\n`2>/dev/null cat errs|wc -l` entries have been compiled\n"
88	@-(	2>/dev/null cat errs|grep -iv "^mkdir"|grep -iv "^create"|grep -iv "^link"|grep -vi terminfo.src|grep -vi touch|grep -vi "working"; \
89	 	if [ $$? -ne 0 ] ; \
90		then \
91			$(ECHO) "\tNo errors\n"; \
92		else \
93			$(ECHO) "\n\tErrors can be found in `pwd`/errs\n"; \
94		fi \
95	)
96
97#
98#	Note that order is significant here. $(ROOTTERMDIR)/s/sun will set the
99#	entire subtree to ownership root/bin.
100#
101install:	all $(ROOTTERMDIR) $(ROOTTERMDIR)/s/sun $(ROOTTABDIR) \
102		$(ROOTTABSET) $(ROOTSHARELIBDIR)/termcap  $(ROOTSYMLINK) \
103		$(ROOTLIBSYMLINK)
104
105$(ROOTSYMLINK):
106	-$(RM) $@; $(SYMLINK) $(RELROOTETC)/termcap $@
107
108$(ROOTLIBSYMLINK):
109	-$(RM) $@; $(SYMLINK) $(RELROOTLIB)/tabset $@
110
111lint:
112
113clean:
114		$(RM) $(PROG).src errs
115
116clobber: 	clean
117