xref: /titanic_44/usr/src/cmd/sgs/nm/sparc/Makefile (revision 4a6ec905b96eb96a398c346f59e034a90ce8ad37)
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# ident	"%Z%%M%	%I%	%E% SMI"
23#
24# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26#
27# cmd/sgs/nm/sparc/Makefile
28#
29
30PROG=		nm
31XPG4PROG=	nm
32
33ARFORMAT=	PORTAR
34
35include 	../../../Makefile.cmd
36include 	../../Makefile.com
37
38COMOBJS=	nm.o
39
40OBJS=		$(COMOBJS)
41XPG4OBJS=	objs.xpg4/nm.o
42
43SRCS=		$(COMOBJS:%.o=../common/%.c)
44
45LLDFLAGS=	'-R$$ORIGIN/../../lib'
46INCLIST=	-I../../include -I../../include/sparc \
47		-I$(SRCBASE)/uts/$(ARCH)/sys
48DEFLIST=	-DTARGET=SPARC -DSPARC=1 -D$(ARFORMAT) -DELF
49CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
50LDLIBS +=	-L ../../sgsdemangler/sparc -ldemangle \
51		$(CONVLIBDIR) $(CONV_LIB) -lelf
52LINTFLAGS=	-x $(LDLIBS)
53LINTSRCS=	$(SRCS)
54CLEANFILES +=	$(LINTOUT)
55objs.xpg4/%.o := CPPFLAGS += -DXPG4
56
57
58# Building SUNWonld results in a call to the `package' target.  Requirements
59# needed to run this application on older releases are established:
60#	i18n support requires libintl.so.1 prior to 2.6
61
62package :=	LDLIBS += /usr/lib/libintl.so.1
63
64
65objs.xpg4/%.o:	../common/%.c
66		$(COMPILE.c) -o $@ $<
67
68%.o:		../common/%.c
69		$(COMPILE.c) $<
70
71.KEEP_STATE:
72
73all:		$(PROG) $(XPG4)
74
75$(PROG):	$(OBJS) ../../sgsdemangler/sparc/libdemangle.a
76		$(LINK.c) $(OBJS) -o $@ $(LLDFLAGS) $(LDLIBS)
77		$(POST_PROCESS)
78
79$(XPG4):	$(XPG4OBJS)
80		$(LINK.c) $(XPG4OBJS) -o $@ $(LDLIBS)
81		$(POST_PROCESS)
82
83$(XPG4OBJS):	objs.xpg4
84
85objs.xpg4:
86	-@mkdir -p $@
87
88package \
89install:	all $(VAR_SGSBINPROG) $(ROOTXPG4PROG) $(VAR_SGSCCSLINK)
90
91clean:
92		$(RM) $(OBJS) $(XPG4OBJS) $(CLEANFILES)
93
94lint:		 $(LINTOUT32) $(SGSLINTOUT)
95
96include		../../../Makefile.targ
97include		../../Makefile.targ
98