Hey All,
I’m building a software project that is configured to build and run on multiple different systems.
I’m invoking the particle make commands from a project-level Makefile.
My source tree is a bit unorthodox in the context of particle, but reasonably standard for C++ development:
+ project
+-- depends (git submodules and other 3rd party code)
| +-- some_dep
| +-- include
| +-- someheader.h
| +-- src
| +-- somefile.cpp
| +-- particle_lib
| +-- firmware
| +-- lib_name.h
| +-- lib_name.cpp
| +-- firmware (particle sysem firmware)
+-- appname
| +-- src
| +-- core
| +-- main.cpp
| +-- logs
| +-- logs.h
| +-- logs.cpp
| +-- pretty_logs.h
| +-- build.mk
| +-- project.properties (blank)
+-- tests
| +-- some_test
| +-- some_test.cpp
+-- Makefile
It looks like the particle build system is ignoring my custom makefile. I’ve set APPDIR=/home/user/project/appname
.
My makefile basically sets up any particle-firmware libraries in the depends folder, adds a few custom source directories, include directories (for libraries not in particle format), and explicitly structures the build directory (including the logs directory and source).
# build.mk
APP_ROOT=../
APP_DEPENDECIES_INCLUDE = \
depends/some_dep/include
APP_DEPENDECIES_SRC = \
depends/some_dep/src
APP_LIB_DIR = depends
APP_LIBS = \
particle-lib
INCLUDE_DIRS += $(APP_ROOT)/$(APP_DEPENDECIES_INCLUDE)
CPPSRC += $(call target_files, $(APP_ROOT)/$(APP_DEPENDECIES_SRC), *.cpp)
CSRC += $(call target_files, $(APP_ROOT)/$(APP_DEPENDECIES_SRC), *.c)
LIB_DIRS += $(APP_ROOT)/$(APP_LIB_DIR)
LIBS += $(APP_LIBS)
APPLIBS = $(APP_LIBS)
APP_SRC = \
depends/some_dep/src \
appname/src/core \
appname/src/logs \
CPPSRC += $(call target_files,$(APP_SRC), *.cpp)
CSRC += $(call target_files,$(APP_SRC), *.c)
APPSOURCES = $(call target_files,$(APP_SRC), *.cpp)
I’ve tried setting USER_MAKEFILE
and naming the makefile differently.
The particle build is picking up my main.cpp for compilation, but missing some references to the include dirs. It’s failing with “fatal error: someheader.h: No such file or directory”. It’s referenced using #include <someheader.h>
Can anyone give me any insight into why particle seems to be ignoring my custom makefile? It doesn’t include any targets, just variable setup.
I assume if someheader.h was on the include path it would find it. I’ve tried switching to quote-based include references but it did not help. Our version of the system firmware is frozen at 0.5.3 if that makes any difference.