diff --git a/net/Makefile b/net/Makefile index 7c92bb21a6e..bf88c3ea447 100644 --- a/net/Makefile +++ b/net/Makefile @@ -44,6 +44,9 @@ SOCK_CSRCS = bind.c connect.c getsockname.c recv.c recvfrom.c socket.c SOCK_CSRCS += sendto.c net_sockets.c net_close.c net_dup.c net_dup2.c SOCK_CSRCS += net_clone.c net_vfcntl.c +VPATH = +DEPPATH = --dep-path . + # TCP/IP support ifeq ($(CONFIG_NET_TCP),y) @@ -99,13 +102,14 @@ ifeq ($(CONFIG_NET_RXAVAIL),y) NETDEV_CSRCS += netdev_rxnotify.c endif +include arp/Make.defs include uip/Make.defs endif -ASRCS = $(SOCK_ASRCS) $(NETDEV_ASRCS) $(UIP_ASRCS) +ASRCS = $(SOCK_ASRCS) $(NETDEV_ASRCS) $(ARP_ASRCS) $(UIP_ASRCS) AOBJS = $(ASRCS:.S=$(OBJEXT)) -CSRCS = $(SOCK_CSRCS) $(NETDEV_CSRCS) $(UIP_CSRCS) +CSRCS = $(SOCK_CSRCS) $(NETDEV_CSRCS) $(ARP_CSRCS) $(UIP_CSRCS) COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) @@ -113,8 +117,6 @@ OBJS = $(AOBJS) $(COBJS) BIN = libnet$(LIBEXT) -VPATH = uip - all: $(BIN) $(AOBJS): %$(OBJEXT): %.S @@ -128,7 +130,7 @@ $(BIN): $(OBJS) .depend: Makefile $(SRCS) ifeq ($(CONFIG_NET),y) - $(Q) $(MKDEP) --dep-path . --dep-path uip "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep endif $(Q) touch $@ diff --git a/net/uip/uip_arp.c b/net/arp/uip_arp.c similarity index 99% rename from net/uip/uip_arp.c rename to net/arp/uip_arp.c index 068552084c9..a58a1560a74 100644 --- a/net/uip/uip_arp.c +++ b/net/arp/uip_arp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/uip/uip_arp.c + * net/arp/uip_arp.c * Implementation of the ARP Address Resolution Protocol. * * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. diff --git a/net/uip/uip_arptab.c b/net/arp/uip_arptab.c similarity index 99% rename from net/uip/uip_arptab.c rename to net/arp/uip_arptab.c index af68a3bd81b..96a0f19b5c3 100644 --- a/net/uip/uip_arptab.c +++ b/net/arp/uip_arptab.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/uip/uip_arptab.c + * net/arp/uip_arptab.c * Implementation of the ARP Address Resolution Protocol. * * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. diff --git a/net/uip/Make.defs b/net/uip/Make.defs index 8c81a11c40c..382fb2e5d0f 100644 --- a/net/uip/Make.defs +++ b/net/uip/Make.defs @@ -49,12 +49,6 @@ ifeq ($(CONFIG_NET_NOINTS),y) UIP_CSRCS += uip_lock.c endif -# ARP supported is not provided for SLIP (Ethernet only) - -ifneq ($(CONFIG_NET_SLIP),y) -UIP_CSRCS += uip_arp.c uip_arptab.c -endif - # IPv6-specific logic ifeq ($(CONFIG_NET_IPv6),y) @@ -111,4 +105,11 @@ UIP_CSRCS += uip_mcastmac.c endif endif + +# Include uip build support + +DEPPATH += --dep-path uip +VPATH += :uip +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)net$(DELIM)uip} + endif