17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# 31f465d43SSowmini Varadhan# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 47c478bd9Sstevel@tonic-gate# Use is subject to license terms. 57c478bd9Sstevel@tonic-gate# 67c478bd9Sstevel@tonic-gate 77c478bd9Sstevel@tonic-gateROUTEDPROG= in.routed 87c478bd9Sstevel@tonic-gateROUTEDOBJS= common.o if.o input.o main.o output.o parms.o radix.o \ 97c478bd9Sstevel@tonic-gate rdisc.o table.o trace.o 107c478bd9Sstevel@tonic-gateROUTEDSRCS= $(ROUTEDOBJS:.o=.c) 117c478bd9Sstevel@tonic-gateRTQUERYPROG= rtquery 127c478bd9Sstevel@tonic-gateRTQUERYOBJS= common.o rtquery.o 137c478bd9Sstevel@tonic-gateRTQUERYSRCS= $(RTQUERYOBJS:.o=.c) 147c478bd9Sstevel@tonic-gatePOFILEOBJS= $(ROUTEDOBJS) $(RTQUERYOBJS) 157c478bd9Sstevel@tonic-gate 167c478bd9Sstevel@tonic-gatePROG= $(ROUTEDPROG) $(RTQUERYPROG) 177c478bd9Sstevel@tonic-gateSRCS= $(ROUTEDSRCS) $(RTQUERYSRCS) 187c478bd9Sstevel@tonic-gate 19a192e900SamaguireMANIFEST= route.xml 20a192e900SamaguireSVCMETHOD= svc-route 21a192e900Samaguire 227c478bd9Sstevel@tonic-gateinclude ../../../Makefile.cmd 237c478bd9Sstevel@tonic-gate 24a192e900SamaguireROOTMANIFESTDIR= $(ROOTSVCNETWORKROUTING) 25a192e900Samaguire 267c478bd9Sstevel@tonic-gate# 277c478bd9Sstevel@tonic-gate# in.routed uses ancillary data features available through 287c478bd9Sstevel@tonic-gate# the Open Group's Networking Services standard. The following 297c478bd9Sstevel@tonic-gate# pre-processor definitions enable these features. 307c478bd9Sstevel@tonic-gate# 317c478bd9Sstevel@tonic-gate_D_XOPEN_EXTN = -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate# Turning on __EXTENSIONS__ breaks lint, and we need __EXTENSIONS__. 347c478bd9Sstevel@tonic-gate# This is really a lint problem, so around the breakage. 357c478bd9Sstevel@tonic-gateLINTFLAGS += -erroff=E_FUNC_DECL_VAR_ARG2 -erroff=E_INCONS_VAL_TYPE_DECL2 \ 367c478bd9Sstevel@tonic-gate -erroff=E_INCONS_ARG_DECL2 -erroff=E_INCONS_ARG_USED2 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gateCPPFLAGS += $(_D_XOPEN_EXTN) 397c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 40*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 41*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized 42734b6a94SdarrenmLDLIBS += -lxnet -lmd -lsocket 437c478bd9Sstevel@tonic-gateCLEAN_FILES += $(ROUTEDOBJS) $(RTQUERYOBJS) 447c478bd9Sstevel@tonic-gateCLOBBERFILES += $(ROUTEDPROG) $(RTQUERYPROG) 457c478bd9Sstevel@tonic-gate# 467c478bd9Sstevel@tonic-gate# Message catalog 477c478bd9Sstevel@tonic-gate# 487c478bd9Sstevel@tonic-gatePOFILE= in.routed.po 497c478bd9Sstevel@tonic-gatePOFILES= $(POFILEOBJS:.o=.po) 507c478bd9Sstevel@tonic-gate# 517c478bd9Sstevel@tonic-gate$(ROUTEDPROG):= LDLIBS += -lkstat 527c478bd9Sstevel@tonic-gatelint := LDLIBS += -lkstat 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate# This needs to be done because of SPARC/x86 differences. On x86, 557c478bd9Sstevel@tonic-gate# double has required alignment of only 4 bytes, but on SPARC it's 8 567c478bd9Sstevel@tonic-gate# bytes. This means that sockaddr_in can be casted to 577c478bd9Sstevel@tonic-gate# sockaddr_storage without complaint on x86, but requires a 587c478bd9Sstevel@tonic-gate# suppression directive on SPARC. 597c478bd9Sstevel@tonic-gateLINTFLAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 607c478bd9Sstevel@tonic-gate 611f465d43SSowmini VaradhanCTFCONVERT_HOOK = && $(CTFCONVERT_O) 621f465d43SSowmini VaradhanCTFMERGE_HOOK = && $(CTFMERGE) -L VERSION -o $@ $(ROUTEDOBJS) 631f465d43SSowmini Varadhan$(ROUTEDOBJS) := CFLAGS += $(CTF_FLAGS) 641f465d43SSowmini Varadhan$(RTQUERYOBJS) := CFLAGS += $(CTF_FLAGS) 651f465d43SSowmini Varadhan 667c478bd9Sstevel@tonic-gate.KEEP_STATE: 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate.PARALLEL: $(ROUTEDPROG) $(RTQUERYOBJS) 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gateall: $(PROG) 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES) 737c478bd9Sstevel@tonic-gate $(RM) $@ 747c478bd9Sstevel@tonic-gate cat $(POFILES) > $@ 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate$(ROUTEDPROG): $(ROUTEDOBJS) 771f465d43SSowmini Varadhan $(LINK.c) -o $@ $(ROUTEDOBJS) $(LDLIBS) $(CTFMERGE_HOOK) 787c478bd9Sstevel@tonic-gate $(POST_PROCESS) 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate$(RTQUERYPROG): $(RTQUERYOBJS) 811f465d43SSowmini Varadhan $(LINK.c) -o $@ $(RTQUERYOBJS) $(LDLIBS) -lresolv $(CTFMERGE_HOOK) 827c478bd9Sstevel@tonic-gate $(POST_PROCESS) 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gatelint: 857c478bd9Sstevel@tonic-gate $(LINT.c) $(ROUTEDSRCS) $(LDLIBS) 867c478bd9Sstevel@tonic-gate $(LINT.c) $(RTQUERYSRCS) $(LDLIBS) 877c478bd9Sstevel@tonic-gate 88a192e900Samaguireinstall: all $(ROOTUSRSBINPROG) $(ROOTMANIFEST) $(ROOTSVCMETHOD) 89a192e900Samaguire 90a192e900Samaguirecheck: $(CHKMANIFEST) 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gateclean: 937c478bd9Sstevel@tonic-gate $(RM) $(CLEAN_FILES) 947c478bd9Sstevel@tonic-gate 957c478bd9Sstevel@tonic-gateinclude ../../../Makefile.targ 96