From c331967ae1e7e2e082d2fe4e5a8afade8b5e2b8c Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 9 Jan 2017 10:35:50 -0700 Subject: [PATCH] zephyr: Move Zephyr build to top level The Zephyr build system does strange things if it refers to source directories above the main Makefile (generating outdir//../boot/... paths). For now, fix this by moving the Zephyr Makefile to the top-level in the tree. This shouldn't have much impact on Mynewt, as it doesn't use makefiles. --- .gitignore | 3 +++ zephyr/Makefile => Makefile | 3 ++- zephyr/build_boot.sh => build_boot.sh | 2 +- zephyr/src/Makefile | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .gitignore rename zephyr/Makefile => Makefile (51%) rename zephyr/build_boot.sh => build_boot.sh (66%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b6aa5681 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +outdir/ +.*.swp +target.sh diff --git a/zephyr/Makefile b/Makefile similarity index 51% rename from zephyr/Makefile rename to Makefile index 4de50f93..fd5a412b 100644 --- a/zephyr/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ BOARD ?= qemu_x86 -CONF_FILE = prj.conf +CONF_FILE = zephyr/prj.conf +SOURCE_DIR = zephyr/src include ${ZEPHYR_BASE}/Makefile.inc diff --git a/zephyr/build_boot.sh b/build_boot.sh similarity index 66% rename from zephyr/build_boot.sh rename to build_boot.sh index 2fc83261..b9988129 100755 --- a/zephyr/build_boot.sh +++ b/build_boot.sh @@ -1,6 +1,6 @@ #! /bin/bash source $(dirname 0)/target.sh -source ../../zephyr/zephyr-env.sh +source ../zephyr/zephyr-env.sh make BOARD=$BOARD "$@" diff --git a/zephyr/src/Makefile b/zephyr/src/Makefile index 69283e36..0996747c 100644 --- a/zephyr/src/Makefile +++ b/zephyr/src/Makefile @@ -1,5 +1,5 @@ -subdir-ccflags-y += -I$(PROJECT)/../boot/bootutil/include -subdir-ccflags-y += -I$(PROJECT)/include +subdir-ccflags-y += -I$(PROJECT)/boot/bootutil/include +subdir-ccflags-y += -I$(PROJECT)/zephyr/include obj-y += main.o obj-y += flash_map.o hal_flash.o os.o