xref: /titanic_44/usr/src/tools/ctf/cvt/Makefile.targ (revision af4c679f647cf088543c762e33d41a3ac52cfa14)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26all: $(PROG)
27
28ctfconvert: $(CVTOBJS)
29	$(LINK.c) -o $@ $(CVTOBJS) $(LDLIBS)
30	$(POST_PROCESS)
31
32# Remove this after build snv_126
33CTFMERGE_VERSION=-M../mapfile-vers
34
35ctfmerge: $(MRGOBJS)
36	$(LINK.c) $(CTFMERGE_VERSION) -o $@ $(MRGOBJS) $(LDLIBS)
37	$(POST_PROCESS)
38
39%.o: ../%.c
40	$(COMPILE.c) $<
41
42%.ln: ../%.c
43	$(LINT.c) -c $<
44
45$(ROOTONBLDMACHPROG): $(SELFTEST)
46$(SELFTEST): $(PROG)
47
48install: $(PROG) $(SELFTEST) .WAIT $(ROOTONBLDMACHPROG)
49
50lint: $(LINTFILES)
51	$(LINT) $(LINTFLAGS) $(CVTLINTFILES)
52	$(LINT) $(LINTFLAGS) $(MRGLINTFILES)
53
54clean:
55	$(RM) $(OBJS)
56
57CLOBBERFILES=$(LINTFILES)
58
59#
60# After we've built ctfconvert and ctfmerge, let's use them on ourselves.  The
61# RPATH in the built ctfconvert will only know how to find libdwarf if we invoke
62# the one in $(ROOT).  We haven't installed it there yet, though, so we have to
63# invoke the one in $(SRC).  We'll manually tell it where libdwarf is.
64#
65selftest: ctf_o ctfconvert_merge ctfmerge_merge
66
67ctf_o:	$(OBJS:%.o=%_ctf)
68
69%_ctf:	%.o ctfconvert
70	LD_LIBRARY_PATH=$(DWARFSRCLIBDIR)/$(MACH) ./ctfconvert -l $@ $<
71
72ctfconvert_merge: ctf_o ctfmerge
73	./ctfmerge -l $@ -o ctfconvert $(CVTOBJS)
74
75ctfmerge_merge: ctf_o ctfmerge
76	./ctfmerge -l $@ -o ctfmerge $(MRGOBJS)
77
78include ../../Makefile.ctf.targ
79