xref: /titanic_51/usr/src/tools/ctf/cvt/Makefile.targ (revision 06e46062ef4f5f4b687cbafb4518fb123fe23920)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29all: $(PROG)
30
31ctfconvert: $(CVTOBJS)
32	$(LINK.c) -o $@ $(CVTOBJS) $(LDLIBS)
33	$(POST_PROCESS)
34
35ctfmerge: $(MRGOBJS)
36	$(LINK.c) -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