xref: /titanic_41/usr/src/cmd/sgs/nm/sparc/Makefile (revision 355b4669e025ff377602b6fc7caaf30dbc218371)
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# ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# cmd/sgs/nm/sparc/Makefile
29#
30
31PROG=		nm
32XPG4PROG=	nm
33
34ARFORMAT=	PORTAR
35
36include 	../../../Makefile.cmd
37include 	../../Makefile.com
38
39COMOBJS=	nm.o
40
41OBJS=		$(COMOBJS)
42XPG4OBJS=	objs.xpg4/nm.o
43
44SRCS=		$(COMOBJS:%.o=../common/%.c)
45
46LLDFLAGS=	'-R$$ORIGIN/../../lib'
47INCLIST=	-I../../include -I../../include/sparc \
48		-I$(SRCBASE)/uts/$(ARCH)/sys
49DEFLIST=	-DTARGET=SPARC -DSPARC=1 -D$(ARFORMAT) -DELF
50CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
51LDLIBS +=	-L ../../sgsdemangler/sparc -ldemangle \
52		-L ../../libconv/sparc -lconv -lelf
53LINTFLAGS=	-mx $(LDLIBS)
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 $(ROOTCCSBINPROG) $(ROOTXPG4PROG)
90
91clean:
92		$(RM) $(OBJS) $(XPG4OBJS) $(CLEANFILES)
93
94lint:		$(LINTOUT)
95
96$(LINTOUT):	$(SRCS)
97		$(LINT.c) $(SRCS) > $(LINTOUT) 2>&1
98
99include		../../../Makefile.targ
100