xref: /illumos-gate/usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile (revision 20a7641f9918de8574b8b3b47dbe35c4bfc78df1)
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
27PROG=		mdnsd
28MANIFEST=	multicast.xml
29
30SRCDIR=		$(SRC)/contrib/mDNSResponder
31
32OBJS=		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 dnssd_ipc.o posix_utilities.o \
36		ClientRequests.o
37SRCS=		$(OBJS:%.o=%.c)
38
39MDNSFLAGS=	-DNOT_HAVE_SA_LEN \
40		-DLOG_PERROR=0 -DHAVE_SOLARIS -DTARGET_OS_SOLARIS \
41		-D_XPG4_2 -D__EXTENSIONS__ -DHAVE_BROKEN_RECVIF_NAME \
42		-DHAVE_IPV6=1 -Dasm=__asm -DMDNSD_NOROOT \
43		-DPID_FILE=\"\" -DMDNSD_USER=\"noaccess\" \
44		-DmDNSResponderVersion=1310.80.1
45
46include	../../../Makefile.cmd
47
48CERRWARN +=	-_gcc=-Wno-unused-variable
49CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
50CERRWARN +=	-_gcc=-Wno-expansion-to-defined
51CERRWARN +=	$(CNOWARN_UNINIT)
52
53# not linted
54SMATCH=off
55
56ROOTMANIFESTDIR=	$(ROOTSVCNETWORKDNS)
57$(ROOTMANIFEST)		:= FILEMODE= 444
58
59.PARALLEL:      $(OBJS)
60.WAIT:          $(PROG)
61.KEEP_STATE:
62
63all:	$(PROG)
64
65$(PROG): $(OBJS)
66	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
67	$(POST_PROCESS)
68
69include ../Makefile.lib
70
71CSTD= $(CSTD_GNU99)
72CPPFLAGS += -D_REENTRANT $(MDNSFLAGS)
73CPPFLAGS += -I$(SRCDIR)/mDNSShared -I$(SRCDIR)/mDNSPosix
74CPPFLAGS += -I$(SRCDIR)/mDNSCore
75LDLIBS += -lsocket -lnsl
76
77install:	all $(ROOTLIBINETPROG) $(ROOTMANIFEST)
78
79%.o:		$(SRCDIR)/mDNSCore/%.c
80		$(COMPILE.c) $(OUTPUT_OPTION) $<
81		$(POST_PROCESS_O)
82
83%.o:		$(SRCDIR)/mDNSShared/%.c
84		$(COMPILE.c) $(OUTPUT_OPTION) $<
85		$(POST_PROCESS_O)
86
87%.o:		$(SRCDIR)/mDNSPosix/%.c
88		$(COMPILE.c) $(OUTPUT_OPTION) $<
89		$(POST_PROCESS_O)
90
91check:		$(CHKMANIFEST)
92
93clean:
94	$(RM) $(OBJS)
95
96include ../../../Makefile.targ
97