1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2018 Joyent, Inc.
14#
15
16include $(SRC)/lib/libctf/Makefile.shared.com
17include ../../Makefile.ctf
18
19CSTD = $(CSTD_GNU99)
20C99LMODE = -Xc99=%all
21
22CPPFLAGS +=	-I$(SRC)/lib/libctf/common/ \
23		-I$(SRC)/lib/libdwarf/common/ \
24		-I$(SRC)/lib/mergeq \
25		-include ../../common/ctf_headers.h \
26		-DCTF_OLD_VERSIONS \
27		-DCTF_TOOLS_BUILD
28LDLIBS += -lc -lelf -L$(ROOTONBLDLIBMACH) -ldwarf -lavl
29NATIVE_LIBS += libelf.so libavl.so libc.so
30DYNFLAGS += '-R$$ORIGIN/../../lib/$(MACH)'
31
32# As a bootstrapping issue, we can't use the real mapfile because we build
33# early in tools and thus don't have support for assertions.
34MAPFILES=
35
36.KEEP_STATE:
37
38all: $(LIBS)
39
40install: all $(ROOTONBLDLIBMACH)/libctf.so.1 $(ROOTONBLDLIBMACH)/libctf.so
41
42$(ROOTONBLDLIBMACH)/%: %
43	$(INS.file)
44
45$(ROOTONBLDLIBMACH)/$(LIBLINKS): $(ROOTONBLDLIBMACH)/$(LIBLINKS)$(VERS)
46	$(INS.liblink)
47
48#
49# Just like with libdwarf, we can't actually add ctf to ourselves,
50# because we're part of the tools for creating CTF.
51#
52$(DYNLIB) := CTFMERGE_POST= :
53CTFCONVERT_O= :
54
55include $(SRC)/lib/Makefile.targ
56include $(SRC)/lib/libctf/Makefile.shared.targ
57