xref: /titanic_50/usr/src/cmd/sgs/nm/i386/Makefile (revision f9edfba4e2ac2531f0e52d0c4007976054e1023d)
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/i386/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/i386 \
47		-I$(SRCBASE)/uts/$(ARCH)/sys
48DEFLIST=	-DTARGET=I386 -DI386=1 -D$(ARFORMAT) -DELF
49CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
50LDLIBS +=	-L ../../sgsdemangler/i386 -ldemangle \
51		$(CONVLIBDIR) $(CONV_LIB) -lelf
52LINTFLAGS +=	-x $(LDLIBS)
53LINTSRCS=	$(SRCS)
54CLEANFILES +=	$(LINTOUT)
55objs.xpg4/%.o := CPPFLAGS += -DXPG4
56
57$(DEMOBJS):=	DEFLIST = -DELF_OBJ
58
59# Building SUNWonld results in a call to the `package' target.  Requirements
60# needed to run this application on older releases are established:
61#	i18n support requires libintl.so.1 prior to 2.6
62
63package :=	LDLIBS += /usr/lib/libintl.so.1
64
65
66objs.xpg4/%.o:	../common/%.c
67		$(COMPILE.c) -o $@ $<
68
69%.o:		../common/%.c
70		$(COMPILE.c) $<
71
72.KEEP_STATE:
73
74all:		$(PROG) $(XPG4)
75
76$(PROG):	$(OBJS) ../../sgsdemangler/i386/libdemangle.a
77		$(LINK.c) $(OBJS) -o $@ $(LLDFLAGS) $(LDLIBS)
78		$(POST_PROCESS)
79
80$(XPG4):	$(XPG4OBJS) ../../sgsdemangler/i386/libdemangle.a
81		$(LINK.c) $(XPG4OBJS) -o $@ $(LDLIBS)
82		$(POST_PROCESS)
83
84$(XPG4OBJS):	objs.xpg4
85
86objs.xpg4:
87	-@mkdir -p $@
88
89package \
90install:	all $(VAR_SGSBINPROG) $(ROOTXPG4PROG) $(VAR_SGSCCSLINK)
91
92clean:
93		$(RM) $(OBJS) $(XPG4OBJS) $(CLEANFILES)
94
95lint:		 $(LINTOUT32) $(SGSLINTOUT)
96
97include		../../../Makefile.targ
98include		../../Makefile.targ
99