Makefile revision 06e1a7147edd272b7296f208141627a5b1191731
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki#
0bf752f4835374c820f9c22ac6b64980729d4b4aTinderbox User# CDDL HEADER START
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# The contents of this file are subject to the terms of the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Common Development and Distribution License (the "License").
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# You may not use this file except in compliance with the License.
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki#
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# or http://www.opensolaris.org/os/licensing.
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# See the License for the specific language governing permissions
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# and limitations under the License.
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki#
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# When distributing Covered Code, include this CDDL HEADER in each
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# If applicable, add the following below this CDDL HEADER, with the
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# fields enclosed by brackets "[]" replaced with your own identifying
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# information: Portions Copyright [yyyy] [name of copyright owner]
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki#
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# CDDL HEADER END
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki#
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki#
6c2a76b3e2ccd32c35814b6e0f54da00190749d7Evan Hunt# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
d71d41341d36ddfd347daab982f0cb85d3dd7c4eMark Andrews# Use is subject to license terms.
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki#
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# ident "%Z%%M% %I% %E% SMI"
23b41e9117c5f58954203325c52583c892e5bb40Mark Andrews#
23b41e9117c5f58954203325c52583c892e5bb40Mark Andrews
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiPROG = ifconfig
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiROOTFS_PROG = $(PROG)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiLOCALOBJS= ifconfig.o revarp.o
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiCOMMONOBJS= compat.o
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiOBJS= $(LOCALOBJS) $(COMMONOBJS)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecickiinclude ../../../Makefile.cmd
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecickiinclude ../../Makefile.cmd-inet
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiLOCALSRCS= $(LOCALOBJS:%.o=%.c)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiCOMMONSRCS= $(CMDINETCOMMONDIR)/$(COMMONOBJS:%.o=%.c)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiSRCS= $(LOCALSRCS) $(COMMONSRCS)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiCPPFLAGS += -I$(CMDINETCOMMONDIR) -I$(SRC)/common/net/dhcp
50433a667cf0ed3ac7807768b745b0d870ff8c8bMark AndrewsLDLIBS += -ldevinfo -ldhcpagent -linetcfg -ldlpi
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiLINTFLAGS += -m
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold KrecickiROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%)
50433a667cf0ed3ac7807768b745b0d870ff8c8bMark Andrews
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# ifconfig uses the ancillary data feature which is available only through
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# UNIX 98 standards version of Socket interface. This interface is supposed to
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# be accessed by -lxnet. In addition -lsocket and -lnsl are used to
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# capture new not-yet-standard interfaces. Someday -lxnet alone should be
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki# enough when IPv6 inspired new interfaces are part of standards.
3c12bec945ee71a38c5ba6f624abd12e2da7eea5Mark AndrewsLDLIBS += -lxnet -lsocket -lnsl
3c12bec945ee71a38c5ba6f624abd12e2da7eea5Mark Andrews
3c12bec945ee71a38c5ba6f624abd12e2da7eea5Mark Andrews# these #defines are required to use UNIX 98 interfaces
3c12bec945ee71a38c5ba6f624abd12e2da7eea5Mark Andrews_D_UNIX98_EXTN= -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki$(OBJS) := CPPFLAGS += $(_D_UNIX98_EXTN)
d71d41341d36ddfd347daab982f0cb85d3dd7c4eMark Andrews
d71d41341d36ddfd347daab982f0cb85d3dd7c4eMark AndrewsLINTFLAGS += $(_D_UNIX98_EXTN)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki.KEEP_STATE:
d4eaef0b87f2705f27e716f116a9947f5f9e197aMark Andrews
d71d41341d36ddfd347daab982f0cb85d3dd7c4eMark Andrewsall: $(ROOTFS_PROG)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki$(PROG): $(OBJS)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki $(POST_PROCESS)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecickiinstall: all $(ROOTSBINPROG) $(ROOTUSRSBINLINKS)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
d4eaef0b87f2705f27e716f116a9947f5f9e197aMark Andrews$(ROOTUSRSBINLINKS):
d71d41341d36ddfd347daab982f0cb85d3dd7c4eMark Andrews -$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecickiclean:
50433a667cf0ed3ac7807768b745b0d870ff8c8bMark Andrews $(RM) $(OBJS)
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecickilint: lint_SRCS
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecicki
7a00d69909ace5dc11bcff9c1e07c311f92a7f8eWitold Krecickiinclude ../../../Makefile.targ
d4eaef0b87f2705f27e716f116a9947f5f9e197aMark Andrews