1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  22 # Use is subject to license terms.
  23 # Copyright 2016 Toomas Soome <tsoome@me.com>
  24 #
  25 # Copyright (c) 2018, Joyent, Inc.
  26 
  27 PROG=           mdnsd
  28 MANIFEST=       multicast.xml
  29 
  30 SRCDIR=         $(SRC)/contrib/mDNSResponder
  31 
  32 OBJS=           DNSCommon.o DNSDigest.o GenLinkedList.o \
  33                 PlatformCommon.o PosixDaemon.o \
  34                 mDNS.o mDNSDebug.o mDNSPosix.o mDNSUNP.o \
  35                 uDNS.o uds_daemon.o CryptoAlg.o anonymous.o dnssd_ipc.o
  36 SRCS=           $(OBJS:%.o=%.c)
  37 
  38 MDNSFLAGS=      -DNOT_HAVE_SA_LEN \
  39                 -DLOG_PERROR=0 -DHAVE_SOLARIS -DTARGET_OS_SOLARIS \
  40                 -D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME \
  41                 -DHAVE_IPV6=1 -Dasm=__asm -DMDNSD_NOROOT \
  42                 -DPID_FILE=\"\" -DMDNSD_USER=\"noaccess\" \
  43                 -DmDNSResponderVersion=878.1.1
  44 
  45 include ../../../Makefile.cmd
  46 
  47 CERRWARN +=     -_gcc=-Wno-unused-variable
  48 CERRWARN +=     -_gcc=-Wno-implicit-function-declaration
  49 CERRWARN +=     -_gcc=-Wno-uninitialized
  50 
  51 # not linted
  52 SMATCH=off
  53 
  54 ROOTMANIFESTDIR=        $(ROOTSVCNETWORKDNS)
  55 $(ROOTMANIFEST)         := FILEMODE= 444
  56 
  57 .PARALLEL:      $(OBJS)
  58 .WAIT:          $(PROG)
  59 .KEEP_STATE:
  60 
  61 all:    $(PROG)
  62 
  63 $(PROG): $(OBJS)
  64         $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
  65         $(POST_PROCESS)
  66 
  67 include ../Makefile.lib
  68 
  69 CSTD= $(CSTD_GNU99)
  70 CPPFLAGS += -D_REENTRANT $(MDNSFLAGS)
  71 CPPFLAGS += -I$(SRCDIR)/mDNSShared -I$(SRCDIR)/mDNSPosix
  72 CPPFLAGS += -I$(SRCDIR)/mDNSCore
  73 LDLIBS += -lsocket -lnsl
  74 
  75 install:        all $(ROOTLIBINETPROG) $(ROOTMANIFEST)
  76 
  77 %.o:            $(SRCDIR)/mDNSCore/%.c
  78                 $(COMPILE.c) $(OUTPUT_OPTION) $<
  79                 $(POST_PROCESS_O)
  80 
  81 %.o:            $(SRCDIR)/mDNSShared/%.c
  82                 $(COMPILE.c) $(OUTPUT_OPTION) $<
  83                 $(POST_PROCESS_O)
  84 
  85 %.o:            $(SRCDIR)/mDNSPosix/%.c
  86                 $(COMPILE.c) $(OUTPUT_OPTION) $<
  87                 $(POST_PROCESS_O)
  88 
  89 check:          $(CHKMANIFEST)
  90 
  91 clean:
  92         $(RM) $(OBJS)
  93 
  94 include ../../../Makefile.targ