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
26PROG=		mdnsd
27MANIFEST=	multicast.xml
28
29SRCDIR=		$(SRC)/contrib/mDNSResponder
30
31OBJS=		DNSCommon.o DNSDigest.o GenLinkedList.o \
32		PlatformCommon.o PosixDaemon.o \
33		mDNS.o mDNSDebug.o mDNSPosix.o mDNSUNP.o \
34		uDNS.o uds_daemon.o CryptoAlg.o anonymous.o dnssd_ipc.o
35SRCS=		$(OBJS:%.o=%.c)
36
37MDNSFLAGS=	-DNOT_HAVE_SA_LEN \
38		-DLOG_PERROR=0 -DHAVE_SOLARIS -DTARGET_OS_SOLARIS \
39		-D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME \
40		-DHAVE_IPV6=1 -Dasm=__asm -DMDNSD_NOROOT \
41		-DPID_FILE=\"\" -DMDNSD_USER=\"noaccess\" \
42		-DMDNS_VERSIONSTR_NODTS
43
44include	../../../Makefile.cmd
45
46ROOTMANIFESTDIR=	$(ROOTSVCNETWORKDNS)
47$(ROOTMANIFEST)		:= FILEMODE= 444
48
49.PARALLEL:      $(OBJS)
50.WAIT:          $(PROG)
51.KEEP_STATE:
52
53all:	$(PROG)
54
55$(PROG): $(OBJS)
56	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
57	$(POST_PROCESS)
58
59include ../Makefile.lib
60
61CSTD = $(CSTD_GNU99)
62CPPFLAGS += -D_REENTRANT $(MDNSFLAGS)
63CPPFLAGS += -I$(SRCDIR)/mDNSShared -I$(SRCDIR)/mDNSPosix
64CPPFLAGS += -I$(SRCDIR)/mDNSCore
65LDLIBS += -lsocket -lnsl
66
67install:	all $(ROOTLIBINETPROG) $(ROOTMANIFEST)
68
69%.o:		$(SRCDIR)/mDNSCore/%.c
70		$(COMPILE.c) $(OUTPUT_OPTION) $<
71		$(POST_PROCESS_O)
72
73%.o:		$(SRCDIR)/mDNSShared/%.c
74		$(COMPILE.c) $(OUTPUT_OPTION) $<
75		$(POST_PROCESS_O)
76
77%.o:		$(SRCDIR)/mDNSPosix/%.c
78		$(COMPILE.c) $(OUTPUT_OPTION) $<
79		$(POST_PROCESS_O)
80
81check:		$(CHKMANIFEST)
82
83clean:
84	$(RM) $(OBJS)
85
86include ../../../Makefile.targ
87