Arduino-Makefile
Arduino-Makefile copied to clipboard
Allow assembly source files with a lower-case .s extension
I was very confused when I first tried to upload an assembly project using Arduino-mk, and it complained that there were no source files.
GCC (and hence, avr-gcc) allows assembly sources with either a lower-case or upper-case extension. I see no reason why Arduino-mk should require one or the other.
no complaints from me, bit surprised this hasn't already been done, assumed it was case-insensitive wildcard i guess.
although isn't that assignment going to stop .S files from working?
You're right! I think I made some silly mistakes when I was testing this...
I'll try again :)
you're not giving up on this are you @ryansuchocki ?
Temporarily... I was trying to comprehend the rest of the makefile, to see if this breaks something else, and I panicked!
@ryansuchocki is this ready to merge - subject to updating HISTORY.md ?
@sudar can we merge this (manually fixing history i guess)?
edit: no, can't merge as it doesn't extend to the new sam/due support, still lots of use of .S there
@sej7278
no, can't merge as it doesn't extend to the new sam/due support, still lots of use of .S there
Is there a easy way to fix this ourself?
@sudar actually probably just needs rebasing so it applies to lines 793, 799, 803, as we're only changing LOCAL_AS_SRCS provided by the user, not all instances of .S files (e.g. libraries, cores etc.)
I tried this, but I've no idea how to use a prebuilt assembly file with the makefile, so can't tell if it works. simply putting a blink.s file (from prior generated_assembly) in the project directory seems to break the build.
diff --git a/Arduino.mk b/Arduino.mk
index 979a039..cef790a 100644
--- a/Arduino.mk
+++ b/Arduino.mk
@@ -790,17 +790,17 @@ LOCAL_CPP_SRCS ?= $(wildcard *.cpp)
LOCAL_CC_SRCS ?= $(wildcard *.cc)
LOCAL_PDE_SRCS ?= $(wildcard *.pde)
LOCAL_INO_SRCS ?= $(wildcard *.ino)
-LOCAL_AS_SRCS ?= $(wildcard *.S)
+LOCAL_AS_SRCS ?= $(wildcard *.S *.s)
LOCAL_SRCS = $(LOCAL_C_SRCS) $(LOCAL_CPP_SRCS) \
$(LOCAL_CC_SRCS) $(LOCAL_PDE_SRCS) \
$(LOCAL_INO_SRCS) $(LOCAL_AS_SRCS)
LOCAL_OBJ_FILES = $(LOCAL_C_SRCS:.c=.c.o) $(LOCAL_CPP_SRCS:.cpp=.cpp.o) \
$(LOCAL_CC_SRCS:.cc=.cc.o) $(LOCAL_PDE_SRCS:.pde=.pde.o) \
- $(LOCAL_INO_SRCS:.ino=.ino.o) $(LOCAL_AS_SRCS:.S=.S.o)
+ $(LOCAL_INO_SRCS:.ino=.ino.o) $(LOCAL_AS_SRCS:.%=.%.o)
LOCAL_OBJS = $(patsubst %,$(OBJDIR)/%,$(LOCAL_OBJ_FILES))
ifeq ($(words $(LOCAL_SRCS)), 0)
- $(error At least one source file (*.ino, *.pde, *.cpp, *c, *cc, *.S) is needed)
+ $(error At least one source file (*.ino, *.pde, *.cpp, *c, *cc, *.S, *.s) is needed)
endif
# CHK_SOURCES is used by flymake
diff --git a/HISTORY.md b/HISTORY.md
index 10b3e5e..1719e9a 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -14,6 +14,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
- Tweak: Move non-standard-related items from CxxFLAGS_STD to CxxFLAGS (issue #523) (https://github.com/sej7278)
- Tweak: Update Windows usage documentation and allow non-relative paths (issue #519) (https://github.com/tuna-f1sh)
- Tweak: Support Cygwin Unix Python and Windows installation on Windows to pass correct port binding. (https://github.com/tuna-f1sh)
+- Tweak: Allow source files with lower-case .s extension (https://github.com/ryansuchocki)
- New: Added -fdiagnostics-color to \*STD flags (https://github.com/sej7278)
- New: Made -fdiagnostics-color take a variiable DIAGNOSTICS_COLOR_WHEN: never, always, auto. (https://github.com/wingunder)
- New: Add generation of tags file using ctags, which automatically includes project libs and Arduino core. (https://github.com/tuna-f1sh)
@sej7278
What are your thoughts on this PR?
Do you think we should rebase and test the changes as you suggested?
we need an example at least, as we don't even know if it works....
@ryansuchocki
Can you give us some examples of how to use the changes that you are proposing?