xref: /titanic_44/usr/src/lib/libcurses/Makefile (revision 843e19887f64dde75055cf8842fc4db2171eff45)
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# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28include	../Makefile.lib
29
30SUBDIRS =	$(MACH)
31$(BUILD64)SUBDIRS += $(MACH64)
32
33# conditional assignments
34all :=		TARGET= all
35install :=	TARGET= install
36clean :=	TARGET= clean
37clobber :=	TARGET= clobber
38lint :=		TARGET= lint
39test :=		TARGET= test
40
41SCRFILES = screen/keycaps \
42	screen/curses.h \
43	screen/keyname.c \
44	screen/termcap.c \
45	screen/tifget.c \
46	screen/tiget.c \
47	screen/tifnames.c \
48	screen/tnames.c \
49	screen/tinames.c \
50	screen/term.h
51
52# definitions for install_h target
53HDRS= 		curses.h term.h unctrl.h
54HDRDIR=		screen
55
56LIBRARY=	libcurses.a
57TEXT_DOMAIN=	SUNW_OST_OSLIB
58XGETFLAGS=	-a
59MSGDIRS=	screen
60POFILE=		$(LIBRARY:.a=.po)
61POFILES=	generic.po
62CLEANFILES +=	$(SCRFILES)
63
64# term.h doesn't pass cstyle due to numerous lines exceeding the 80 character
65# limit.  maketerm.ed can probably be fixed to prevent this, but it is arguable
66# if this work would ever be worth it.
67#
68screen/term.check      := CSTYLE_TAIL = | grep -v "line > 80 characters" | true
69
70.KEEP_STATE:
71
72all: $(SCRFILES) .WAIT $(SUBDIRS)
73
74install: all .WAIT $(SUBDIRS)
75
76clean clobber lint test: $(SUBDIRS)
77
78install_h: $(ROOTHDRS)
79
80check:	$(CHECKHDRS)
81
82scrfiles:	$(SCRFILES)
83
84$(SUBDIRS):	FRC
85	@cd $@; pwd; $(MAKE) $(TARGET)
86
87ED = ed
88
89screen/curses.h:	screen/curses.ed screen/keycaps screen/tmp
90	(cd screen; $(ED) - < curses.ed)
91
92screen/keycaps:		screen/caps
93	grep "KEY_" screen/caps > screen/keycaps
94	@if tail -1 screen/keycaps | grep 'KEY_MOUSE' > /dev/null;then :; \
95		else echo new keys!! must change setkeymap.c; exit 1;fi
96
97screen/keyname.c:    screen/keyname.sh screen/keycaps
98	(cd screen; sh keyname.sh)
99
100screen/termcap.c:    screen/termcap.ed
101	(cd screen; $(ED) - < termcap.ed)
102	(cd screen; $(RM) bool num str)
103
104screen/tifget.c:     screen/tifget.ed
105	(cd screen; $(ED) - < tifget.ed)
106
107screen/tiget.c:      screen/tiget.ed
108	(cd screen; $(ED) - < tiget.ed)
109
110screen/tnames.c screen/tinames.c screen/tifnames.c \
111screen/term.h:   screen/maketerm.ed
112	(cd screen; $(ED) - < maketerm.ed)
113
114screen/tmp:
115	rm -rf $@
116	mkdir $@
117
118_msg:	$(MSGDOMAIN) .WAIT $(POFILE)
119	$(RM) $(MSGDOMAIN)/$(POFILE)
120	$(CP) $(POFILE) $(MSGDOMAIN)
121
122$(POFILE):	$(POFILES)
123	$(RM) $@
124	$(CAT) $(POFILES) > $@
125
126generic.po:
127	$(RM) messages.po
128	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]* */*.[ch]*`
129	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
130	$(RM) messages.po
131
132FRC:
133
134include ../Makefile.targ
135