2011-03-19 22:04:13 +01:00
|
|
|
############################################################################
|
2014-07-03 00:04:25 +02:00
|
|
|
# apps/netutils/netlib/Makefile
|
2011-03-19 22:04:13 +01:00
|
|
|
#
|
2015-01-18 21:17:00 +01:00
|
|
|
# Copyright (C) 2011-2012, 2014-2015 Gregory Nutt. All rights reserved.
|
2012-09-13 18:58:49 +02:00
|
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
2011-03-19 22:04:13 +01:00
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
-include $(TOPDIR)/.config
|
|
|
|
-include $(TOPDIR)/Make.defs
|
|
|
|
include $(APPDIR)/Make.defs
|
|
|
|
|
2017-04-07 00:00:41 +02:00
|
|
|
# Network Library
|
2011-03-19 22:04:13 +01:00
|
|
|
|
2014-07-03 00:16:51 +02:00
|
|
|
ASRCS =
|
2016-02-08 23:09:24 +01:00
|
|
|
CSRCS = netlib_ipv4addrconv.c netlib_ethaddrconv.c netlib_parsehttpurl.c
|
2014-07-03 00:52:02 +02:00
|
|
|
CSRCS += netlib_setifstatus.c netlib_getifstatus.c
|
2012-09-17 20:18:44 +02:00
|
|
|
|
2015-01-18 21:17:00 +01:00
|
|
|
# IP address support
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_NET_IPv4),y)
|
|
|
|
CSRCS += netlib_setipv4addr.c netlib_getipv4addr.c
|
|
|
|
CSRCS += netlib_setdripv4addr.c netlib_setipv4netmask.c
|
2016-01-14 14:24:36 +01:00
|
|
|
CSRCS += netlib_getdripv4addr.c netlib_getipv4netmask.c
|
2016-02-08 18:44:59 +01:00
|
|
|
ifeq ($(CONFIG_NET_ARP),y)
|
|
|
|
CSRCS += netlib_getarp.c netlib_setarp.c netlib_delarp.c
|
|
|
|
endif
|
2015-07-12 19:53:23 +02:00
|
|
|
ifeq ($(CONFIG_NETDB_DNSCLIENT),y)
|
2016-01-13 22:08:59 +01:00
|
|
|
CSRCS += netlib_setipv4dnsaddr.c
|
2015-07-12 19:53:23 +02:00
|
|
|
endif
|
2015-01-18 21:17:00 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_NET_IPv6),y)
|
|
|
|
CSRCS += netlib_setipv6addr.c netlib_getipv6addr.c
|
|
|
|
CSRCS += netlib_setdripv6addr.c netlib_setipv6netmask.c
|
2015-02-06 17:23:15 +01:00
|
|
|
CSRCS += netlib_prefix2ipv6netmask.c netlib_ipv6netmask2prefix.c
|
2015-02-03 15:01:55 +01:00
|
|
|
ifeq ($(CONFIG_NET_ICMPv6_AUTOCONF),y)
|
|
|
|
CSRCS += netlib_autoconfig.c
|
|
|
|
endif
|
2015-01-18 21:17:00 +01:00
|
|
|
endif
|
|
|
|
|
2012-09-17 20:18:44 +02:00
|
|
|
# These require TCP support
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_NET_TCP),y)
|
2015-01-19 18:41:46 +01:00
|
|
|
ifeq ($(CONFIG_NET_IPv4),y) # Not yet available for IPv6
|
2014-07-03 00:16:51 +02:00
|
|
|
CSRCS += netlib_server.c netlib_listenon.c
|
2012-09-17 20:18:44 +02:00
|
|
|
endif
|
2015-01-19 18:41:46 +01:00
|
|
|
endif
|
2011-03-19 22:04:13 +01:00
|
|
|
|
2017-03-13 17:16:20 +01:00
|
|
|
# These require wireless IOCTL support */
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_NETDEV_WIRELESS_IOCTL),y)
|
2017-03-13 21:16:26 +01:00
|
|
|
CSRCS += netlib_getessid.c netlib_setessid.c
|
2017-03-13 17:16:20 +01:00
|
|
|
endif
|
|
|
|
|
2017-04-07 00:00:41 +02:00
|
|
|
# MAC address support(Ethernet and 6loWPAN only)
|
2011-03-19 22:04:13 +01:00
|
|
|
|
2014-11-15 20:52:39 +01:00
|
|
|
ifeq ($(CONFIG_NET_ETHERNET),y)
|
2014-07-03 00:16:51 +02:00
|
|
|
CSRCS += netlib_setmacaddr.c netlib_getmacaddr.c
|
2011-03-19 22:04:13 +01:00
|
|
|
endif
|
|
|
|
|
2017-04-07 00:00:41 +02:00
|
|
|
ifeq ($(CONFIG_NET_6LOWPAN),y)
|
2017-06-17 18:04:18 +02:00
|
|
|
CSRCS += netlib_seteaddr.c netlib_getpanid.c netlib_eaddrconv.c
|
2017-04-07 00:00:41 +02:00
|
|
|
endif
|
|
|
|
|
2011-03-19 22:04:13 +01:00
|
|
|
# IGMP support
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_NET_IGMP),y)
|
2015-01-19 18:41:46 +01:00
|
|
|
ifeq ($(CONFIG_NET_IPv4),y) # Not yet available for IPv6
|
2014-07-03 00:16:51 +02:00
|
|
|
CSRCS += netlib_ipmsfilter.c
|
2011-03-19 22:04:13 +01:00
|
|
|
endif
|
2015-01-19 18:41:46 +01:00
|
|
|
endif
|
2011-03-19 22:04:13 +01:00
|
|
|
|
2014-07-03 00:16:51 +02:00
|
|
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
|
|
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
2011-03-19 22:04:13 +01:00
|
|
|
|
2014-07-03 00:16:51 +02:00
|
|
|
SRCS = $(ASRCS) $(CSRCS)
|
|
|
|
OBJS = $(AOBJS) $(COBJS)
|
2011-03-19 22:04:13 +01:00
|
|
|
|
2012-11-12 16:22:27 +01:00
|
|
|
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
|
2014-07-03 00:16:51 +02:00
|
|
|
BIN = ..\..\libapps$(LIBEXT)
|
2012-11-12 16:22:27 +01:00
|
|
|
else
|
2011-04-10 18:08:08 +02:00
|
|
|
ifeq ($(WINTOOL),y)
|
2014-07-03 00:16:51 +02:00
|
|
|
BIN = ..\\..\\libapps$(LIBEXT)
|
2011-04-10 18:08:08 +02:00
|
|
|
else
|
2014-07-03 00:16:51 +02:00
|
|
|
BIN = ../../libapps$(LIBEXT)
|
2012-11-12 16:22:27 +01:00
|
|
|
endif
|
2011-04-10 18:08:08 +02:00
|
|
|
endif
|
2011-03-19 22:04:13 +01:00
|
|
|
|
2014-07-03 00:16:51 +02:00
|
|
|
ROOTDEPPATH = --dep-path .
|
2011-03-19 22:04:13 +01:00
|
|
|
|
|
|
|
# Common build
|
|
|
|
|
2014-07-03 00:16:51 +02:00
|
|
|
VPATH =
|
2011-03-19 22:04:13 +01:00
|
|
|
|
|
|
|
all: .built
|
2011-04-01 17:18:02 +02:00
|
|
|
.PHONY: context depend clean distclean
|
2011-03-19 22:04:13 +01:00
|
|
|
|
|
|
|
$(AOBJS): %$(OBJEXT): %.S
|
|
|
|
$(call ASSEMBLE, $<, $@)
|
|
|
|
|
|
|
|
$(COBJS): %$(OBJEXT): %.c
|
|
|
|
$(call COMPILE, $<, $@)
|
|
|
|
|
2011-04-01 17:18:02 +02:00
|
|
|
.built: $(OBJS)
|
2012-11-15 18:43:29 +01:00
|
|
|
$(call ARCHIVE, $(BIN), $(OBJS))
|
2012-11-17 19:54:53 +01:00
|
|
|
$(Q) touch .built
|
2011-03-19 22:04:13 +01:00
|
|
|
|
2014-09-06 16:00:47 +02:00
|
|
|
install:
|
|
|
|
|
2011-03-24 03:26:25 +01:00
|
|
|
context:
|
|
|
|
|
2011-03-19 22:04:13 +01:00
|
|
|
.depend: Makefile $(SRCS)
|
2012-11-17 19:54:53 +01:00
|
|
|
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
|
|
|
|
$(Q) touch $@
|
2011-03-19 22:04:13 +01:00
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
clean:
|
2012-11-20 16:47:41 +01:00
|
|
|
$(call DELFILE, .built)
|
2011-03-19 22:04:13 +01:00
|
|
|
$(call CLEAN)
|
|
|
|
|
|
|
|
distclean: clean
|
2012-11-20 16:47:41 +01:00
|
|
|
$(call DELFILE, Make.dep)
|
|
|
|
$(call DELFILE, .depend)
|
2011-03-19 22:04:13 +01:00
|
|
|
|
|
|
|
-include Make.dep
|
2016-06-02 16:24:30 +02:00
|
|
|
.PHONY: preconfig
|
|
|
|
preconfig:
|