1
+ # ###########################################################################
2
+ # netutils/mdns/Makefile
3
+ #
4
+ # SPDX-License-Identifier: Apache-2.0
5
+ #
6
+ # Licensed to the Apache Software Foundation (ASF) under one or more
7
+ # contributor license agreements. See the NOTICE file distributed with
8
+ # this work for additional information regarding copyright ownership. The
9
+ # ASF licenses this file to you under the Apache License, Version 2.0 (the
10
+ # "License"); you may not use this file except in compliance with the
11
+ # License. You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18
+ # License for the specific language governing permissions and limitations
19
+ # under the License.
20
+ #
21
+ # ###########################################################################
22
+
23
+ include $(APPDIR ) /Make.defs
24
+
25
+ # mDNS application
26
+
27
+ # ###########################################################################
28
+ # Flags
29
+ # ###########################################################################
30
+
31
+ MDNS_URL ?= "https://github.com/mjansson/mdns/archive"
32
+
33
+ MDNS_VERSION = main
34
+ MDNS_ZIP = $(MDNS_VERSION ) .zip
35
+
36
+ MDNS_UNPACKNAME = mdns
37
+ UNPACK ?= unzip -q -o
38
+
39
+ VPATH += $(MDNS_UNPACKNAME )
40
+ VPATH += $(MDNS_UNPACKNAME )$(DELIM ) posix
41
+ DEPPATH += --dep-path $(MDNS_UNPACKNAME )
42
+ DEPPATH += --dep-path $(MDNS_UNPACKNAME )$(DELIM ) posix
43
+
44
+ CFLAGS += -Wno-strict-prototypes -Wno-undef -Wno-format
45
+
46
+ APPS_INCDIR = $(APPDIR )$(DELIM ) include$(DELIM ) netutils
47
+
48
+ # ###########################################################################
49
+ # Targets
50
+ # ###########################################################################
51
+
52
+ $(MDNS_ZIP ) :
53
+ @echo " Downloading: $( MDNS_URL) /$( MDNS_ZIP) "
54
+ $(Q ) curl -O -L $(MDNS_URL ) /$(MDNS_ZIP )
55
+
56
+ $(MDNS_UNPACKNAME ) : $(MDNS_ZIP )
57
+ @echo " Unpacking: $( MDNS_ZIP) -> $( MDNS_UNPACKNAME) "
58
+ $(Q ) $(UNPACK ) $(MDNS_ZIP )
59
+ $(Q ) mv mdns-$(MDNS_VERSION ) $(MDNS_UNPACKNAME )
60
+ $(Q ) cp $(MDNS_UNPACKNAME )$(DELIM ) mdns.h $(APPS_INCDIR )
61
+ $(Q ) patch -p0 < verbose_option.patch # Update to enable non-verbose mode
62
+ $(Q ) touch $(MDNS_UNPACKNAME )
63
+
64
+ clean ::
65
+ $(call DELFILE, $(OBJS ) )
66
+
67
+ # Download and unpack tarball if no git repo found
68
+
69
+ ifeq ($(wildcard $(MDNS_UNPACKNAME ) /.git) ,)
70
+ context :: $(MDNS_UNPACKNAME )
71
+
72
+ distclean ::
73
+ $(call DELFILE, $(OBJS ) )
74
+ $(call DELDIR, $(MDNS_UNPACKNAME ) )
75
+ $(call DELFILE, $(APPS_INCDIR )$(DELIM ) mdns.h)
76
+ $(call DELFILE, $(MDNS_ZIP ) )
77
+ endif
78
+
79
+ # ###########################################################################
80
+ # Applications Configuration
81
+ # ###########################################################################
82
+
83
+ include $(APPDIR ) /Make.defs
84
+
85
+ ifneq ($(CONFIG_NETUTILS_MDNS ) ,)
86
+ PROGNAME = $(CONFIG_NETUTILS_MDNS_PROGNAME )
87
+ PRIORITY = $(CONFIG_NETUTILS_MDNS_PRIORITY )
88
+ STACKSIZE = $(CONFIG_NETUTILS_MDNS_STACKSIZE )
89
+ MODULE = $(CONFIG_NETUTILS_MDNS )
90
+
91
+ MAINSRC = mdns/mdns.c
92
+ else
93
+ CSRCS += mdns/mdns.c
94
+ endif
95
+
96
+ ifneq ($(CONFIG_NETUTILS_MDNS_DAEMON ) ,)
97
+ CSRCS += mdnsd.c
98
+ endif
99
+
100
+ # This is an external library so we accept NuttX style violations
101
+
102
+ CFLAGS += -Wno-undef -Wno-strict-prototypes -Wno-unused-variable \
103
+ -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-shadow \
104
+ -Wno-format
105
+
106
+ include $(APPDIR ) /Application.mk
0 commit comments