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