Makefile revision 6e91bba0d6c6bdabbba62cefae583715a4a58e2a
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# CDDL HEADER START
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# The contents of this file are subject to the terms of the
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# Common Development and Distribution License (the "License").
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# You may not use this file except in compliance with the License.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# or http://www.opensolaris.org/os/licensing.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# See the License for the specific language governing permissions
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# and limitations under the License.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# When distributing Covered Code, include this CDDL HEADER in each
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# If applicable, add the following below this CDDL HEADER, with the
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# fields enclosed by brackets "[]" replaced with your own identifying
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# information: Portions Copyright [yyyy] [name of copyright owner]
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# CDDL HEADER END
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye#
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# Use is subject to license terms.
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye#
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyePROG = ifconfig
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeROOTFS_PROG = $(PROG)
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeLOCALOBJS= ifconfig.o revarp.o
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeCOMMONOBJS= compat.o
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeOBJS= $(LOCALOBJS) $(COMMONOBJS)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyeinclude ../../../Makefile.cmd
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyeinclude ../../Makefile.cmd-inet
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeLOCALSRCS= $(LOCALOBJS:%.o=%.c)
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeCOMMONSRCS= $(CMDINETCOMMONDIR)/$(COMMONOBJS:%.o=%.c)
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeSRCS= $(LOCALSRCS) $(COMMONSRCS)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeCPPFLAGS += -I$(CMDINETCOMMONDIR) -I$(SRC)/common/net/dhcp
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeLDLIBS += -ldhcpagent -ldlpi -linetutil -lipmp -ldladm -lipadm
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeLINTFLAGS += -m
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# ifconfig uses the ancillary data feature which is available only through
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# UNIX 98 standards version of Socket interface. This interface is supposed to
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# be accessed by -lxnet. In addition -lsocket and -lnsl are used to
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# capture new not-yet-standard interfaces. Someday -lxnet alone should be
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# enough when IPv6 inspired new interfaces are part of standards.
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeLDLIBS += -lxnet -lsocket -lnsl
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye# these #defines are required to use UNIX 98 interfaces
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye_D_UNIX98_EXTN= -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye$(OBJS) := CPPFLAGS += $(_D_UNIX98_EXTN)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond NorbyeLINTFLAGS += $(_D_UNIX98_EXTN)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye.KEEP_STATE:
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyeall: $(ROOTFS_PROG)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye$(PROG): $(OBJS)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye $(POST_PROCESS)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyeinstall: all $(ROOTSBINPROG) $(ROOTUSRSBINLINKS)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye$(ROOTUSRSBINLINKS):
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye -$(RM) $@; $(SYMLINK) ../../sbin/$(@F) $@
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyeclean:
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye $(RM) $(OBJS)
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyelint: lint_SRCS
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbyeinclude ../../../Makefile.targ
a1318a82916028f363b3c5b52e7fd7256b632497Trond Norbye