build: stubdom and tools should depend on public header target
authorWei Liu <wei.liu2@citrix.com>
Wed, 17 May 2017 14:26:08 +0000 (15:26 +0100)
committerWei Liu <wei.liu2@citrix.com>
Thu, 18 May 2017 09:53:17 +0000 (10:53 +0100)
commitf745b55f137c9c086552dc7463ba2cefccab8292
treebf86214a3825405d7a25a891c486f14322125d53
parenta7d4a5904b62731551e366ff62d84759c8ee68e2
build: stubdom and tools should depend on public header target

Build can fail if stubdom build is run before tools build because:

1. tools/include build uses relative path and depends on XEN_OS
2. stubdom needs tools/include to be built, at which time XEN_OS is
   mini-os and corresponding symlinks are created
3. libraries inside tools needs tools/include to be built, at which
   time XEN_OS is the host os name, but symlinks won't be created
   because they are already there
4. libraries get the wrong headers and fail to build

Since both tools and stubdom build need the public headers, we build
tools/include before stubdom and tools. Remove runes in stubdom and
tools to avoid building tools/include more than once.

Provide a new dist target for tools/include.  Hook up the install,
clean, dist and distclean targets for tools/include.

The new arrangement ensures tools build gets the correct headers
because XEN_OS is set to host os when building tools/include. As for
stubdom, it explicitly links to the mini-os directory without relying
on XEN_OS so it should be fine.

Reported-by: Steven Haigh <netwiz@crc.id.au>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Steven Haigh <netwiz@crc.id.au>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Makefile
stubdom/Makefile
tools/Makefile
tools/include/Makefile