When running make with even a simple blink project, the build aborts right away complaining about a missing compiler.
Solution: Put the include
statement in the Makefile at the end of the file, after all other variables have been set.
After linking, build complains that it cannot find /python
. Obviously lacking the path where to look at. Looks like the path should come from the Arduino IDE but it is not. Issue is also tracked here:
Workaround: modify the esp Makefile and add the path to Python:
diff --git a/makeEspArduino.mk b/makeEspArduino.mk
index b09091e..2f06989 100644
--- a/makeEspArduino.mk
+++ b/makeEspArduino.mk
@@ -491,6 +491,7 @@ sub def_var {
$$v{$$name} = "\$$($$var)";
}
+$$v{'runtime.tools.python.path'} = '/usr/bin';
$$v{'runtime.platform.path'} = '$$(ESP_ROOT)';
$$v{'includes'} = '$$(C_INCLUDES)';
$$v{'runtime.ide.version'} = '10605';
Using ccls. Install it, in Vim run Coc config and in the languageserver section add:
"ccls": {
"command": "ccls",
"filetypes": ["c", "cpp", "objc", "objcpp"],
"rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"],
"initializationOptions": {
"cache": {
"directory": "/tmp/ccls"
}
}
}
Restart Vim.
Install Bear (Build EAR). Run it in the directory where the Makefile is with bear make
. This will generate the compile_commands.json
file which ccls needs to know where to look for header files. Restart Vim.