Skip to content

Commit

Permalink
Cleanup of the Contiki network layer configuration. Now using CONTIKI…
Browse files Browse the repository at this point in the history
…_WITH_IPV6, CONTIKI_WITH_IPV4, and CONTIKI_WITH_RIME in makefiles, and UIP_CONF_IPV6, UIP_CONF_IPV4, UIP_CONF_RIME in c code. Now only the stacks that are used are compiled (via makefile MODULES). Make IPv6 the default network stack.
  • Loading branch information
simonduq committed Dec 1, 2014
1 parent d3d33c5 commit 722b325
Show file tree
Hide file tree
Showing 161 changed files with 474 additions and 454 deletions.
35 changes: 31 additions & 4 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ ifeq ($(TARGET),)
endif
endif

ifeq ($(UIP_CONF_IPV6),1)
CFLAGS += -DUIP_CONF_IPV6=1
endif

ifeq ($(DEFINES),)
-include Makefile.$(TARGET).defines
ifneq ($(DEFINES),)
Expand Down Expand Up @@ -67,6 +63,37 @@ CFLAGS += -DCONTIKI=1 -DCONTIKI_TARGET_$(TARGET_UPPERCASE)=1

MODULES += core/sys core/dev core/lib

# Include IPv6, IPv4, and/or Rime

HAS_STACK = 0
ifeq ($(CONTIKI_WITH_IPV4),1)
HAS_STACK = 1
CFLAGS += -DUIP_CONF_IPV4=1
MODULES += core/net/ipv4 core/net/ip
endif

ifeq ($(CONTIKI_WITH_RIME),1)
HAS_STACK = 1
CFLAGS += -DUIP_CONF_RIME=1
MODULES += core/net/rime
endif

# Make IPv6 the default stack
ifeq ($(HAS_STACK),0)
ifneq ($(CONTIKI_WITH_IPV6),0)
CONTIKI_WITH_IPV6 = 1
endif
endif

ifeq ($(CONTIKI_WITH_IPV6),1)
CFLAGS += -DUIP_CONF_IPV6=1
ifneq ($(CONTIKI_WITH_RPL),0)
CFLAGS += -DUIP_CONF_IPV6_RPL=1
MODULES += core/net/rpl
endif # UIP_CONF_RPL
MODULES += core/net/ipv6 core/net/ip
endif

CONTIKI_SOURCEFILES += $(CONTIKIFILES)

