xref: /titanic_52/usr/src/cmd/mdb/Makefile.libstand (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate#
2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate#
4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate# with the License.
8*7c478bd9Sstevel@tonic-gate#
9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate# and limitations under the License.
13*7c478bd9Sstevel@tonic-gate#
14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate#
20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate#
22*7c478bd9Sstevel@tonic-gate#
23*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate# Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate#
26*7c478bd9Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"
27*7c478bd9Sstevel@tonic-gate#
28*7c478bd9Sstevel@tonic-gate
29*7c478bd9Sstevel@tonic-gate.KEEP_STATE:
30*7c478bd9Sstevel@tonic-gate.SUFFIXES:
31*7c478bd9Sstevel@tonic-gate
32*7c478bd9Sstevel@tonic-gateinclude ../../Makefile.libstand
33*7c478bd9Sstevel@tonic-gate
34*7c478bd9Sstevel@tonic-gateSRCS += \
35*7c478bd9Sstevel@tonic-gate	bcmp.c \
36*7c478bd9Sstevel@tonic-gate	bcopy.c \
37*7c478bd9Sstevel@tonic-gate	bsearch.c \
38*7c478bd9Sstevel@tonic-gate	bzero.c \
39*7c478bd9Sstevel@tonic-gate	ctime.c \
40*7c478bd9Sstevel@tonic-gate	ctype.c \
41*7c478bd9Sstevel@tonic-gate	errno.c \
42*7c478bd9Sstevel@tonic-gate	getopt.c \
43*7c478bd9Sstevel@tonic-gate	memchr.c \
44*7c478bd9Sstevel@tonic-gate	memcmp.c \
45*7c478bd9Sstevel@tonic-gate	memcpy.c \
46*7c478bd9Sstevel@tonic-gate	memccpy.c \
47*7c478bd9Sstevel@tonic-gate	memmove.c \
48*7c478bd9Sstevel@tonic-gate	memset.c \
49*7c478bd9Sstevel@tonic-gate	qsort.c \
50*7c478bd9Sstevel@tonic-gate	string.c \
51*7c478bd9Sstevel@tonic-gate	strtol.c \
52*7c478bd9Sstevel@tonic-gate	strtoul.c
53*7c478bd9Sstevel@tonic-gate
54*7c478bd9Sstevel@tonic-gate# We don't want thread-specific errno's in kmdb, as we're single-threaded.
55*7c478bd9Sstevel@tonic-gateDTS_ERRNO=
56*7c478bd9Sstevel@tonic-gate
57*7c478bd9Sstevel@tonic-gateINCDIRS = \
58*7c478bd9Sstevel@tonic-gate	../../../common/libstand \
59*7c478bd9Sstevel@tonic-gate	../../libstand \
60*7c478bd9Sstevel@tonic-gate	$(ROOT)/usr/include
61*7c478bd9Sstevel@tonic-gate
62*7c478bd9Sstevel@tonic-gate$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
63*7c478bd9Sstevel@tonic-gateCPPFLAGS = $(INCDIRS:%=-I%) -D_KMDB
64*7c478bd9Sstevel@tonic-gate
65*7c478bd9Sstevel@tonic-gate#
66*7c478bd9Sstevel@tonic-gate# kmdb is a kernel module, so we'll use the kernel's build flags.
67*7c478bd9Sstevel@tonic-gateCFLAGS += $(STAND_FLAGS_32)
68*7c478bd9Sstevel@tonic-gateCFLAGS64 += $(STAND_FLAGS_64)
69*7c478bd9Sstevel@tonic-gate
70*7c478bd9Sstevel@tonic-gateASFLAGS += -P -D_ASM
71*7c478bd9Sstevel@tonic-gate
72*7c478bd9Sstevel@tonic-gate#
73*7c478bd9Sstevel@tonic-gate# Reset STRIPFLAG to the empty string.  MDB is intentionally installed
74*7c478bd9Sstevel@tonic-gate# with a symbol table in order to help module developers.
75*7c478bd9Sstevel@tonic-gate#
76*7c478bd9Sstevel@tonic-gateSTRIPFLAG =
77*7c478bd9Sstevel@tonic-gate
78*7c478bd9Sstevel@tonic-gateLINTFLAGS += -n -errtags=yes
79*7c478bd9Sstevel@tonic-gateCLINTFILES = $(SRCS:%.c=%.ln)
80*7c478bd9Sstevel@tonic-gateLINTFILES = $(CLINTFILES:%.s=%.ln)
81*7c478bd9Sstevel@tonic-gate
82*7c478bd9Sstevel@tonic-gateLIB = libstand.a
83*7c478bd9Sstevel@tonic-gateCOBJS = $(SRCS:%.c=%.o)
84*7c478bd9Sstevel@tonic-gateOBJS = $(COBJS:%.s=%.o)
85*7c478bd9Sstevel@tonic-gate
86*7c478bd9Sstevel@tonic-gate.NO_PARALLEL:
87*7c478bd9Sstevel@tonic-gate.PARALLEL: $(OBJS) $(LINTFILES)
88*7c478bd9Sstevel@tonic-gate
89*7c478bd9Sstevel@tonic-gateinstall all: $(LIB)
90*7c478bd9Sstevel@tonic-gate
91*7c478bd9Sstevel@tonic-gate$(LIB): $(OBJS)
92*7c478bd9Sstevel@tonic-gate	$(AR) r $(LIB) $(OBJS)
93*7c478bd9Sstevel@tonic-gate
94*7c478bd9Sstevel@tonic-gateclobber clean:
95*7c478bd9Sstevel@tonic-gate	$(RM) $(LIB) $(OBJS) $(LINTFILES)
96*7c478bd9Sstevel@tonic-gate
97*7c478bd9Sstevel@tonic-gatelint: $(LINTFILES)
98*7c478bd9Sstevel@tonic-gate	$(LINT) $(LINTFLAGS) $(LINTFILES)
99*7c478bd9Sstevel@tonic-gate
100*7c478bd9Sstevel@tonic-gate#
101*7c478bd9Sstevel@tonic-gate# Dynamic rules for object construction
102*7c478bd9Sstevel@tonic-gate#
103*7c478bd9Sstevel@tonic-gate
104*7c478bd9Sstevel@tonic-gate%.o: ../../../common/libstand/%.c
105*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) $<
106*7c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
107*7c478bd9Sstevel@tonic-gate
108*7c478bd9Sstevel@tonic-gate%.o: $(SRC)/common/util/%.c
109*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) $<
110*7c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
111*7c478bd9Sstevel@tonic-gate
112*7c478bd9Sstevel@tonic-gate%.o: ../../libstand/%.c
113*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
114*7c478bd9Sstevel@tonic-gate	$(CTFCONVERT_O)
115*7c478bd9Sstevel@tonic-gate
116*7c478bd9Sstevel@tonic-gate%.o: ../../libstand/%.s
117*7c478bd9Sstevel@tonic-gate	$(COMPILE.s) -o $@ $<
118*7c478bd9Sstevel@tonic-gate
119*7c478bd9Sstevel@tonic-gate#
120*7c478bd9Sstevel@tonic-gate# Lint
121*7c478bd9Sstevel@tonic-gate#
122*7c478bd9Sstevel@tonic-gate
123*7c478bd9Sstevel@tonic-gate%.ln: ../../../common/libstand/%.c
124*7c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
125*7c478bd9Sstevel@tonic-gate
126*7c478bd9Sstevel@tonic-gate%.ln: $(SRC)/common/util/%.c
127*7c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
128*7c478bd9Sstevel@tonic-gate
129*7c478bd9Sstevel@tonic-gate%.ln: ../../libstand/%.c
130*7c478bd9Sstevel@tonic-gate	$(LINT.c) -c $<
131*7c478bd9Sstevel@tonic-gate
132*7c478bd9Sstevel@tonic-gate%.ln: %.s
133*7c478bd9Sstevel@tonic-gate	$(LINT.s) -c $<
134