xref: /titanic_41/usr/src/lib/libtnf/Makefile (revision b509e89b2befbaa42939abad9da1d7f5a8c6aaae)
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 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25#
26
27LIBRARY=	libtnf.a
28VERS=		.1
29OBJECTS=	$(MACH)dep.o	\
30		ref.o		\
31		abi.o		\
32		util.o		\
33		info.o		\
34		datum.o		\
35		record.o	\
36		scalar.o	\
37		array.o		\
38		struct.o	\
39		type.o		\
40		error.o		\
41		access.o	\
42		reader.o
43
44include ../Makefile.lib
45
46SRCDIR =	.
47
48TEXT_DOMAIN=	SUNW_OST_OSLIB
49XGETFLAGS=	-a
50POFILE=		$(LIBRARY:%.a=%.po)
51POFILES=	_error.po
52
53SED=	sed
54GREP=	grep
55
56LIBS=		$(DYNLIB)
57
58LDLIBS += -lc
59
60HDRS=		tnf.h
61ROOTHDRDIR=	$(ROOT)/usr/include/tnf
62ROOTHDRS=	$(HDRS:%=$(ROOTHDRDIR)/%)
63CHECKHDRS=	$(HDRS:%.h=%.check)
64$(ROOTHDRS) := 	FILEMODE = 0644
65CHECKHDRS =	$(HDRS:%.h=%.check)
66
67$(ROOTHDRS) :=	FILEMODE = 644
68
69CPPFLAGS +=	-D_DATUM_MACROS -D_REENTRANT
70
71LINTFLAGS +=	-y
72
73.KEEP_STATE:
74
75all: $(LIBS)
76
77install: all $(ROOTLIBDIR) $(ROOTLIBS) $(ROOTLINKS)
78
79install_h: $(ROOTHDRDIR) $(ROOTHDRS)
80
81lint:
82	$(LINT.c) $(SRCS)
83
84check: $(CHECKHDRS)
85
86$(ROOTLIBDIR) $(ROOTHDRDIR):
87	$(INS.dir)
88
89$(ROOTHDRDIR)/% : %
90	$(INS.file)
91
92ASFLAGS=	$(AS_PICFLAGS) -P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS)
93BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
94
95pics/%.o:	./%.s
96		$(BUILD.s)
97		$(POST_PROCESS_O)
98
99objs/%.o:	./%.s
100		$(BUILD.s)
101		$(POST_PROCESS_O)
102
103_msg:	$(MSGDOMAIN) $(POFILE)
104	$(RM) $(MSGDOMAIN)/$(POFILE)
105	$(CP) $(POFILE) $(MSGDOMAIN)
106
107$(POFILE): $(POFILES)
108	$(RM) $@
109	$(CAT) $(POFILES) > $@
110
111$(POFILES):
112	$(RM) messages.po
113	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]*`
114	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
115	$(RM) messages.po
116
117include ../Makefile.targ
118