xref: /titanic_52/usr/src/cmd/sgs/nm/i386/Makefile (revision ea8dc4b6d2251b437950c0056bc626b311c73c27)
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/i386/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/i386 \
48		-I$(SRCBASE)/uts/$(ARCH)/sys
49DEFLIST=	-DTARGET=I386 -DI386=1 -D$(ARFORMAT) -DELF
50CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
51LDLIBS +=	-L ../../sgsdemangler/i386 -ldemangle \
52		-L ../../libconv/i386 -lconv -lelf
53LINTFLAGS +=	$(LDLIBS)
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 $(ROOTCCSBINPROG) $(ROOTXPG4PROG)
91
92clean:
93		$(RM) $(OBJS) $(XPG4OBJS) $(CLEANFILES)
94
95lint:		$(LINTOUT)
96
97$(LINTOUT):	$(SRCS)
98		$(LINT.c) $(SRCS) > $(LINTOUT) 2>&1
99
100include		../../../Makefile.targ
101