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