xref: /titanic_52/usr/src/cmd/sgs/nm/sparc/Makefile (revision 4b56a00321e0ce508e55cc5e43e3ad7b00005a39)
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 2008 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 +=	$(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf
51LINTFLAGS=	-x $(LDLIBS)
52LINTSRCS=	$(SRCS)
53CLEANFILES +=	$(LINTOUTS)
54objs.xpg4/%.o := CPPFLAGS += -DXPG4
55
56
57# Building SUNWonld results in a call to the `package' target.  Requirements
58# needed to run this application on older releases are established:
59#	i18n support requires libintl.so.1 prior to 2.6
60
61package :=	LDLIBS += /usr/lib/libintl.so.1
62
63
64objs.xpg4/%.o:	../common/%.c
65		$(COMPILE.c) -o $@ $<
66
67%.o:		../common/%.c
68		$(COMPILE.c) $<
69
70.KEEP_STATE:
71
72all:		$(PROG) $(XPG4)
73
74$(PROG):	$(OBJS)
75		$(LINK.c) $(OBJS) -o $@ $(LLDFLAGS) $(LDLIBS)
76		$(POST_PROCESS)
77
78$(XPG4):	$(XPG4OBJS)
79		$(LINK.c) $(XPG4OBJS) -o $@ $(LDLIBS)
80		$(POST_PROCESS)
81
82$(XPG4OBJS):	objs.xpg4
83
84objs.xpg4:
85	-@mkdir -p $@
86
87package \
88install:	all $(VAR_SGSBINPROG) $(ROOTXPG4PROG) $(VAR_SGSCCSLINK)
89
90clean:
91		$(RM) $(OBJS) $(XPG4OBJS) $(CLEANFILES)
92
93lint:		 $(LINTOUT32) $(SGSLINTOUT)
94
95include		../../../Makefile.targ
96include		../../Makefile.targ
97