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