<commit_before>UIP_MODULES = net/ip/contiki/ip \
              net/ip/contiki/ipv6 \
              net/ip/contiki/mac \
              net/ip/contiki/mac/sicslowmac \
              net/ip/contiki/llsec \
              net/ip/contiki/os/dev \
              net/ip/contiki/os/sys \
              net/ip/contiki/os/lib

EXTRA_CFLAGS += ${PROJECTINCLUDE}
EXTRA_CFLAGS += -I${srctree}/net/ip/contiki
EXTRA_CFLAGS += -I${srctree}/net/ip/contiki/os/lib
EXTRA_CFLAGS += -I${srctree}/net/ip/contiki/os
EXTRA_CFLAGS += -I${srctree}/net/ip
EXTRA_CFLAGS += -I${srctree}/include/drivers
EXTRA_CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1

ifeq ($(CONFIG_NETWORKING_WITH_RPL),y)
	EXTRA_CFLAGS += -DUIP_CONF_IPV6_RPL=1
	UIP_MODULES += ${srctree}/net/ip/contiki/rpl
else
	EXTRA_CFLAGS += -DUIP_CONF_IPV6_RPL=0
endif

MODULES_SOURCES = ${foreach d, $(UIP_MODULES), ${wildcard $(ZEPHYR_BASE)/$(d)/*.c}}
MODULES_FILES = ${foreach f, $(MODULES_SOURCES), ${subst $(ZEPHYR_BASE)/net/ip/,,${f}}}
obj-y = ${foreach f, $(MODULES_FILES), ${subst .c,.o,${f}}}

obj-y += net_init.o \
	 net_buf.o \
	 net_context.o \
	 contiki/netstack.o \
	 contiki/packetbuf.o \
	 contiki/nbr-table.o \
	 contiki/linkaddr.o \
	 contiki/queuebuf.o

ifeq ($(CONFIG_NETWORKING_WITH_6LOWPAN),y)
     EXTRA_CFLAGS += -DSICSLOWPAN_CONF_ENABLE
     obj-y += contiki/sicslowpan/sicslowpan_compression.o
     obj-y += contiki/sicslowpan/sicslowpan_fragmentation.o
else
     obj-y += contiki/sicslowpan/null_compression.o
     obj-y += contiki/sicslowpan/null_fragmentation.o
endif

ifeq ($(CONFIG_NETWORKING_WITH_LOGGING),y)
     EXTRA_CFLAGS += -DUIP_CONF_LOGGING=1
     obj-y += contiki/uip-log.o
endif

obj-$(CONFIG_NETWORKING_WITH_15_4) += net_driver_15_4.o
obj-$(CONFIG_NETWORKING_WITH_15_4_LOOPBACK) += dummy_15_4_radio.o
obj-$(CONFIG_NETWORKING_WITH_LOOPBACK) += net_driver_loopback.o

ifneq ($(CONFIG_NETWORKING_WITH_15_4),y)
     # remove files that are not needed
     obj-y := $(filter-out contiki/mac/frame802154.o \
		contiki/mac/framer-802154.o \
		contiki/mac/csma.o \
		contiki/mac/mac-sequence.o \
		contiki/mac/sicslowmac/sicslowmac.o,$(obj-y))
else
     obj-y := $(filter-out contiki/mac/nullmac.o \
		contiki/mac/framer-nullmac.o ,$(obj-y))
endif

ifneq ($(CONFIG_NETWORKING_UART),y)
     obj-y := $(filter-out contiki/os/dev/slip.o \
		contiki/os/dev/slip-arch.o,$(obj-y))
endif

# At the moment we only need nullsec driver
obj-y := $(filter-out contiki/llsec/ccm-star.o \
		contiki/llsec/ccm-star.o \
		contiki/llsec/anti-replay.o,$(obj-y))

# workaround for include file location
CREATE_INCLUDE_LINK_net := $(shell ln -s ${ZEPHYR_BASE}/net/ip/contiki ${ZEPHYR_BASE}/net/ip/contiki/net > /dev/null 2>&1)
<commit_msg>net: ip: Makefile re-structuring<commit_after>EXTRA_CFLAGS += ${PROJECTINCLUDE}
EXTRA_CFLAGS += -I${srctree}/net/ip/contiki
EXTRA_CFLAGS += -I${srctree}/net/ip/contiki/os/lib
EXTRA_CFLAGS += -I${srctree}/net/ip/contiki/os
EXTRA_CFLAGS += -I${srctree}/net/ip
EXTRA_CFLAGS += -I${srctree}/include/drivers
EXTRA_CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1

# Zypher specific files
obj-y = net_init.o \
	 net_buf.o \
	 net_context.o

# Contiki IP stack files
obj-y += contiki/netstack.o \
	contiki/packetbuf.o \
	contiki/nbr-table.o \
	contiki/linkaddr.o \
	contiki/queuebuf.o \
	contiki/ip/uip-debug.o \
	contiki/ip/uip-packetqueue.o \
	contiki/ip/uip-udp-packet.o \
	contiki/ip/udp-socket.o \
	contiki/ip/simple-udp.o \
	contiki/ip/uiplib.o \
	contiki/ip/uip-nameserver.o \
	contiki/ip/tcpip.o \
	contiki/ipv6/uip6.o \
	contiki/ipv6/uip-icmp6.o \
	contiki/ipv6/uip-ds6.o \
	contiki/ipv6/uip-nd6.o \
	contiki/ipv6/uip-ds6-route.o \
	contiki/ipv6/uip-ds6-nbr.o \
	contiki/os/sys/process.o \
	contiki/os/sys/stimer.o \
	contiki/os/sys/etimer.o \
	contiki/os/sys/timer.o \
	contiki/os/sys/arg.o \
	contiki/os/sys/ctimer.o \
	contiki/os/sys/rtimer.o \
	contiki/os/sys/clock.o \
	contiki/os/dev/nullradio.o \
	contiki/os/lib/mmem.o \
	contiki/os/lib/memb.o \
	contiki/os/lib/list.o \
	contiki/os/lib/random.o \
	contiki/os/lib/aes-128.o \
	contiki/mac/mac.o \
	contiki/mac/framer.o \
	contiki/mac/mac-sequence.o \
	contiki/llsec/nullsec.o

# RPL (RFC 6550) support
ifeq ($(CONFIG_NETWORKING_WITH_RPL),y)
	EXTRA_CFLAGS += -DUIP_CONF_IPV6_RPL=1
	obj-y += contiki/rpl/rpl-of0.o \
		contiki/rpl/rpl-mrhof.o \
		contiki/rpl/rpl-dag.o \
		contiki/rpl/rpl-timers.o \
		contiki/rpl/rpl.o \
		contiki/rpl/rpl-ext-header.o \
		contiki/rpl/rpl-icmp6.o \
		contiki/ipv6/multicast/uip-mcast6-route.o \
		contiki/ipv6/multicast/smrf.o \
		contiki/ipv6/multicast/uip-mcast6-stats.o
else
	EXTRA_CFLAGS += -DUIP_CONF_IPV6_RPL=0
endif

# 6LoWPAN support
ifeq ($(CONFIG_NETWORKING_WITH_6LOWPAN),y)
     EXTRA_CFLAGS += -DSICSLOWPAN_CONF_ENABLE
     obj-y += contiki/sicslowpan/sicslowpan_compression.o
     obj-y += contiki/sicslowpan/sicslowpan_fragmentation.o
else
     obj-y += contiki/sicslowpan/null_compression.o
     obj-y += contiki/sicslowpan/null_fragmentation.o
endif

ifeq ($(CONFIG_NETWORKING_WITH_LOGGING),y)
     EXTRA_CFLAGS += -DUIP_CONF_LOGGING=1
endif
obj-$(CONFIG_NETWORKING_WITH_LOGGING) += contiki/uip-log.o

obj-$(CONFIG_NETWORKING_WITH_LOOPBACK) += net_driver_loopback.o
obj-$(CONFIG_NETWORKING_WITH_15_4_LOOPBACK) += dummy_15_4_radio.o
obj-$(CONFIG_NETWORKING_WITH_15_4) += net_driver_15_4.o \
					contiki/mac/frame802154.o \
					contiki/mac/framer-802154.o \
					contiki/mac/csma.o \
					contiki/mac/mac-sequence.o \
					contiki/mac/sicslowmac/sicslowmac.o

# At the moment we only need nullsec driver for 802.15.4
#obj-$(CONFIG_NETWORKING_WITH_15_4) += contiki/llsec/ccm-star.o \
#					contiki/llsec/ccm-star.o \
#					contiki/llsec/anti-replay.o

ifeq ($(CONFIG_NETWORKING_WITH_15_4),)
     obj-y += contiki/mac/nullmac.o \
		contiki/mac/framer-nullmac.o
endif

obj-$(CONFIG_NETWORKING_UART) += contiki/os/dev/slip.o \
				contiki/os/dev/slip-arch.o

# workaround for include file location
CREATE_INCLUDE_LINK_net := $(shell ln -s ${ZEPHYR_BASE}/net/ip/contiki ${ZEPHYR_BASE}/net/ip/contiki/net > /dev/null 2>&1)

{'fraction_non_alphanumeric': 0.15308848080133555, 'fraction_numerical': 0.018530884808013355, 'mean_word_length': 3.4509658246656763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5474420', 'n_tokens_mistral': 2786, 'n_tokens_neox': 2669, 'n_words': 301}