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