How to build iotivity-constrained zephyr port

This is supposed to be so easy. You clone the zephyr repo and the iotivity-constrained repo. Then cd to port/zephyr in the iotivity-constrained repo and type ‘make’. Only the Makefile there is quite incomplete and wrong. It sets up the board definition and the config file, then these 2 lines that point to non-existent files (assuming ZEPHYR_BASE points to the root of the cloned zephyr repo):

include ${ZEPHYR_BASE}/Makefile.inc
include $(ZEPHYR_BASE)/samples/net/common/Makefile.ipstack

There is also a Makefile in port/zephyr/src, but it can’t be run as is because it has no targets. I don’t know how that ties in either, but it also references directories in the zephyr repo that don’t exist.

If Zephy itself is well supported, I’m not sure about the iotivity/zephyr combo, I did not find much documentation. And their wiki seems a bit out-of-date. After looking a bit in the port/zephyr log, it seems that iotivity is compatible with zephyr 1.9, so you should try to checkout this version:

$ cd zephyr
$ git checkout zephyr-v1.9.0

ZEPHYR_BASE is normally defined when you source the zephyr env script [1]

$ source zephyr-env.sh

Then you should be able to run make from iotivity port/zephyr directory. (it looks like you also have to git clone tinycbor into deps and add zephyr,uart-pipe node to the chosen node in zephyr/dts/arm/96b_nitrogen.dts)

[1] http://docs.zephyrproject.org/getting_started/getting_started.html#building-and-running-an-application