xref: /titanic_51/usr/src/lib/libtnfprobe/Makefile.com (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
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# ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# lib/libtnfprobe/Makefile
29#
30
31LIBRARY=	libtnfprobe.a
32VERS=		.1
33OBJECTS.c=	tnf_buf.o	\
34		trace_init.o	\
35		trace_funcs.o	\
36		debug_funcs.o	\
37		probe_mem.o	\
38		tnf_args.o	\
39		tnf_trace.o	\
40		probe_cntl.o
41
42UFSDIR=		$(SRC)/uts/common/tnf
43UFSOBJS=	tnf_writer.o tnf_probe.o
44
45OBJECTS.s=	$(MACH)_locks.o
46
47OBJECTS=	$(OBJECTS.c) $(UFSOBJS) $(OBJECTS.s)
48
49include ../../Makefile.lib
50
51# We omit $(OBJECTS.s:%.o=%.s) in the next line, because lint no like
52SRCS= $(OBJECTS.c:%.o=../%.c) $(UFSOBJS:%.o=$(UFSDIR)/%.c)
53
54LIBS=		$(DYNLIB)
55
56MAPFILE=	$(MAPDIR)/mapfile
57MAPOPTS=	$(MAPFILE:%=-M %)
58DYNFLAGS +=	$(MAPOPTS)
59CLOBBERFILES +=	$(MAPFILE)
60
61HDRS=		com.h writer.h probe.h
62ROOTHDRDIR=	$(ROOT)/usr/include/tnf
63ROOTHDRS=	$(HDRS:%=$(ROOTHDRDIR)/%)
64CHECKHDRS=	$(HDRS:%.h=%.check)
65$(ROOTHDRS) := 	FILEMODE = 0644
66CHECKHDRS =	$(HDRS:%.h=%.check)
67
68# Include .. first to pick up tnf_trace.h in current dir, Include UFSDIR to
69#	pick up tnf_types.h
70CPPFLAGS +=	-I.. -I$(UFSDIR) -D_REENTRANT -D_TNF_LIBRARY
71
72LINTFLAGS +=	-y
73
74$(ROOTHDRS) :=	FILEMODE = 644
75
76$(DYNLIB):	$(MAPFILE)
77
78$(MAPFILE):
79	@cd $(MAPDIR); $(MAKE) mapfile
80
81LDLIBS += -lc
82
83.KEEP_STATE:
84
85all: $(LIBS)
86
87install_h: $(ROOTHDRDIR) $(ROOTHDRS)
88
89lint:
90	$(LINT.c) $(SRCS)
91
92check: $(CHECKHDRS)
93
94$(ROOTLIBDIR) $(ROOTHDRDIR):
95	$(INS.dir)
96
97$(ROOTHDRDIR)/% : %
98	$(INS.file)
99
100#ASFLAGS=	-K pic -P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS)
101ASFLAGS=	-P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS)
102BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
103
104objs/%.o pics/%.o: ../%.s
105		$(COMPILE.s) -o $@ $<
106		$(POST_PROCESS_O)
107
108pics/%.o objs/%.o: ../%.c
109		$(COMPILE.c) -o $@ $<
110		$(POST_PROCESS_O)
111
112pics/%.o objs/%.o:	$(UFSDIR)/%.c
113		$(COMPILE.c) -o $@ $<
114		$(POST_PROCESS_O)
115
116include ../../Makefile.targ
117