diff options
| author | Sudar <sudar@sudarmuthu.com> | 2013-08-09 21:57:52 +0530 |
|---|---|---|
| committer | Sudar <sudar@sudarmuthu.com> | 2013-08-09 22:04:36 +0530 |
| commit | d719847a8a610591d22b1e3acf01ebffaa394153 (patch) | |
| tree | ad6a6d74a7d8d5b51ebe527e76afb1c9a2809f82 | |
| parent | c92d6724d711acccacf917a63b683fa10812e876 (diff) | |
Allow building with Arduino core, without a .ino/.pde file
Till not it is not possible to build with Arduino core, without using a
.ino or .pde file. This commit removes that restriction.
However, the user has to explicitly include Arduino header files.
Fix #105
| -rw-r--r-- | HISTORY.md | 1 | ||||
| -rw-r--r-- | arduino-mk/Arduino.mk | 19 |
2 files changed, 11 insertions, 9 deletions
@@ -18,6 +18,7 @@ The following is the rough list of changes that went into different versions. I - Compile with debugging symbols only when DEBUG=1 (https://github.com/peplin) - Replace Leonardo detection with Caterina detection (https://github.com/sej7278) - Autodetect baudrate only if either a .ino/.pde is present +- Allow building with Arduino core, without a .ino/.pde file ### 0.12.0 (2013-06-20) - Fix "generated_assembly" target, which got broken earlier. Fix issue #76 (https://github.com/matthijskooijman) diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 23e621b..ff8deb3 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -601,19 +601,20 @@ LOCAL_OBJ_FILES = $(LOCAL_C_SRCS:.c=.o) $(LOCAL_CPP_SRCS:.cpp=.o) \ $(LOCAL_INO_SRCS:.ino=.o) $(LOCAL_AS_SRCS:.S=.o) LOCAL_OBJS = $(patsubst %,$(OBJDIR)/%,$(LOCAL_OBJ_FILES)) -# If NO_CORE is not set, then we need exactly one .pde or .ino file -ifeq ($(strip $(NO_CORE)),) +ifeq ($(words $(LOCAL_SRCS)), 0) + $(error Atleast one source file (*.ino, *.pde, *.cpp, *c, *cc, *.S) is needed) +endif - ifeq ($(words $(LOCAL_PDE_SRCS) $(LOCAL_INO_SRCS)), 0) - ifeq ($(strip $(NO_CORE)),) - $(error No .pde or .ino files found. If you want to compile .c or .cpp files, then set NO_CORE) - endif - 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) - #TODO: Support more than one file. https://github.com/sudar/Arduino-Makefile/issues/49 - $(error Need exactly one .pde or .ino file) + 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 |
