Robert Greenwalt | dd52342 | 2012-03-29 14:43:07 -0700 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | |
Elliott Hughes | 8e64db4 | 2014-12-12 15:00:46 -0800 | [diff] [blame] | 3 | commonSources := \ |
| 4 | mDNSShared/dnssd_clientlib.c \ |
| 5 | mDNSShared/dnssd_clientstub.c \ |
| 6 | mDNSShared/dnssd_ipc.c |
| 7 | |
| 8 | commonLibs := libcutils liblog |
| 9 | |
| 10 | commonFlags := \ |
| 11 | -O2 -g \ |
| 12 | -fno-strict-aliasing \ |
| 13 | -D_GNU_SOURCE \ |
| 14 | -DHAVE_IPV6 \ |
| 15 | -DHAVE_LINUX \ |
| 16 | -DNOT_HAVE_SA_LEN \ |
| 17 | -DPLATFORM_NO_RLIMIT \ |
| 18 | -DTARGET_OS_LINUX \ |
| 19 | -DUSES_NETLINK \ |
| 20 | -DMDNS_DEBUGMSGS=0 \ |
| 21 | -DMDNS_UDS_SERVERPATH=\"/dev/socket/mdnsd\" \ |
| 22 | -DMDNS_USERNAME=\"mdnsr\" \ |
| 23 | -W \ |
| 24 | -Wall \ |
| 25 | -Wextra \ |
| 26 | -Wno-array-bounds \ |
| 27 | -Wno-pointer-sign \ |
| 28 | -Wno-unused \ |
| 29 | -Wno-unused-but-set-variable \ |
| 30 | -Wno-unused-parameter \ |
Elliott Hughes | 8e64db4 | 2014-12-12 15:00:46 -0800 | [diff] [blame] | 31 | -Werror=implicit-function-declaration \ |
| 32 | |
Robert Greenwalt | dd52342 | 2012-03-29 14:43:07 -0700 | [diff] [blame] | 33 | ######################### |
| 34 | |
| 35 | include $(CLEAR_VARS) |
| 36 | LOCAL_SRC_FILES := mDNSPosix/PosixDaemon.c \ |
| 37 | mDNSPosix/mDNSPosix.c \ |
| 38 | mDNSPosix/mDNSUNP.c \ |
| 39 | mDNSCore/mDNS.c \ |
| 40 | mDNSCore/DNSDigest.c \ |
| 41 | mDNSCore/uDNS.c \ |
| 42 | mDNSCore/DNSCommon.c \ |
| 43 | mDNSShared/uds_daemon.c \ |
| 44 | mDNSShared/mDNSDebug.c \ |
| 45 | mDNSShared/dnssd_ipc.c \ |
| 46 | mDNSShared/GenLinkedList.c \ |
| 47 | mDNSShared/PlatformCommon.c |
| 48 | |
| 49 | LOCAL_MODULE := mdnsd |
| 50 | LOCAL_MODULE_TAGS := optional |
| 51 | |
| 52 | LOCAL_C_INCLUDES := external/mdnsresponder/mDNSPosix \ |
| 53 | external/mdnsresponder/mDNSCore \ |
| 54 | external/mdnsresponder/mDNSShared |
| 55 | |
Dan Willemsen | 11b8cee | 2015-10-22 13:49:32 -0700 | [diff] [blame] | 56 | LOCAL_CFLAGS := $(commonFlags) -DMDNS_VERSIONSTR_NODTS=1 |
Joshua Melcon | 0b6b4e3 | 2014-11-10 09:50:45 -0800 | [diff] [blame] | 57 | |
Elliott Hughes | 8e64db4 | 2014-12-12 15:00:46 -0800 | [diff] [blame] | 58 | LOCAL_STATIC_LIBRARIES := $(commonLibs) libc |
Alex Ray | 42215f9 | 2014-03-24 20:01:56 -0700 | [diff] [blame] | 59 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
Robert Greenwalt | dd52342 | 2012-03-29 14:43:07 -0700 | [diff] [blame] | 60 | include $(BUILD_EXECUTABLE) |
| 61 | |
| 62 | ########################## |
| 63 | |
Alex Ray | b3d17cb | 2014-03-19 14:22:37 -0700 | [diff] [blame] | 64 | include $(CLEAR_VARS) |
| 65 | LOCAL_SRC_FILES := $(commonSources) |
Robert Greenwalt | dd52342 | 2012-03-29 14:43:07 -0700 | [diff] [blame] | 66 | LOCAL_MODULE := libmdnssd |
| 67 | LOCAL_MODULE_TAGS := optional |
Alex Ray | b3d17cb | 2014-03-19 14:22:37 -0700 | [diff] [blame] | 68 | LOCAL_CFLAGS := $(commonFlags) |
Ying Wang | c46f53f | 2013-04-09 21:50:17 -0700 | [diff] [blame] | 69 | LOCAL_SYSTEM_SHARED_LIBRARIES := libc |
Alex Ray | b3d17cb | 2014-03-19 14:22:37 -0700 | [diff] [blame] | 70 | LOCAL_SHARED_LIBRARIES := $(commonLibs) |
Elliott Hughes | 8e64db4 | 2014-12-12 15:00:46 -0800 | [diff] [blame] | 71 | LOCAL_EXPORT_C_INCLUDE_DIRS := external/mdnsresponder/mDNSShared |
Robert Greenwalt | dd52342 | 2012-03-29 14:43:07 -0700 | [diff] [blame] | 72 | include $(BUILD_SHARED_LIBRARY) |
| 73 | |
Alex Ray | b3d17cb | 2014-03-19 14:22:37 -0700 | [diff] [blame] | 74 | include $(CLEAR_VARS) |
| 75 | LOCAL_SRC_FILES := $(commonSources) |
| 76 | LOCAL_MODULE := libmdnssd |
| 77 | LOCAL_MODULE_TAGS := optional |
| 78 | LOCAL_CFLAGS := $(commonFlags) |
| 79 | LOCAL_STATIC_LIBRARIES := $(commonLibs) |
Elliott Hughes | 8e64db4 | 2014-12-12 15:00:46 -0800 | [diff] [blame] | 80 | LOCAL_EXPORT_C_INCLUDE_DIRS := external/mdnsresponder/mDNSShared |
Alex Ray | b3d17cb | 2014-03-19 14:22:37 -0700 | [diff] [blame] | 81 | include $(BUILD_STATIC_LIBRARY) |
| 82 | |
Robert Greenwalt | dd52342 | 2012-03-29 14:43:07 -0700 | [diff] [blame] | 83 | ############################ |
| 84 | |
| 85 | include $(CLEAR_VARS) |
Elliott Hughes | 8e64db4 | 2014-12-12 15:00:46 -0800 | [diff] [blame] | 86 | LOCAL_SRC_FILES := Clients/dns-sd.c Clients/ClientCommon.c |
Robert Greenwalt | dd52342 | 2012-03-29 14:43:07 -0700 | [diff] [blame] | 87 | LOCAL_MODULE := dnssd |
| 88 | LOCAL_MODULE_TAGS := optional |
Elliott Hughes | 8e64db4 | 2014-12-12 15:00:46 -0800 | [diff] [blame] | 89 | LOCAL_CFLAGS := $(commonFlags) |
Ying Wang | c46f53f | 2013-04-09 21:50:17 -0700 | [diff] [blame] | 90 | LOCAL_SYSTEM_SHARED_LIBRARIES := libc |
| 91 | LOCAL_SHARED_LIBRARIES := libmdnssd libcutils liblog |
Robert Greenwalt | dd52342 | 2012-03-29 14:43:07 -0700 | [diff] [blame] | 92 | include $(BUILD_EXECUTABLE) |
Joshua Melcon | 0b6b4e3 | 2014-11-10 09:50:45 -0800 | [diff] [blame] | 93 | |
Joshua Melcon | 0b6b4e3 | 2014-11-10 09:50:45 -0800 | [diff] [blame] | 94 | ############################ |
Dan Rodney | af2bd08 | 2015-01-19 14:32:19 -0600 | [diff] [blame] | 95 | # This builds an mDns that is embeddable within GmsCore for the nearby connections API |
Joshua Melcon | 0b6b4e3 | 2014-11-10 09:50:45 -0800 | [diff] [blame] | 96 | |
| 97 | ### STATIC LIB ### |
| 98 | include $(CLEAR_VARS) |
| 99 | |
| 100 | LOCAL_SDK_VERSION := 8 |
| 101 | LOCAL_MODULE := libmdns_jni_static |
| 102 | LOCAL_SRC_FILES := /mDNSCore/mDNS.c \ |
| 103 | /mDNSCore/DNSDigest.c \ |
| 104 | /mDNSCore/uDNS.c \ |
| 105 | /mDNSCore/DNSCommon.c \ |
| 106 | /mDNSPosix/mDNSPosix.c \ |
| 107 | /mDNSPosix/mDNSUNP.c \ |
| 108 | /mDNSShared/mDNSDebug.c \ |
| 109 | /mDNSShared/dnssd_clientlib.c \ |
| 110 | /mDNSShared/dnssd_clientshim.c \ |
| 111 | /mDNSShared/dnssd_ipc.c \ |
| 112 | /mDNSShared/GenLinkedList.c \ |
| 113 | /mDNSShared/PlatformCommon.c |
| 114 | |
| 115 | LOCAL_C_INCLUDES := external/mdnsresponder/mDNSPosix \ |
| 116 | external/mdnsresponder/mDNSCore \ |
| 117 | external/mdnsresponder/mDNSShared |
| 118 | |
| 119 | LOCAL_CFLAGS += -Os -fvisibility=hidden |
Elliott Hughes | 8e64db4 | 2014-12-12 15:00:46 -0800 | [diff] [blame] | 120 | LOCAL_CFLAGS += $(commonFlags) \ |
| 121 | -UMDNS_DEBUGMSGS \ |
Dan Rodney | af2bd08 | 2015-01-19 14:32:19 -0600 | [diff] [blame] | 122 | -DMDNS_DEBUGMSGS=0 \ |
Joshua Melcon | 0b6b4e3 | 2014-11-10 09:50:45 -0800 | [diff] [blame] | 123 | -DSO_REUSEADDR \ |
| 124 | -DUNICAST_DISABLED |
| 125 | |
Joshua Melcon | 0b6b4e3 | 2014-11-10 09:50:45 -0800 | [diff] [blame] | 126 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 127 | LOCAL_CFLAGS += -O0 -UNDEBUG -fno-omit-frame-pointer |
| 128 | endif |
| 129 | |
| 130 | include $(BUILD_STATIC_LIBRARY) |