2006-06-17 22:41:10 +00:00
|
|
|
all: webserver-example
|
|
|
|
APPS=webserver
|
2007-05-26 22:42:02 +00:00
|
|
|
DEFAULT_TARGET=minimal-net
|
2006-06-17 22:41:10 +00:00
|
|
|
|
2007-04-23 23:30:14 +00:00
|
|
|
# The webserver application normally contains a built-in file system and support
|
|
|
|
# for server-side includes.
|
|
|
|
#
|
|
|
|
# This webserver example supports building the alternative webserver application
|
|
|
|
# which serves files from an cfs file system. To build the alternative webserver
|
|
|
|
# run make with the parameter HTTPD-CFS=1.
|
|
|
|
|
|
|
|
ifeq ($(HTTPD-CFS),1)
|
|
|
|
override webserver_src = webserver-nogui.c http-strings.c psock.c memb.c \
|
|
|
|
httpd-cfs.c
|
|
|
|
endif
|
|
|
|
|
2006-06-17 22:41:10 +00:00
|
|
|
CONTIKI = ../..
|
|
|
|
include $(CONTIKI)/Makefile.include
|
2007-04-23 23:30:14 +00:00
|
|
|
|
|
|
|
# Intentionally httpd.c and httpd-cfs.c implement the same interface. When
|
|
|
|
# switching from one webserver alternative to the other with an existent
|
|
|
|
# Contiki library then both files end up in the library making the linker
|
|
|
|
# use whichever it finds first :-(
|
|
|
|
#
|
|
|
|
# The most straightforward way to make sure this doesn't happen is to delete
|
|
|
|
# the Contiki library. But it would be undesirable to do that on every build
|
|
|
|
# so the existence of the "wrong" object file is used to detect a switch and
|
|
|
|
# trigger deletion of the Contiki library - and the trigger file of course.
|
|
|
|
|
|
|
|
ifeq ($(HTTPD-CFS),1)
|
|
|
|
ifneq (${wildcard $(OBJECTDIR)/httpd.o},)
|
|
|
|
DUMMY := ${shell rm -f contiki-$(TARGET).a $(OBJECTDIR)/httpd.o}
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
ifneq (${wildcard $(OBJECTDIR)/httpd-cfs.o},)
|
|
|
|
DUMMY := ${shell rm -f contiki-$(TARGET).a $(OBJECTDIR)/httpd-cfs.o}
|
|
|
|
endif
|
|
|
|
endif
|