1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg: let some packages to remain built in-source

openthread, micropython and nordic_softdevice cannot be built out-of-source
This commit is contained in:
Alexandre Abadie 2020-06-13 21:01:04 +02:00
parent a8eb1f5d53
commit 91fbb42061
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
5 changed files with 32 additions and 23 deletions

View File

@ -5,8 +5,12 @@ PKG_LICENSE=MIT
CFLAGS += -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-error
# Micropython build system doesn't support (yet) out-of-source builds
# so clone and build micropython within the application build directory
PKG_BUILD_OUT_OF_SOURCE = 0
include $(RIOTBASE)/pkg/pkg.mk
all:
@mkdir -p $(PKG_BUILDDIR)/tmp
BUILD=$(PKG_BUILDDIR) "$(MAKE)" -C $(PKG_BUILDDIR)/ports/riot
@mkdir -p $(PKG_BUILD_DIR)/tmp
BUILD=$(PKG_BUILD_DIR) "$(MAKE)" -C $(PKG_SOURCE_DIR)/ports/riot

View File

@ -5,8 +5,8 @@ CFLAGS += -DMP_RIOT_HEAPSIZE=$(MP_RIOT_HEAPSIZE)
# include paths
INCLUDES += -I$(RIOTBASE)/pkg/micropython/include
INCLUDES += -I$(PKGDIRBASE)/micropython
INCLUDES += -I$(PKGDIRBASE)/micropython/ports/riot
INCLUDES += -I$(BINDIR)/pkg/micropython
INCLUDES += -I$(BINDIR)/pkg/micropython/ports/riot
# The port currently doesn't build with llvm
TOOLCHAINS_BLACKLIST += llvm

View File

@ -5,9 +5,10 @@ PKG_URL = https://developer.nordicsemi.com/nRF5_IoT_SDK/nRF5_IoT_SDK_v0.9.x/$(PK
PKG_MD5 = 291c875df69c51e22491e6112128bd9c
PKG_LICENSE = nordic-bsd
PKG_DIR=$(CURDIR)
PKG_BUILDDIR=$(PKGDIRBASE)/$(PKG_NAME)
PKG_SRCDIR=$(PKG_BUILDDIR)/src
PKG_DIR = $(CURDIR)
PKG_BUILD_DIR = $(BINDIR)/pkg/$(PKG_NAME)
PKG_SOURCE_DIR = $(PKGDIRBASE)/$(PKG_NAME)
PKG_SRCDIR = $(PKG_SOURCE_DIR)/src
SOFTDEVICE := components/softdevice/s1xx_iot/s1xx-iot-prototype3_nrf52_softdevice.hex
BLE_6LOWPAN_LIB := components/iot/ble_6lowpan/lib/ble_6lowpan.a
@ -21,13 +22,13 @@ all: $(BINDIR)/ble_6lowpan.a $(BINDIR)/softdevice.hex $(SOFTDEVICE_MODULES)
prepare: $(PKG_SRCDIR)/.extracted
softdevice_handler:
make -C $(PKG_BUILDDIR)/src/components/softdevice/common/softdevice_handler -f $(RIOTBASE)/Makefile.base
"$(MAKE)" -C $(PKG_SRCDIR)/components/softdevice/common/softdevice_handler -f $(RIOTBASE)/Makefile.base
ble_common:
make -C $(PKG_BUILDDIR)/src/components/ble/common -f $(CURDIR)/ble_common.mk
"$(MAKE)" -C $(PKG_SRCDIR)/components/ble/common -f $(CURDIR)/ble_common.mk
ble_ipsp:
make -C $(PKG_BUILDDIR)/src/components/iot/ble_ipsp -f $(RIOTBASE)/Makefile.base
"$(MAKE)" -C $(PKG_SRCDIR)/components/iot/ble_ipsp -f $(RIOTBASE)/Makefile.base
$(BINDIR)/ble_6lowpan.a: $(PKG_SRCDIR)/.extracted
cp $(PKG_SRCDIR)/$(BLE_6LOWPAN_LIB) $@
@ -38,18 +39,18 @@ $(BINDIR)/ble_6lowpan.a: $(PKG_SRCDIR)/.extracted
$(BINDIR)/softdevice.hex: $(PKG_SRCDIR)/.extracted
$(Q)$(OBJCOPY) $(OFLAGS) -Oihex --gap-fill 0xff $(PKG_SRCDIR)/$(SOFTDEVICE) $@
$(PKG_SRCDIR)/.extracted: $(PKG_BUILDDIR)/$(PKG_FILE)
$(PKG_SRCDIR)/.extracted: $(PKG_SOURCE_DIR)/$(PKG_FILE)
rm -rf $(@D)
mkdir -p $(@D)
$(Q)cd $(@D) && $(UNZIP_HERE) $(PKG_BUILDDIR)/$(PKG_FILE)
$(Q)cd $(@D) && $(UNZIP_HERE) $(PKG_SOURCE_DIR)/$(PKG_FILE)
touch $@
$(PKG_BUILDDIR)/$(PKG_FILE):
$(PKG_SOURCE_DIR)/$(PKG_FILE):
@mkdir -p $(@D)
$(Q)$(DLCACHE) $(PKG_URL) $(PKG_MD5) $@
clean::
rm -rf $(PKG_SRCDIR)/
rm -rf $(PKG_SOURCE_DIR)/
distclean::
rm -rf $(PKG_BUILDDIR)/
rm -rf $(PKG_BUILD_DIR)/

