xref: /illumos-gate/usr/src/cmd/mdb/Makefile.libstandctf (revision 6a817834d81cc75ce12d0d393320837b1fec1e85)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# Copyright 2018 Joyent, Inc.
26#
27
28.KEEP_STATE:
29
30CTF_COMMON_SRCS = \
31	ctf_create.c \
32	ctf_decl.c \
33	ctf_error.c \
34	ctf_hash.c \
35	ctf_labels.c \
36	ctf_lookup.c \
37	ctf_open.c \
38	ctf_types.c \
39	ctf_util.c
40
41CTF_STUB_SRCS = \
42	ctf_subr.c
43
44MAPFILE = ../../../common/libstandctf/mapfile
45
46$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
47CPPFLAGS += -I$(SRC)/common/ctf -I../../../common -DCTF_OLD_VERSIONS -D_MDB \
48    -Dvsnprintf=ctf_vsnprintf -Dassfail=kmdb_prom_assfail
49
50CSTD = $(CSTD_GNU99)
51C99LMODE = -Xc99=%all
52
53#
54# kmdb is a kernel module, so we'll use the kernel's build flags.
55CFLAGS64 += $(STAND_FLAGS_64)
56
57LDFLAGS = $(ZNOVERSION) $(BREDUCE) -Wl,-M$(MAPFILE) -dy -r
58
59LIB = libstandctf.so
60OBJS = $(CTF_COMMON_SRCS:%.c=%.o) $(CTF_STUB_SRCS:%.c=%.o)
61
62CERRWARN += $(CNOWARN_UNINIT)
63
64.NO_PARALLEL:
65.PARALLEL: $(OBJS)
66
67install all: $(LIB)
68
69$(LIB): $(OBJS) $(MAPFILE)
70	$(LD) $(LDFLAGS) -o $@ $(OBJS)
71
72clobber clean:
73	$(RM) $(LIB) $(OBJS)
74
75#
76# Dynamic rules for object construction
77#
78
79%.o: ../../../common/libstandctf/%.c
80	$(COMPILE.c) $<
81	$(CTFCONVERT_O)
82
83%.o: $(SRC)/common/ctf/%.c
84	$(COMPILE.c) $<
85	$(CTFCONVERT_O)
86