xref: /titanic_51/usr/src/cmd/terminfo/Makefile (revision a31148363f598def767ac48c5d82e1572e44b935)
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# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24
25PROG=	terminfo
26
27TABSETSRC= \
28	3101 beehive hds hds3 std stdcrt teleray vt100 wyse-adds xerox1720
29
30TXTS=	Doc.sed README ckout cvt.ex cvt.sed $(TABSETSRCS) termcap
31
32TISRC=	adds.ti annarbor.ti ansi.ti att.ti beehive.ti \
33	cdc.ti colorscan.ti datamedia.ti dec.ti diablo.ti \
34	fortune.ti general.ti hardcopy.ti hazeltine.ti hds.ti \
35	heath.ti homebrew.ti hp.ti lsi.ti microterm.ti \
36	misc.ti pc.ti perkinelmer.ti print.ti screen.ti special.ti \
37	sperry.ti tektronix.ti teleray.ti televideo.ti ti.ti \
38	tymshare.ti visual.ti wyse.ti
39
40PARTS=	header $(TISRC) trailer
41
42include ../Makefile.cmd
43
44DIRMODE=	0755
45FILEMODE=	0644
46TIC=		tic
47CAT=		/usr/bin/cat
48ECHO=		echo
49
50ROOTSHARELIBDIR	= $(ROOT)/usr/share/lib
51ROOTTABDIR	= $(ROOTSHARELIBDIR)/tabset
52ROOTTERMDIR	= $(ROOTSHARELIBDIR)/terminfo
53DIRS=		$(ROOTTERMDIR) $(ROOTTABDIR)
54
55ROOTSYMLINK	= $(ROOTETC)/termcap
56RELROOTETC	= ../usr/share/lib
57ROOTLIBSYMLINK	= $(ROOTLIB)/tabset
58RELROOTLIB	= ../share/lib
59
60ROOTTABSET	= $(TABSETSRC:%=$(ROOTTABDIR)/%)
61
62$(ROOTTABDIR)/% :	tabset/%
63	$(INS.file)
64
65$(ROOTSHARELIBDIR)/% :	%
66	$(INS.file)
67
68.KEEP_STATE:
69
70all:		$(PROG).src $(TXTS)
71
72$(DIRS):
73	$(INS.dir)
74
75$(PROG).src:	$(PARTS)
76		@$(CAT) $(PARTS) > $(PROG).src
77
78$(ROOTTERMDIR)/s/sun: $(PROG).src
79	TERMINFO=$(ROOTTERMDIR) 2>&1 $(TIC) -v $(PROG).src > errs
80	@$(ECHO) "\n`2>/dev/null cat errs|wc -l` entries have been compiled\n"
81	@-(	2>/dev/null cat errs|grep -iv "^mkdir"|grep -iv "^create"|grep -iv "^link"|grep -vi terminfo.src|grep -vi touch|grep -vi "working"; \
82	 	if [ $$? -ne 0 ] ; \
83		then \
84			$(ECHO) "\tNo errors\n"; \
85		else \
86			$(ECHO) "\n\tErrors can be found in `pwd`/errs\n"; \
87		fi \
88	)
89
90#
91#	Note that order is significant here. $(ROOTTERMDIR)/s/sun will set the
92#	entire subtree to ownership root/bin.
93#
94install:	all $(ROOTTERMDIR) $(ROOTTERMDIR)/s/sun $(ROOTTABDIR) \
95		$(ROOTTABSET) $(ROOTSHARELIBDIR)/termcap  $(ROOTSYMLINK) \
96		$(ROOTLIBSYMLINK)
97
98$(ROOTSYMLINK):
99	-$(RM) $@; $(SYMLINK) $(RELROOTETC)/termcap $@
100
101$(ROOTLIBSYMLINK):
102	-$(RM) $@; $(SYMLINK) $(RELROOTLIB)/tabset $@
103
104lint:
105
106clean:
107		$(RM) $(PROG).src errs
108
109clobber: 	clean
110