xref: /titanic_41/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/Makefile (revision ead1f93ee620d7580f7e53350fe5a884fc4f158a)
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# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24
25PROG=		ilbadm
26
27ILB_OBJS =	ilbadm.o ilbadm_sg.o ilbadm_rules.o ilbadm_hc.o
28ILB_OBJS +=	ilbadm_subr.o ilbadm_import.o ilbadm_nat.o ilbadm_stats.o
29LIST_OBJS =	list.o
30OBJS =		$(ILB_OBJS) $(LIST_OBJS)
31
32ILB_SRCS=	$(ILB_OBJS:.o=.c)
33LIST_SRCS=	$(LIST_OBJS:%.o=../../../../uts/common/os/%.c)
34
35SRCS=		$(ILB_SRC) $(LIST_SRCS)
36
37include	../../../Makefile.cmd
38include ../../Makefile.cmd-inet
39
40LDLIBS +=	-lsocket -lnsl -lilb -linetutil -lkstat
41CPPFLAGS +=	-I$(SRC)/lib/libilb/common -I$(SRC)/uts/common
42
43C99MODE =	$(C99_ENABLE)
44
45# for debug:
46CFLAGS = -g
47STRIP_STABS= :
48
49POFILES =	$(ILB_OBJS:%.o=%.po)
50POFILE =	$(PROG)_all.po
51
52.KEEP_STATE:
53.PARALLEL:
54
55all:	$(PROG)
56
57$(PROG): $(OBJS)
58	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
59	$(POST_PROCESS)
60
61$(POFILE): $(POFILES)
62	$(RM) $@
63	cat $(POFILES) > $@
64
65install: all $(ROOTUSRSBINPROG)
66
67clean:
68	$(RM) $(OBJS) $(POFILES)
69
70lint:	$(ILB_SRCS)
71	$(LINT.c) $(ILB_SRCS) $(LDLIBS)
72
73check:	$(ILB_SRCS) $(PROG).h
74	$(CSTYLE) -pP $(ILB_SRCS) $(PROG).h
75	$(HDRCHK) $(PROG).h
76
77include ../../../Makefile.targ
78
79# the below is needed to get list.o built
80%.o: ../../../../uts/common/os/%.c
81	$(COMPILE.c) -o $@ $<
82	$(POST_PROCESS_O)
83