xref: /titanic_52/usr/src/cmd/sgs/nm/amd64/Makefile (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
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
29PROG=		nm
30
31ARFORMAT=	PORTAR
32
33include 	../../../Makefile.cmd
34include 	../../Makefile.com
35
36COMOBJS=	nm.o
37
38OBJS=		$(COMOBJS)
39
40SRCS=		$(COMOBJS:%.o=../common/%.c)
41
42LDFLAGS +=	'-R$$ORIGIN/../../../lib/$(MACH64)'
43INCLIST=	-I../../include -I../../include/sparc \
44		-I$(SRCBASE)/uts/$(ARCH)/sys
45CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
46LDLIBS +=	-L ../../sgsdemangler/amd64 -ldemangle \
47		-L ../../libconv/amd64 -lconv -lelf
48LINTFLAGS64=	-mx $(LDLIBS) -Xarch=amd64
49CLEANFILES +=	$(LINTOUT)
50
51
52%.o:		../common/%.c
53		$(COMPILE.c) $<
54
55$(ROOTCCSBIN64)/%: %
56	$(INS.file)
57
58.KEEP_STATE:
59
60all:		$(PROG)
61
62$(PROG):	$(OBJS) ../../sgsdemangler/amd64/libdemangle.a
63		$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
64		$(POST_PROCESS)
65
66package \
67install:	all $(ROOTCCSBINPROG64)
68
69clean:
70		$(RM) $(OBJS) $(CLEANFILES)
71
72lint:		$(LINTOUT)
73
74$(LINTOUT):	$(SRCS)
75		$(LINT.c) $(SRCS) > $(LINTOUT) 2>&1
76
77include		../../../Makefile.targ
78include		../../Makefile.sub.64
79