diff --git a/examples/ipv6/rpl-border-router/Makefile b/examples/ipv6/rpl-border-router/Makefile index 3fd4c82b4..8ce443082 100644 --- a/examples/ipv6/rpl-border-router/Makefile +++ b/examples/ipv6/rpl-border-router/Makefile @@ -5,16 +5,24 @@ CONTIKI=../../.. WITH_UIP6=1 UIP_CONF_IPV6=1 -#Override inclusion of internal webserver with make WITH_WEBSERVER=0 -WITH_WEBSERVER=1 - -ifeq ($(WITH_WEBSERVER), 0) CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\" PROJECT_SOURCEFILES += slip-bridge.c -else + +#Simple built-in webserver is the default. +#Override with make WITH_WEBSERVER=0 for no webserver. +#WITH_WEBSERVER=webserver-name will use /apps/webserver-name if it can be +#found in the /apps, /platform/$(TARGET)/apps/, or current directory (in that order). +# WITH_WEBSERVER=webserver for /apps/webserver +# WITH_WEBSERVER=raven-webserver for /platform/avr-raven/apps/raven-webserver/ +#make clean before changing webservers! +WITH_WEBSERVER=1 +ifeq ($(WITH_WEBSERVER),1) +CFLAGS += -DWEBSERVER=1 +PROJECT_SOURCEFILES += httpd-simple.c APPS += webserver -CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\" -DWEBSERVER -PROJECT_SOURCEFILES += slip-bridge.c httpd-simple.c +else ifneq ($(WITH_WEBSERVER), 0) +APPS += $(WITH_WEBSERVER) +CFLAGS += -DWEBSERVER=2 endif include $(CONTIKI)/Makefile.include diff --git a/examples/ipv6/rpl-border-router/border-router.c b/examples/ipv6/rpl-border-router/border-router.c index a7a31f48e..b5e9a470e 100644 --- a/examples/ipv6/rpl-border-router/border-router.c +++ b/examples/ipv6/rpl-border-router/border-router.c @@ -69,11 +69,17 @@ static uip_ipaddr_t prefix; static uint8_t prefix_set; PROCESS(border_router_process, "Border router process"); -AUTOSTART_PROCESSES(&border_router_process); -#if WEBSERVER -/*---------------------------------------------------------------------------*/ -/* Only one single web request at time */ +#if WEBSERVER==0 + /* No webserver */ +AUTOSTART_PROCESSES(&border_router_process); +#elif WEBSERVER>1 +/* Use an external webserver process */ +//PROCESS_NAME(webserver_nogui_process); +AUTOSTART_PROCESSES(&border_router_process,&webserver_nogui_process); +#else +AUTOSTART_PROCESSES(&border_router_process,&webserver_nogui_process); +/* Use simple webserver with only one page */ static const char *TOP = "