xref: /illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile (revision 8226594fdd4479be135127f43632f1f995074654)
1#
2#
3# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
4# Use is subject to license terms.
5#
6# Copyright 2020 Joyent, Inc.
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
11RTQUERYPROG=	rtquery
12RTQUERYOBJS=	common.o rtquery.o
13POFILEOBJS=	$(ROUTEDOBJS) $(RTQUERYOBJS)
14
15PROG=		$(ROUTEDPROG) $(RTQUERYPROG)
16
17MANIFEST=		route.xml
18SVCMETHOD=		svc-route
19
20include		../../../Makefile.cmd
21
22ROOTMANIFESTDIR=	$(ROOTSVCNETWORKROUTING)
23
24#
25# in.routed uses ancillary data features available through
26# the Open Group's Networking Services standard.  The following
27# pre-processor definitions enable these features.
28#
29_D_XOPEN_EXTN = -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
30
31CPPFLAGS +=	$(_D_XOPEN_EXTN)
32CFLAGS +=	$(CCVERBOSE)
33CERRWARN +=	-_gcc=-Wno-parentheses
34CERRWARN +=	$(CNOWARN_UNINIT)
35# not linted
36SMATCH=off
37
38LDLIBS +=	-lxnet -lmd
39CLEAN_FILES +=	$(ROUTEDOBJS) $(RTQUERYOBJS)
40CLOBBERFILES +=	$(ROUTEDPROG) $(RTQUERYPROG)
41#
42# Message catalog
43#
44POFILE=		in.routed.po
45POFILES=  $(POFILEOBJS:.o=.po)
46#
47$(ROUTEDPROG):=	LDLIBS += -lkstat
48
49CTFCONVERT_HOOK = && $(CTFCONVERT_O)
50CTFMERGE_HOOK = && $(CTFMERGE) -L VERSION -o $@ $(ROUTEDOBJS)
51$(ROUTEDOBJS) := CFLAGS += $(CTF_FLAGS)
52$(RTQUERYOBJS) := CFLAGS += $(CTF_FLAGS)
53
54.KEEP_STATE:
55
56.PARALLEL: $(ROUTEDPROG) $(RTQUERYOBJS)
57
58all:	$(PROG)
59
60$(POFILE): $(POFILES)
61	$(RM) $@
62	cat $(POFILES) > $@
63
64$(ROUTEDPROG):	$(ROUTEDOBJS)
65	$(LINK.c) -o $@ $(ROUTEDOBJS) $(LDLIBS) $(CTFMERGE_HOOK)
66	$(POST_PROCESS)
67
68$(RTQUERYPROG): $(RTQUERYOBJS)
69	$(LINK.c) -o $@ $(RTQUERYOBJS) $(LDLIBS) -lresolv $(CTFMERGE_HOOK)
70	$(POST_PROCESS)
71
72install:	all $(ROOTUSRSBINPROG) $(ROOTMANIFEST) $(ROOTSVCMETHOD)
73
74check:		$(CHKMANIFEST)
75
76clean:
77	$(RM) $(CLEAN_FILES)
78
79include		../../../Makefile.targ
80