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