xref: /illumos-gate/usr/src/lib/libtnf/Makefile (revision 241c90a0)
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
71
72CERRWARN +=	-_gcc=-Wno-unused-variable
73
74.KEEP_STATE:
75
76all: $(LIBS)
77
78install: all $(ROOTLIBDIR) $(ROOTLIBS) $(ROOTLINKS)
79
80install_h: $(ROOTHDRDIR) $(ROOTHDRS)
81
82
83check: $(CHECKHDRS)
84
85$(ROOTLIBDIR) $(ROOTHDRDIR):
86	$(INS.dir)
87
88$(ROOTHDRDIR)/% : %
89	$(INS.file)
90
91ASFLAGS=	$(AS_PICFLAGS) -P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS)
92BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
93
94pics/%.o:	./%.s
95		$(BUILD.s)
96		$(POST_PROCESS_O)
97
98objs/%.o:	./%.s
99		$(BUILD.s)
100		$(POST_PROCESS_O)
101
102_msg:	$(MSGDOMAIN) $(POFILE)
103	$(RM) $(MSGDOMAIN)/$(POFILE)
104	$(CP) $(POFILE) $(MSGDOMAIN)
105
106$(POFILE): $(POFILES)
107	$(RM) $@
108	$(CAT) $(POFILES) > $@
109
110$(POFILES):
111	$(RM) messages.po
112	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]*`
113	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
114	$(RM) messages.po
115
116include ../Makefile.targ
117