View File

@ -3,6 +3,10 @@ PKG_URL=https://github.com/openthread/openthread.git
PKG_VERSION=thread-reference-20180926
PKG_LICENSE=BSD-3-Clause
# OpenThread build system doesn't support (yet) out-of-source builds
# so clone and build OpenThread within the application build directory
PKG_BUILD_OUT_OF_SOURCE = 0
include $(RIOTBASE)/pkg/pkg.mk
ifneq (,$(filter openthread-ftd,$(USEMODULE)))
@ -25,7 +29,7 @@ OPENTHREAD_COMMON_FLAGS = -fdata-sections -ffunction-sections -Os
OPENTHREAD_COMMON_FLAGS += -Wno-implicit-fallthrough -Wno-unused-parameter
OPENTHREAD_CXXFLAGS += -Wno-class-memaccess
OT_LIB_DIR = $(PKG_BUILDDIR)/output/lib
OT_LIB_DIR = $(PKG_BUILD_DIR)/output/lib
MODULE_LIBS = mbedcrypto.a openthread-$(TD).a
ifneq (,$(filter openthread-cli,$(USEMODULE)))
MODULE_LIBS += openthread-cli.a
@ -43,12 +47,12 @@ $(BINDIR)/mbedcrypto.a: $(BINDIR)/openthread-$(TD).a
$(BINDIR)/openthread-cli.a: $(BINDIR)/openthread-$(TD).a
@cp $(OT_LIB_DIR)/libopenthread-cli-$(TD).a $@
$(OT_LIB_DIR)/libopenthread-$(TD).a: $(PKG_BUILDDIR)/Makefile
make -C $(PKG_BUILDDIR) -j4 --no-print-directory install DESTDIR=$(PKG_BUILDDIR)/output PREFIX=/
$(OT_LIB_DIR)/libopenthread-$(TD).a: $(PKG_BUILD_DIR)/Makefile
make -C $(PKG_BUILD_DIR) -j4 --no-print-directory install DESTDIR=$(PKG_BUILD_DIR)/output PREFIX=/
$(Q)printf "OpenThread built for %s device\n" $(TD)
$(PKG_BUILDDIR)/Makefile: $(PKG_BUILDDIR)/configure
$(Q)cd $(PKG_BUILDDIR) && CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)"\
$(PKG_BUILD_DIR)/Makefile: $(PKG_BUILD_DIR)/configure
$(Q)cd $(PKG_BUILD_DIR) && CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)"\
OBJC="" OBJCXX="" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" \
STRIP="$(STRIP)" \
CPPFLAGS="$(OPENTHREAD_COMMON_FLAGS) $(CFLAGS_CPU) -D$(CONFIG_FILE)" \
@ -60,6 +64,6 @@ $(PKG_BUILDDIR)/Makefile: $(PKG_BUILDDIR)/configure
./configure --disable-docs --host=$(TARGET_ARCH) --target=$(TARGET_ARCH) \
--prefix=/ --enable-default-logging $(OPENTHREAD_ARGS)
$(PKG_BUILDDIR)/configure: $(PKG_PREPARED)
$(PKG_BUILD_DIR)/configure: $(PKG_PREPARED)
$(Q)printf "OPENTHREAD_ARGS is [$(OPENTHREAD_ARGS)]\n"
$(Q)cd $(PKG_BUILDDIR) && PREFIX="/" ./bootstrap
$(Q)cd $(PKG_BUILD_DIR) && PREFIX="/" ./bootstrap

View File

@ -1,7 +1,7 @@
OPENTHREAD_DIR = $(RIOTBASE)/pkg/openthread
INCLUDES += -I$(OPENTHREAD_DIR)/include \
-I$(PKGDIRBASE)/openthread/include
-I$(BINDIR)/pkg/openthread/include
ifneq (,$(filter openthread_contrib,$(USEMODULE)))
DIRS += $(OPENTHREAD_DIR)/contrib