Skip to content

Commit

Permalink
EpoxyDuino.mk: support v1.0 libraries which places files under the ./…
Browse files Browse the repository at this point in the history
…utility subdirectory (Fixes #89)
  • Loading branch information
bxparks committed Jul 25, 2024
1 parent df3c187 commit eed664c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* Add `strncat_P()` to `pgmspace.h`.
* Add `ESP.restart()` and `ESP.getChipId()`. See
[PR#84](https://github.com/bxparks/EpoxyDuino/pull/84).
* Support files located in the `utility` subdirectory for libraries using
the old v1.0 format. Fixes
[Issue#89](https://github.com/bxparks/EpoxyDuino/issues/89).
* 1.5.0 (2022-12-08)
* Support compiling plain `*.c` files in libraries and in the application.
* The C files are assumed to be written in C11.
Expand Down
12 changes: 8 additions & 4 deletions EpoxyDuino.mk
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,12 @@ CPPFLAGS += $(EXTRA_CPPFLAGS)
CPPFLAGS += -D ARDUINO=100 -D UNIX_HOST_DUINO -D EPOXY_DUINO -D $(EPOXY_CORE)
# Add the header files for the Core files.
CPPFLAGS += -I$(EPOXY_CORE_PATH)
# Add the header files for libraries. Old Arduino libraries place the header
# and source files right at the top. New Arduino libraries tend to use the
# ./src/ subdirectory. We need to support both.
CPPFLAGS_EXPANSION = -I$(module) -I$(module)/src
# Add the header files for libraries. Old Arduino libraries (v1.0) place the
# header and source files right at the top, or in a subdirectory named
# 'utility'. New Arduino libraries (v1.5) place all their files recursively
# under the ./src/ subdirectory. We need to support both. See details at:
# https://arduino.github.io/arduino-cli/1.0/library-specification/ .
CPPFLAGS_EXPANSION = -I$(module) -I$(module)/src -I$(module)/utility
CPPFLAGS += $(foreach module,$(EPOXY_MODULES),$(CPPFLAGS_EXPANSION))

# Linker settings (e.g. -lm).
Expand All @@ -176,11 +178,13 @@ EPOXY_SRCS := $(wildcard $(EPOXY_CORE_PATH)/*.cpp) \
# Later Arduino libraries put the source files under the src/ directory. Also
# support 3 levels of subdirectories. Support both C and C++ libraries files.
MODULE_EXPANSION_CPP = $(wildcard $(module)/*.cpp) \
$(wildcard $(module)/utility/*.cpp) \
$(wildcard $(module)/src/*.cpp) \
$(wildcard $(module)/src/*/*.cpp) \
$(wildcard $(module)/src/*/*/*.cpp) \
$(wildcard $(module)/src/*/*/*/*.cpp)
MODULE_EXPANSION_C = $(wildcard $(module)/*.c) \
$(wildcard $(module)/utility/*.c) \
$(wildcard $(module)/src/*.c) \
$(wildcard $(module)/src/*/*.c) \
$(wildcard $(module)/src/*/*/*.c) \
Expand Down

0 comments on commit eed664c

Please sign in to comment.