llvm-ar behaves weidly when creating thin archive. This only manifests itself when using arduino sketches as these are built from the "bin" directory. Specifically, given a directory "m" and an object in "m/obj.o " an invocation with CWD==m: ``` llvm-ar rcTs ../m.a obj.o ``` Will create a maformed archive. Binutils does not have any issue with this. The following command, executed with CWD==m/.. works: ``` llvm-ar rcTs m.a m/obj.o ``` The trick used in this commit is to put the source files in a different directory than the object files and compile from there.
16 lines
520 B
Makefile
16 lines
520 B
Makefile
# Add Arduino sketches to the application as a module
|
|
|
|
# Define application sketches module, it will be generated into $(BINDIR)
|
|
SKETCH_MODULE ?= arduino_sketches
|
|
SKETCH_MODULE_DIR ?= $(BINDIR)/$(SKETCH_MODULE)_src
|
|
SKETCHES = $(wildcard $(APPDIR)/*.sketch)
|
|
include $(RIOTBASE)/sys/arduino/sketches.inc.mk
|
|
|
|
# Depends on module
|
|
USEMODULE += $(SKETCH_MODULE)
|
|
DIRS += $(SKETCH_MODULE_DIR)
|
|
BUILDDEPS += $(SKETCH_GENERATED_FILES)
|
|
|
|
# include the Arduino headers
|
|
INCLUDES += -I$(RIOTBASE)/sys/arduino/include
|