xref: /titanic_41/usr/src/lib/libtnf/Makefile (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# lib/libtnf/Makefile
29#
30
31LIBRARY=	libtnf.a
32VERS=		.1
33OBJECTS=	$(MACH)dep.o	\
34		ref.o		\
35		abi.o		\
36		util.o		\
37		info.o		\
38		datum.o		\
39		record.o	\
40		scalar.o	\
41		array.o		\
42		struct.o	\
43		type.o		\
44		error.o		\
45		access.o	\
46		reader.o
47
48all :=		TARGET= all
49clean :=	TARGET= clean
50clobber :=	TARGET= clobber
51check :=	TARGET= check
52install :=	TARGET= install
53lint :=		TARGET= lint
54install_h :=	TARGET= install_h
55_msg :=		TARGET= _msg
56
57
58include ../Makefile.lib
59
60TEXT_DOMAIN=	SUNW_OST_OSLIB
61XGETFLAGS=	-a
62POFILE=		$(LIBRARY:%.a=%.po)
63POFILES=	_error.po
64
65SED=	sed
66GREP=	grep
67CP=	cp
68
69LIBS=		$(DYNLIB)
70
71MAPDIR=		./spec/$(MACH)
72MAPFILE=	$(MAPDIR)/mapfile
73MAPOPTS=	$(MAPFILE:%=-M%)
74DYNFLAGS +=	$(MAPOPTS)
75CLOBBERFILES +=	$(MAPFILE)
76
77LDLIBS += -lc
78
79HDRS=		tnf.h
80ROOTHDRDIR=	$(ROOT)/usr/include/tnf
81ROOTHDRS=	$(HDRS:%=$(ROOTHDRDIR)/%)
82CHECKHDRS=	$(HDRS:%.h=%.check)
83$(ROOTHDRS) := 	FILEMODE = 0644
84CHECKHDRS =	$(HDRS:%.h=%.check)
85
86$(ROOTHDRS) :=	FILEMODE = 644
87
88CPPFLAGS +=	-D_DATUM_MACROS -D_REENTRANT
89
90LINTFLAGS +=	-y
91
92$(DYNLIB):	$(MAPFILE)
93
94$(MAPFILE):
95	@cd $(MAPDIR); $(MAKE) mapfile
96
97
98.KEEP_STATE:
99
100all: spec .WAIT $(LIBS)
101
102install: all spec $(ROOTLIBDIR) $(ROOTLIBS) $(ROOTLINKS)
103
104install_h: $(ROOTHDRDIR) $(ROOTHDRS)
105
106clean clobber: spec $(BUILD64)
107
108lint:
109	$(LINT.c) $(SRCS)
110
111check: $(CHECKHDRS)
112
113$(ROOTLIBDIR) $(ROOTHDRDIR):
114	$(INS.dir)
115
116$(ROOTHDRDIR)/% : %
117	$(INS.file)
118
119ASFLAGS=	$(AS_PICFLAGS) -P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS)
120BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
121
122pics/%.o:	./%.s
123		$(BUILD.s)
124		$(POST_PROCESS_O)
125
126objs/%.o:	./%.s
127		$(BUILD.s)
128		$(POST_PROCESS_O)
129
130_msg:	$(MSGDOMAIN) $(POFILE)
131	$(RM) $(MSGDOMAIN)/$(POFILE)
132	$(CP) $(POFILE) $(MSGDOMAIN)
133
134$(POFILE): $(POFILES)
135	$(RM) $@
136	$(CAT) $(POFILES) > $@
137
138$(POFILES):
139	$(RM) messages.po
140	$(XGETTEXT) $(XGETFLAGS) `$(GREP) -l gettext *.[ch]*`
141	$(SED) -e '/^# msg/d' -e '/^domain/d' messages.po > $@
142	$(RM) messages.po
143
144include ../Makefile.targ
145
146spec:	FRC
147	@cd $@; pwd; $(MAKE) $(TARGET)
148
149FRC:
150