xref: /illumos-gate/usr/src/lib/libtnf/Makefile (revision 02b17e23)
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
53LIBS=		$(DYNLIB)
54
55LDLIBS += -lc
56
57HDRS=		tnf.h
58ROOTHDRDIR=	$(ROOT)/usr/include/tnf
59ROOTHDRS=	$(HDRS:%=$(ROOTHDRDIR)/%)
60CHECKHDRS=	$(HDRS:%.h=%.check)
61$(ROOTHDRS) :=	FILEMODE = 0644
62CHECKHDRS =	$(HDRS:%.h=%.check)
63
64$(ROOTHDRS) :=	FILEMODE = 644
65
66CPPFLAGS +=	-D_DATUM_MACROS -D_REENTRANT
67
68
69CERRWARN +=	-_gcc=-Wno-unused-variable
70
71.KEEP_STATE:
72
73all: $(LIBS)
74
75install: all $(ROOTLIBDIR) $(ROOTLIBS) $(ROOTLINKS)
76
77install_h: $(ROOTHDRDIR) $(ROOTHDRS)
78
79
80check: $(CHECKHDRS)
81
82$(ROOTLIBDIR) $(ROOTHDRDIR):
83	$(INS.dir)
84
85$(ROOTHDRDIR)/% : %
86	$(INS.file)
87
88ASFLAGS=	$(AS_PICFLAGS) -P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS)
89BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
90
91pics/%.o:	./%.s
92		$(BUILD.s)
93		$(POST_PROCESS_O)
94
95objs/%.o:	./%.s
96		$(BUILD.s)
97		$(POST_PROCESS_O)
98
99_msg:	$(MSGDOMAIN) $(POFILE)
100	$(RM) $(MSGDOMAIN)/$(POFILE)
101	$(CP) $(POFILE) $(MSGDOMAIN)
102
103$(POFILE): $(POFILES)
104	$(RM) $@
105	$(CAT) $(POFILES) > $@
106
107$(POFILES):
108	$(RM) messages.po
109	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]*`
110	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
111	$(RM) messages.po
112
113include ../Makefile.targ
114