xref: /illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile (revision 581cede61ac9c14d8d4ea452562a567189eead78)
1#
2# ident	"%Z%%M%	%I%	%E% SMI"
3#
4# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
5# Use is subject to license terms.
6#
7
8ROUTEDPROG=	in.routed
9ROUTEDOBJS=	common.o if.o input.o main.o output.o parms.o radix.o \
10                rdisc.o table.o trace.o
11ROUTEDSRCS=	$(ROUTEDOBJS:.o=.c)
12RTQUERYPROG=	rtquery
13RTQUERYOBJS=	common.o rtquery.o
14RTQUERYSRCS=	$(RTQUERYOBJS:.o=.c)
15POFILEOBJS=	$(ROUTEDOBJS) $(RTQUERYOBJS)
16
17PROG=		$(ROUTEDPROG) $(RTQUERYPROG)
18SRCS=		$(ROUTEDSRCS) $(RTQUERYSRCS)
19
20MANIFEST=		route.xml
21SVCMETHOD=		svc-route
22
23include		../../../Makefile.cmd
24
25ROOTMANIFESTDIR=	$(ROOTSVCNETWORKROUTING)
26
27#
28# in.routed uses ancillary data features available through
29# the Open Group's Networking Services standard.  The following
30# pre-processor definitions enable these features.
31#
32_D_XOPEN_EXTN = -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
33
34# Turning on __EXTENSIONS__ breaks lint, and we need __EXTENSIONS__.
35# This is really a lint problem, so around the breakage.
36LINTFLAGS += -erroff=E_FUNC_DECL_VAR_ARG2 -erroff=E_INCONS_VAL_TYPE_DECL2 \
37	     -erroff=E_INCONS_ARG_DECL2 -erroff=E_INCONS_ARG_USED2
38
39CPPFLAGS +=	$(_D_XOPEN_EXTN)
40CFLAGS +=	$(CCVERBOSE)
41LDLIBS +=	-lxnet -lmd -lsocket
42CLEAN_FILES +=	$(ROUTEDOBJS) $(RTQUERYOBJS)
43CLOBBERFILES +=	$(ROUTEDPROG) $(RTQUERYPROG)
44#
45# Message catalog
46#
47POFILE=		in.routed.po
48POFILES=  $(POFILEOBJS:.o=.po)
49#
50$(ROUTEDPROG):=	LDLIBS += -lkstat
51lint	:=	LDLIBS += -lkstat
52
53# This needs to be done because of SPARC/x86 differences.  On x86,
54# double has required alignment of only 4 bytes, but on SPARC it's 8
55# bytes.  This means that sockaddr_in can be casted to
56# sockaddr_storage without complaint on x86, but requires a
57# suppression directive on SPARC.
58LINTFLAGS +=	-erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
59
60.KEEP_STATE:
61
62.PARALLEL: $(ROUTEDPROG) $(RTQUERYOBJS)
63
64all:	$(PROG)
65
66$(POFILE): $(POFILES)
67	$(RM) $@
68	cat $(POFILES) > $@
69
70$(ROUTEDPROG):	$(ROUTEDOBJS)
71	$(LINK.c) -o $@ $(ROUTEDOBJS) $(LDLIBS)
72	$(POST_PROCESS)
73
74$(RTQUERYPROG): $(RTQUERYOBJS)
75	$(LINK.c) -o $@ $(RTQUERYOBJS) $(LDLIBS) -lresolv
76	$(POST_PROCESS)
77
78lint:
79	$(LINT.c) $(ROUTEDSRCS) $(LDLIBS)
80	$(LINT.c) $(RTQUERYSRCS) $(LDLIBS)
81
82install:	all $(ROOTUSRSBINPROG) $(ROOTMANIFEST) $(ROOTSVCMETHOD)
83
84check:		$(CHKMANIFEST)
85
86clean:
87	$(RM) $(CLEAN_FILES)
88
89include		../../../Makefile.targ
90