xref: /titanic_52/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile (revision 03831d35f7499c87d51205817c93e9a8d42c4bae)
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
20include         ../../../Makefile.cmd
21
22#
23# in.routed uses ancillary data features available through
24# the Open Group's Networking Services standard.  The following
25# pre-processor definitions enable these features.
26#
27_D_XOPEN_EXTN = -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
28
29# Turning on __EXTENSIONS__ breaks lint, and we need __EXTENSIONS__.
30# This is really a lint problem, so around the breakage.
31LINTFLAGS += -erroff=E_FUNC_DECL_VAR_ARG2 -erroff=E_INCONS_VAL_TYPE_DECL2 \
32	     -erroff=E_INCONS_ARG_DECL2 -erroff=E_INCONS_ARG_USED2
33
34CPPFLAGS +=	$(_D_XOPEN_EXTN)
35CFLAGS +=	$(CCVERBOSE)
36LDLIBS +=	-lxnet -lmd -lsocket
37CLEAN_FILES +=	$(ROUTEDOBJS) $(RTQUERYOBJS)
38CLOBBERFILES +=	$(ROUTEDPROG) $(RTQUERYPROG)
39#
40# Message catalog
41#
42POFILE=		in.routed.po
43POFILES=  $(POFILEOBJS:.o=.po)
44#
45$(ROUTEDPROG):=	LDLIBS += -lkstat
46lint	:=	LDLIBS += -lkstat
47
48# This needs to be done because of SPARC/x86 differences.  On x86,
49# double has required alignment of only 4 bytes, but on SPARC it's 8
50# bytes.  This means that sockaddr_in can be casted to
51# sockaddr_storage without complaint on x86, but requires a
52# suppression directive on SPARC.
53LINTFLAGS +=	-erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
54
55.KEEP_STATE:
56
57.PARALLEL: $(ROUTEDPROG) $(RTQUERYOBJS)
58
59all:	$(PROG)
60
61$(POFILE): $(POFILES)
62	$(RM) $@
63	cat $(POFILES) > $@
64
65$(ROUTEDPROG):	$(ROUTEDOBJS)
66	$(LINK.c) -o $@ $(ROUTEDOBJS) $(LDLIBS)
67	$(POST_PROCESS)
68
69$(RTQUERYPROG): $(RTQUERYOBJS)
70	$(LINK.c) -o $@ $(RTQUERYOBJS) $(LDLIBS) -lresolv
71	$(POST_PROCESS)
72
73lint:
74	$(LINT.c) $(ROUTEDSRCS) $(LDLIBS)
75	$(LINT.c) $(RTQUERYSRCS) $(LDLIBS)
76
77install:	all $(ROOTUSRSBINPROG) $(MANTARGET)
78
79clean:
80	$(RM) $(CLEAN_FILES)
81
82include		../../../Makefile.targ
83