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