xref: /titanic_44/usr/src/lib/libtnfctl/Makefile.com (revision b65731f1f612238279eb4d997f43589b535c5646)
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/libtnfctl/Makefile
29#
30
31LIBRARY=	libtnfctl.a
32VERS=		.1
33OBJECTS.c=	open.o		\
34		prb_child.o	\
35		prb_shmem.o	\
36		prb_proc.o	\
37		prb_lmap.o	\
38		prb_rtld.o	\
39		prb_findexec.o	\
40		prb_status.o	\
41		util.o		\
42		traverse.o	\
43		sym.o		\
44		elf.o		\
45		continue.o	\
46		checklib.o	\
47		probes.o	\
48		probes_ext.o	\
49		close.o		\
50		targmem.o	\
51		comb.o		\
52		kernel_int.o	\
53		kernel.o	\
54		internal.o	\
55		status.o
56
57
58OBJECTS.s=	$(MACH)_assm.o
59
60OBJECTS=	$(OBJECTS.c) $(OBJECTS.s)
61
62include ../../Makefile.lib
63
64# We omit $(OBJECTS.s:%.o=%.s) in the next line, because lint no like
65SRCS= $(OBJECTS.c:%.o=../%.c)
66
67LIBS=		$(DYNLIB)
68
69MAPFILE=	$(MAPDIR)/mapfile
70MAPOPTS=	$(MAPFILE:%=-M%)
71CLOBBERFILES +=	$(MAPFILE)
72DYNFLAGS +=	$(MAPOPTS)
73
74HDRS=		tnfctl.h
75ROOTHDRDIR=	$(ROOT)/usr/include/tnf
76ROOTHDRS=	$(HDRS:%=$(ROOTHDRDIR)/%)
77CHECKHDRS=	$(HDRS:%.h=%.check)
78$(ROOTHDRS) := 	FILEMODE = 0644
79CHECKHDRS =	$(HDRS:%.h=%.check)
80
81LDLIBS +=	-lc -lelf
82
83# Uncomment the following line for a debug build
84# COPTFLAG =	-g -DDEBUG $(CCVERBOSE)
85CPPFLAGS +=	-I$(SRC)/lib/libtnfprobe -D_REENTRANT -I$(SRC)/cmd/sgs/include
86
87LINTFLAGS +=	-y
88
89ASFLAGS +=	-P
90
91$(ROOTHDRS) :=	FILEMODE = 644
92
93.KEEP_STATE:
94
95all: $(LIBS)
96
97install_h: $(ROOTHDRDIR) $(ROOTHDRS)
98
99lint:
100	$(LINT.c) $(SRCS)
101
102check: $(CHECKHDRS)
103
104$(DYNLIB):	$(MAPFILE)
105
106$(MAPFILE):
107	@cd $(MAPDIR); $(MAKE) mapfile
108
109$(ROOTLIBDIR) $(ROOTHDRDIR):
110	$(INS.dir)
111
112$(ROOTHDRDIR)/% : %
113	$(INS.file)
114
115BUILD.s=	$(AS) $< -o $@
116
117objs/%.o pics/%.o: ../%.s
118	$(COMPILE.s) -o $@ $<
119	$(POST_PROCESS_O)
120
121objs/%.o pics/%.o: ../%.c
122	$(COMPILE.c) -o $@ $<
123	$(POST_PROCESS_O)
124
125
126%.o:		../%.c
127	$(COMPILE.c) -o $@ $<
128	$(POST_PROCESS_O)
129
130WARLOCK_FILES= $(OBJECTS.c:%.o=%.ll)
131CLEANFILES= $(WARLOCK_FILES)
132warlock_files:	$(WARLOCK_FILES)
133%.ll:		../%.c
134		wlcc $(CFLAGS) $(CPPFLAGS) -o $@ $<
135warlock:	warlock_files
136		warlock -c wlcmd $(WARLOCK_FILES)
137
138include ../../Makefile.targ
139