xref: /titanic_52/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/Makefile (revision 1cb6af97c6f66f456d4f726ef056e1ebc0f73305)
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# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29PROG =		ifconfig
30ROOTFS_PROG =	$(PROG)
31LOCALOBJS=	dupl_addr.o ifconfig.o revarp.o
32COMMONOBJS=	compat.o
33OBJS=		$(LOCALOBJS) $(COMMONOBJS)
34
35include ../../../Makefile.cmd
36include ../../Makefile.cmd-inet
37
38LOCALSRCS=	$(LOCALOBJS:%.o=%.c)
39COMMONSRCS=	$(CMDINETCOMMONDIR)/$(COMMONOBJS:%.o=%.c)
40SRCS=		$(LOCALSRCS) $(COMMONSRCS)
41
42CPPFLAGS +=	-I$(CMDINETCOMMONDIR) -I$(SRC)/common/net/dhcp
43LDLIBS +=       -lcmd -ldevinfo -ldhcpagent -linetcfg -ldlpi
44LINTFLAGS +=	-m
45
46ROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%)
47
48# ifconfig uses the ancillary data feature which is available only through
49# UNIX 98 standards version of Socket interface. This interface is supposed to
50# be accessed by -lxnet. In addition -lsocket and -lnsl are used to
51# capture new not-yet-standard interfaces. Someday -lxnet alone should be
52# enough when IPv6 inspired new interfaces are part of standards.
53LDLIBS +=	-lxnet -lsocket -lnsl
54
55# these #defines are required to use UNIX 98 interfaces
56_D_UNIX98_EXTN= -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
57
58$(OBJS)		:= CPPFLAGS +=	$(_D_UNIX98_EXTN)
59
60LINTFLAGS +=	$(_D_UNIX98_EXTN)
61
62.KEEP_STATE:
63
64all:	$(ROOTFS_PROG)
65
66$(PROG):	$(OBJS)
67	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
68	$(POST_PROCESS)
69
70install:	all $(ROOTSBINPROG) $(ROOTUSRSBINLINKS)
71
72$(ROOTUSRSBINLINKS):
73	-$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
74
75clean:
76	$(RM) $(OBJS)
77
78lint:	lint_SRCS
79
80include ../../../Makefile.targ
81