xref: /illumos-gate/usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile (revision b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f)
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 CryptoAlg.o anonymous.o dnssd_ipc.o
36SRCS=		$(OBJS:%.o=%.c)
37
38MDNSFLAGS=	-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.260.1
44
45include	../../../Makefile.cmd
46
47CERRWARN +=	-_gcc=-Wno-unused-variable
48CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
49CERRWARN +=	$(CNOWARN_UNINIT)
50
51# not linted
52SMATCH=off
53
54ROOTMANIFESTDIR=	$(ROOTSVCNETWORKDNS)
55$(ROOTMANIFEST)		:= FILEMODE= 444
56
57.PARALLEL:      $(OBJS)
58.WAIT:          $(PROG)
59.KEEP_STATE:
60
61all:	$(PROG)
62
63$(PROG): $(OBJS)
64	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
65	$(POST_PROCESS)
66
67include ../Makefile.lib
68
69CSTD= $(CSTD_GNU99)
70CPPFLAGS += -D_REENTRANT $(MDNSFLAGS)
71CPPFLAGS += -I$(SRCDIR)/mDNSShared -I$(SRCDIR)/mDNSPosix
72CPPFLAGS += -I$(SRCDIR)/mDNSCore
73LDLIBS += -lsocket -lnsl
74
75install:	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
89check:		$(CHKMANIFEST)
90
91clean:
92	$(RM) $(OBJS)
93
94include ../../../Makefile.targ
95