Skip to content

Commit 207aba9

Browse files
committed
RadioLib: Use EXTERN_LIBS instead of Makefile paths
Signed-off-by: Alistair Francis <[email protected]>
1 parent a2ec25e commit 207aba9

File tree

9 files changed

+62
-52
lines changed

9 files changed

+62
-52
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
[submodule "libopenthread/openthread"]
88
path = libopenthread/openthread
99
url = https://github.com/openthread/openthread.git
10-
[submodule "libradio/RadioLib"]
11-
path = libradio/RadioLib
10+
[submodule "RadioLib/RadioLib"]
11+
path = RadioLib/RadioLib
1212
url = https://github.com/jgromes/RadioLib.git

RadioLib/Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
LIBNAME := RadioLib
2+
3+
TOCK_USERLAND_BASE_DIR ?= ..
4+
5+
$(LIBNAME)_DIR := $(TOCK_USERLAND_BASE_DIR)/$(LIBNAME)
6+
7+
# We ideally want this:
8+
# $(LIBNAME)_SRCS := \
9+
# $($(LIBNAME)_DIR)/$(LIBNAME)/src/Module.cpp \
10+
# $(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*.cpp) \
11+
# $(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*/*.cpp) \
12+
# $(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*/*/*.cpp)
13+
#
14+
# But due to this in the GCC arm binary in the CI:
15+
#
16+
# ```
17+
# (insn 179 178 46 8 (set (reg:SI 3 r3 [168])
18+
# (mem/u/c:SI (plus:SI (reg:SI 12 ip [169])
19+
# (unspec:SI [
20+
# (symbol_ref/u:SI ("*.LC1") [flags 0x2])
21+
# ] UNSPEC_PIC_SYM)) [0 S4 A32])) "../../../RadioLib/src/modules/LR11x0/LR11x0.cpp":638:16 929 {*thumb1_movsi_insn}
22+
# (expr_list:REG_EQUAL (symbol_ref/u:SI ("*.LC1") [flags 0x2])
23+
# (nil)))
24+
# during RTL pass: postreload
25+
# ../../../RadioLib/src/modules/LR11x0/LR11x0.cpp:650:1: internal compiler error: in extract_constrain_insn, at recog.c:2195
26+
# ```
27+
#
28+
# we need to drop LR11x0
29+
$(LIBNAME)_SRCS := \
30+
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/*.cpp) \
31+
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/utils/*.cpp) \
32+
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/C*/.cpp) \
33+
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/LL*/*.cpp) \
34+
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/RF*/*.cpp) \
35+
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/S*/*.cpp) \
36+
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/modules/n*/*.cpp) \
37+
$(wildcard $($(LIBNAME)_DIR)/$(LIBNAME)/src/protocols/*/*.cpp) \
38+
39+
include $(TOCK_USERLAND_BASE_DIR)/TockLibrary.mk

RadioLib/Makefile.app

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Include the core RadioLib headers
2+
override CPPFLAGS += -I$(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/src
3+
4+
# Include the Tock specific headers
5+
override CPPFLAGS += -I$(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/examples/NonArduino/Tock

RadioLib/Makefile.setup

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.PHONY: clean
2+
3+
TOCK_USERLAND_BASE_DIR ?= ../
4+
5+
6+
all: $(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/README.md
7+
8+
clean::
9+
rm -rf build
10+
11+
# confirm RadioLib git submodule is checked out.
12+
$(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib/README.md:
13+
git submodule update --init -- $(TOCK_USERLAND_BASE_DIR)/RadioLib/RadioLib
14+

examples/lora/sensor-receive/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ TOCK_USERLAND_BASE_DIR = ../../..
77
CXX_SRCS := $(wildcard *.cc)
88

99
# Use the libtock-c Make system
10-
include $(TOCK_USERLAND_BASE_DIR)/libradio/Makefile
11-
12-
include $(TOCK_USERLAND_BASE_DIR)/libradio/Makefile.app
10+
EXTERN_LIBS += $(TOCK_USERLAND_BASE_DIR)/RadioLib
1311

1412
include $(TOCK_USERLAND_BASE_DIR)/AppMakefile.mk

examples/lora/sensor-transmit/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ TOCK_USERLAND_BASE_DIR = ../../..
77
CXX_SRCS := $(wildcard *.cc)
88

99
# Use the libtock-c Make system
10-
include $(TOCK_USERLAND_BASE_DIR)/libradio/Makefile
11-
12-
include $(TOCK_USERLAND_BASE_DIR)/libradio/Makefile.app
10+
EXTERN_LIBS += $(TOCK_USERLAND_BASE_DIR)/RadioLib
1311

1412
include $(TOCK_USERLAND_BASE_DIR)/AppMakefile.mk

libradio/Makefile

Lines changed: 0 additions & 39 deletions
This file was deleted.

libradio/Makefile.app

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)