xref: /titanic_50/usr/src/cmd/mdb/Makefile.libstand (revision b494511a9cf72b1fc4eb13a0e593f55c624ab829)
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 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29.KEEP_STATE:
30.SUFFIXES:
31
32include ../../Makefile.libstand
33
34SRCS += \
35	bcmp.c \
36	bcopy.c \
37	bsearch.c \
38	bzero.c \
39	ctime.c \
40	ctype.c \
41	errno.c \
42	getopt.c \
43	memchr.c \
44	memcmp.c \
45	memcpy.c \
46	memccpy.c \
47	memmove.c \
48	memset.c \
49	qsort.c \
50	string.c \
51	strtol.c \
52	strtoul.c
53
54# We don't want thread-specific errno's in kmdb, as we're single-threaded.
55DTS_ERRNO=
56
57INCDIRS = \
58	../../../common/libstand \
59	../../libstand \
60	$(ROOT)/usr/include
61
62$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
63CPPFLAGS = $(INCDIRS:%=-I%) -D_KMDB
64
65#
66# kmdb is a kernel module, so we'll use the kernel's build flags.
67CFLAGS += $(STAND_FLAGS_32)
68CFLAGS64 += $(STAND_FLAGS_64)
69
70ASFLAGS += -P -D_ASM
71
72LINTFLAGS += -n -errtags=yes
73CLINTFILES = $(SRCS:%.c=%.ln)
74LINTFILES = $(CLINTFILES:%.s=%.ln)
75
76LIB = libstand.a
77COBJS = $(SRCS:%.c=%.o)
78OBJS = $(COBJS:%.s=%.o)
79
80.NO_PARALLEL:
81.PARALLEL: $(OBJS) $(LINTFILES)
82
83install all: $(LIB)
84
85$(LIB): $(OBJS)
86	$(AR) r $(LIB) $(OBJS)
87
88clobber clean:
89	$(RM) $(LIB) $(OBJS) $(LINTFILES)
90
91lint: $(LINTFILES)
92	$(LINT) $(LINTFLAGS) $(LINTFILES)
93
94#
95# Dynamic rules for object construction
96#
97
98%.o: ../../../common/libstand/%.c
99	$(COMPILE.c) $<
100	$(CTFCONVERT_O)
101
102%.o: $(SRC)/common/util/%.c
103	$(COMPILE.c) $<
104	$(CTFCONVERT_O)
105
106%.o: $(SRC)/common/util/i386/%.s
107	$(COMPILE.s) $<
108
109%.o: ../../libstand/%.c
110	$(COMPILE.c) -o $@ $<
111	$(CTFCONVERT_O)
112
113%.o: ../../libstand/%.s
114	$(COMPILE.s) -o $@ $<
115
116#
117# Lint
118#
119
120%.ln: ../../../common/libstand/%.c
121	$(LINT.c) -c $<
122
123%.ln: $(SRC)/common/util/%.c
124	$(LINT.c) -c $<
125
126%.ln: $(SRC)/common/util/i386/%.s
127	$(LINT.s) -c $<
128
129%.ln: ../../libstand/%.c
130	$(LINT.c) -c $<
131
132%.ln: %.s
133	$(LINT.s) -c $<
134