-
Notifications
You must be signed in to change notification settings - Fork 448
Make Arduino.mk compatible with Flymake #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
Can you also update the README file and add a note about how to use the makefile with Flymake? |
wow that's some horrible behaviour from emacs, although there appears to be an easier fix:
|
(*) for example, two checkout of the same repository. I'll do the README update as soon as I'm back in front of my personnal computer |
unless of course it re-creates the complete directory path under the tmp dir - not sure flymake was doing that - I'll double check |
Double check this and if it works then we can don't have to merge this PR. |
Readme.md file updated as requested Ronan |
there's still a typo in README.md
does this actually work though - i can't get anything to build if 2 ino files are in the same directory if i take the check out, or is that what the local Makefile check_syntax is for? |
Hi sej7278 Can you point to the typo error in the Readme file ? I can't see it (but English is not my mother tongue) |
this is the typo, shouldn't it say Arduino.mk not Automake.mk ?
|
Fixed (it was actually in the HISTORY.md file :-) ) |
Just merged it. Thanks. |
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 :
$(CXX_NAME) -c -include Arduino.h -x c++ $ (CXXFLAGS) $(CPPFLAGS) -fsyntax-only $ (CHK_SOURCES)
check-syntax:
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