CONTIKIDIRS += ${addprefix $(CONTIKI)/core/,dev lib net net/llsec net/mac net/rime \
Expand Down
44 changes: 29 additions & 15 deletions apps/shell/Makefile.shell
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
shell_src = shell.c shell-reboot.c \
shell-vars.c shell-ps.c shell-rime.c shell-sendtest.c \
shell_src = shell.c shell-reboot.c shell-vars.c shell-ps.c \
shell-blink.c shell-text.c shell-time.c \
shell-file.c shell-netfile.c shell-run.c \
shell-rime-ping.c shell-rime-sniff.c shell-rime-netcmd.c \
shell-rime-debug.c shell-rime-debug-runicast.c shell-coffee.c \
shell-wget.c shell-httpd.c shell-irc.c \
shell-file.c shell-run.c \
shell-coffee.c \
shell-power.c \
shell-tcpsend.c shell-udpsend.c shell-ping.c shell-netstat.c \
shell-rime-sendcmd.c shell-download.c shell-rime-neighbors.c \
shell-rime-unicast.c \
shell-base64.c \
shell-netperf.c shell-memdebug.c \
shell-powertrace.c shell-collect-view.c shell-crc.c
shell-memdebug.c \
shell-powertrace.c shell-crc.c
shell_dsc = shell-dsc.c

ifeq ($(CONTIKI_WITH_RIME),1)
shell_src += shell-rime.c shell-sendtest.c shell-netfile.c \
shell-rime-ping.c shell-rime-sniff.c shell-rime-netcmd.c \
shell-rime-debug.c shell-rime-debug-runicast.c \
shell-rime-sendcmd.c shell-download.c shell-rime-neighbors.c \
shell-rime-unicast.c shell-netperf.c \
shell-collect-view.c

APPS += collect-view
include $(CONTIKI)/apps/collect-view/Makefile.collect-view
endif

ifeq ($(CONTIKI_WITH_IPV4),1)
SHELL_WITH_IP = 1
endif
ifeq ($(CONTIKI_WITH_IPV6),1)
SHELL_WITH_IP = 1
endif

ifeq ($(SHELL_WITH_IP),1)
shell_src += shell-wget.c shell-httpd.c shell-irc.c \
shell-tcpsend.c shell-udpsend.c shell-ping.c shell-netstat.c
APPS += webserver
include $(CONTIKI)/apps/webserver/Makefile.webserver
ifndef PLATFORM_BUILD
Expand All @@ -38,13 +54,11 @@ ifndef PLATFORM_BUILD
override telnet_src = telnet.c
endif

endif

APPS += powertrace
include $(CONTIKI)/apps/powertrace/Makefile.powertrace


APPS += collect-view
include $(CONTIKI)/apps/collect-view/Makefile.collect-view

ifeq ($(TARGET),sky)
shell_src += shell-sky.c shell-exec.c
endif
Expand Down
2 changes: 0 additions & 2 deletions core/dev/slip.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ slip_set_input_callback(void (*c)(void))
/* slip_send: forward (IPv4) packets with {UIP_FW_NETIF(..., slip_send)}
* was used in slip-bridge.c
*/
//#if WITH_UIP
uint8_t
slip_send(void)
{
Expand Down Expand Up @@ -125,7 +124,6 @@ slip_send(void)

return UIP_FW_OK;
}
//#endif /* WITH_UIP */
/*---------------------------------------------------------------------------*/
uint8_t
slip_write(const void *_ptr, int len)
Expand Down
2 changes: 1 addition & 1 deletion cpu/6502/Makefile.6502
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CONTIKI_SOURCEFILES += $(CTK) ctk-conio.c petsciiconv.c cfs-posix-dir.c \
$(CONTIKI_TARGET_SOURCEFILES) $(CONTIKI_CPU_SOURCEFILES) \
$(ETHERNET_SOURCEFILES)

MODULES += core/ctk core/net/ip core/net/ipv4 core/net/ipv6
MODULES += core/ctk

# Set target-specific variable values
${addprefix $(OBJECTDIR)/,${call oname, $(ETHERNET_SOURCEFILES)}}: ASFLAGS += -D DYN_DRV=0
Expand Down
1 change: 1 addition & 0 deletions cpu/6502/ethconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ CONTIKI_PROJECT = ethconfig
all: $(CONTIKI_PROJECT)

CONTIKI = ../../..
CONTIKI_WITH_IPV4 = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions cpu/6502/ipconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ CONTIKI_PROJECT = ipconfig
all: $(CONTIKI_PROJECT)

CONTIKI = ../../..
CONTIKI_WITH_IPV4 = 1
include $(CONTIKI)/Makefile.include
2 changes: 1 addition & 1 deletion cpu/arm/at91sam7s/Makefile.at91sam7s
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ CFLAGSNO = -I. -I$(CONTIKI)/core -I$(CONTIKI_CPU) -I$(CONTIKI_CPU)/loader \
-I$(CONTIKI_CPU)/dbg-io \
-I$(CONTIKI)/platform/$(TARGET) \
${addprefix -I,$(APPDIRS)} \
-DWITH_UIP -DWITH_ASCII -DMCK=$(MCK) \
-DWITH_ASCII -DMCK=$(MCK) \
-Wall $(ARCH_FLAGS) -g -D SUBTARGET=$(SUBTARGET)

CFLAGS += $(CFLAGSNO) -O -DRUN_AS_SYSTEM -DROM_RUN
Expand Down
2 changes: 1 addition & 1 deletion cpu/arm/stm32f103/Makefile.stm32f103
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ CFLAGSNO = -I. -I$(CONTIKI)/core -I$(CONTIKI_CPU) -I$(CONTIKI_CPU)/loader \
-I$(CONTIKI_CPU)/dbg-io \
-I$(CONTIKI)/platform/$(TARGET) \
${addprefix -I,$(APPDIRS)} \
-DWITH_UIP -DWITH_ASCII -DMCK=$(MCK) \
-DWITH_ASCII -DMCK=$(MCK) \
-Wall $(ARCH_FLAGS) -g -D SUBTARGET=$(SUBTARGET)

CFLAGS += $(CFLAGSNO) -O -DRUN_AS_SYSTEM -DROM_RUN
Expand Down
4 changes: 2 additions & 2 deletions cpu/cc2430/Makefile.cc2430
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ endef
### Banking Guesswork:
### Examples outside examples/sensinode do not specify banking.
### We automatically turn it on if its unspecified and if we are building with
### UIP_CONF_IPV6
### CONTIKI_WITH_IPV6
ifndef HAVE_BANKING
ifeq ($(UIP_CONF_IPV6),1)
ifeq ($(CONTIKI_WITH_IPV6),1)
HAVE_BANKING=1
else
HAVE_BANKING=0
Expand Down
4 changes: 2 additions & 2 deletions cpu/cc253x/Makefile.cc253x
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ endif
### Banking Guesswork:
### Generic examples do not specify banking.
### We automatically turn it on if its unspecified and if we are building with
### UIP_CONF_IPV6
### CONTIKI_WITH_IPV6
ifndef HAVE_BANKING
ifeq ($(UIP_CONF_IPV6),1)
ifeq ($(CONTIKI_WITH_IPV6),1)
HAVE_BANKING=1
else
HAVE_BANKING=0
Expand Down
4 changes: 2 additions & 2 deletions cpu/mc1322x/slip-uart1.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ slip_arch_writeb(unsigned char c)
*
*/
/*---------------------------------------------------------------------------*/
#if WITH_UIP
#if UIP_CONF_IPV4
int
putchar(int c)
{
Expand All @@ -83,7 +83,7 @@ putchar(int c)

return c;
}
#endif
#endif /* UIP_CONF_IPV4 */
/*---------------------------------------------------------------------------*/
/**
* Initalize the RS232 port and the SLIP driver.
Expand Down
4 changes: 2 additions & 2 deletions cpu/msp430/f2xxx/uart0.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ uart0_writeb(unsigned char c)
#endif /* TX_WITH_INTERRUPT */
}
/*---------------------------------------------------------------------------*/
#if ! WITH_UIP /* If WITH_UIP is defined, putchar() is defined by the SLIP driver */
#endif /* ! WITH_UIP */
#if ! UIP_CONF_IPV4 /* If UIP_CONF_IPV4 is defined, putchar() is defined by the SLIP driver */
#endif /* ! UIP_CONF_IPV4 */
/*---------------------------------------------------------------------------*/
/**
* Initalize the RS232 port.
Expand Down
4 changes: 2 additions & 2 deletions cpu/msp430/f2xxx/uart1.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ uart1_writeb(unsigned char c)
#endif /* TX_WITH_INTERRUPT */
}
/*---------------------------------------------------------------------------*/
#if ! WITH_UIP /* If WITH_UIP is defined, putchar() is defined by the SLIP driver */
#endif /* ! WITH_UIP */
#if ! UIP_CONF_IPV4 /* If UIP_CONF_IPV4 is defined, putchar() is defined by the SLIP driver */
#endif /* ! UIP_CONF_IPV4 */
/*---------------------------------------------------------------------------*/
/**
* Initalize the RS232 port.
Expand Down
4 changes: 2 additions & 2 deletions cpu/msp430/slip_uart0.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ slip_arch_writeb(unsigned char c)
*
*/
/*---------------------------------------------------------------------------*/
#if WITH_UIP
#if UIP_CONF_IPV4
int
putchar(int c)
{
Expand All @@ -75,7 +75,7 @@ putchar(int c)

return c;
}
#endif
#endif /* UIP_CONF_IPV4 */
/*---------------------------------------------------------------------------*/
/**
* Initalize the RS232 port and the SLIP driver.
Expand Down
4 changes: 2 additions & 2 deletions cpu/msp430/slip_uart1.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ slip_arch_writeb(unsigned char c)
*
*/
/*---------------------------------------------------------------------------*/
#if WITH_UIP
#if UIP_CONF_IPV4
int
putchar(int c)
{
Expand All @@ -75,7 +75,7 @@ putchar(int c)

return c;
}
#endif
#endif /* UIP_CONF_IPV4 */
/*---------------------------------------------------------------------------*/
/**
* Initalize the RS232 port and the SLIP driver.
Expand Down
6 changes: 3 additions & 3 deletions cpu/stm32w108/dev/uart1.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ uart1_writeb(unsigned char c)
#endif /* TX_WITH_INTERRUPT */
}
/*---------------------------------------------------------------------------*/
#if ! WITH_UIP
/* If WITH_UIP is defined, putchar() is defined by the SLIP driver */
#endif /* ! WITH_UIP */
#if ! UIP_CONF_IPV4
/* If UIP_CONF_IPV4 is defined, putchar() is defined by the SLIP driver */
#endif /* ! UIP_CONF_IPV4 */
/*---------------------------------------------------------------------------*/
/*
* Initalize the RS232 port.
Expand Down
1 change: 1 addition & 0 deletions examples/antelope/netdb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ SMALL = 1

all: netdb-client netdb-server

CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions examples/antelope/shell/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ SMALL = 1

all: shell-db

CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions examples/cc2530dk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ CONTIKI_PROJECT = hello-world blink-hello timer-test sensors-demo
all: $(CONTIKI_PROJECT)

CONTIKI = ../..
CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
4 changes: 1 addition & 3 deletions examples/cc2530dk/border-router/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ DEFINES+=PROJECT_CONF_H=\"project-conf.h\"

# We need uIPv6, therefore we also need banking
HAVE_BANKING=1
UIP_CONF_IPV6=1
UIP_CONF_RPL=1

PROJECT_SOURCEFILES += slip-bridge.c

Expand All @@ -12,5 +10,5 @@ CONTIKI_PROJECT = border-router
all: $(CONTIKI_PROJECT)

CONTIKI = ../../..

CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions examples/cc2530dk/cc2531-usb-demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ DEFINES+=MODELS_CONF_CC2531_USB_STICK=1
all: $(CONTIKI_PROJECT)

CONTIKI = ../../..
CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions examples/cc2530dk/sniffer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ all: $(CONTIKI_PROJECT)

CONTIKI = ../../..

CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
6 changes: 3 additions & 3 deletions examples/cc2530dk/udp-ipv6/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
DEFINES+=PROJECT_CONF_H=\"project-conf.h\"

HAVE_BANKING=1
UIP_CONF_IPV6=1
UIP_CONF_RPL=1

PROJECT_SOURCEFILES += ping6.c

Expand All @@ -11,5 +9,7 @@ CONTIKI_PROJECT = client server
all: $(CONTIKI_PROJECT)

CONTIKI = ../../..

CONTIKI_WITH_IPV6 = 1
# needed for rimestats
CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions examples/cc2538dk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ CONTIKI_PROJECT = cc2538-demo timer-test
all: $(CONTIKI_PROJECT)

CONTIKI = ../..
CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
2 changes: 1 addition & 1 deletion examples/cc2538dk/sniffer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ CONTIKI_PROJECT = sniffer
all: $(CONTIKI_PROJECT)

CONTIKI = ../../..

CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
5 changes: 1 addition & 4 deletions examples/cc2538dk/udp-ipv6-echo-server/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
UIP_CONF_IPV6=1
UIP_CONF_RPL=1

CONTIKI_PROJECT = udp-echo-server

all: $(CONTIKI_PROJECT)

CONTIKI = ../../..

CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions examples/collect/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ all: $(CONTIKI_PROJECT)
APPS = serial-shell powertrace collect-view
CONTIKI = ../..

CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions examples/eeprom-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ all: $(CONTIKI_PROJECT)
TARGET=mbxxx

CONTIKI = ../..
CONTIKI_WITH_RIME = 1
include $(CONTIKI)/Makefile.include
1 change: 1 addition & 0 deletions examples/email/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ all: $(CONTIKI_PROJECT)
APPS = email

CONTIKI = ../..
CONTIKI_WITH_IPV4 = 1
include $(CONTIKI)/Makefile.include
Loading

0 comments on commit 722b325

Please sign in to comment.