diff options
| author | Ronan Barzic <rbarzic@gmail.com> | 2014-06-05 22:56:17 +0200 |
|---|---|---|
| committer | Sudar <sudar@sudarmuthu.com> | 2014-06-10 16:05:08 +0530 |
| commit | 05a0c7d37722183390f6c2f8699a569589049006 (patch) | |
| tree | 8ee51d3325f2258118d03cb010638694e7c7889f /Arduino.mk | |
| parent | a4dc43b58f5f3766c4594472a28b7180fd65e160 (diff) | |
Make Arduino.mk compatible with Flymake
If Flymake is configured to parse .ino files the same way as for c/c++
files, it creates a temporary file (_flymake.ino) in the same directory
as the original file. It fails with the current Arduino.mk because of
the check for multiple .ino files. This fix removes the check
only when flymake is calling the Makefile (Flymake will call make with
the variable CHK_SOURCES set to the temporary file name)
To make Flymake working with .ino file :
Add :
check-syntax:
$(CXX_NAME) -c -include Arduino.h -x c++ $(CXXFLAGS) $(CPPFLAGS) -fsyntax-only $(CHK_SOURCES)
in the project Makefile after the inclusion of the Arduino.mk file
Edit the flymake configuration :
M-x customize-option RET
flymake-allowed-file-name-masks RET (using auto completion !)
Add the line :
("\\.ino\\'" flymake-simple-make-init)
Then click on "Apply and Save" button
Fix #211
Diffstat (limited to 'Arduino.mk')
| -rw-r--r-- | Arduino.mk | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -651,18 +651,23 @@ ifeq ($(words $(LOCAL_SRCS)), 0) $(error At least one source file (*.ino, *.pde, *.cpp, *c, *cc, *.S) is needed) endif -ifeq ($(strip $(NO_CORE)),) - - # Ideally, this should just check if there are more than one file - ifneq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 1) - ifeq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 0) - $(call show_config_info,No .pde or .ino files found. If you are compiling .c or .cpp files then you need to explicitly include Arduino header files) - else - #TODO: Support more than one file. https://github.com/sudar/Arduino-Makefile/issues/49 - $(error Need exactly one .pde or .ino file. This makefile doesn't support multiple .ino/.pde files yet) +# CHK_SOURCES is used by flymake +# flymake creates a tmp file in the same directory as the file under edition +# we must skip the verification in this particular case +ifeq ($(strip $(CHK_SOURCES)),) + ifeq ($(strip $(NO_CORE)),) + + # Ideally, this should just check if there are more than one file + ifneq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 1) + ifeq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 0) + $(call show_config_info,No .pde or .ino files found. If you are compiling .c or .cpp files then you need to explicitly include Arduino header files) + else + #TODO: Support more than one file. https://github.com/sudar/Arduino-Makefile/issues/49 + $(error Need exactly one .pde or .ino file. This makefile doesn't support multiple .ino/.pde files yet) + endif endif - endif + endif endif # core sources |
