Replaced sub-make with function calls
This commit is contained in:
parent
cfe83bca20
commit
f98369a503
1 changed files with 22 additions and 14 deletions
36
Arduino.mk
36
Arduino.mk
|
@ -1406,40 +1406,48 @@ $(TARGET_ELF): $(LOCAL_OBJS) $(CORE_LIB) $(OTHER_OBJS)
|
||||||
$(CORE_LIB): $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)
|
$(CORE_LIB): $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)
|
||||||
$(AR) rcs $@ $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)
|
$(AR) rcs $@ $(CORE_OBJS) $(LIB_OBJS) $(PLATFORM_LIB_OBJS) $(USER_LIB_OBJS)
|
||||||
|
|
||||||
error_on_caterina:
|
error_on_caterina: $(call error_on_caterina)
|
||||||
$(ERROR_ON_CATERINA)
|
|
||||||
|
|
||||||
|
error_on_caterina = $(ERROR_ON_CATERINA)
|
||||||
|
|
||||||
# Use submake so we can guarantee the reset happens
|
# Use submake so we can guarantee the reset happens
|
||||||
# before the upload, even with make -j
|
# before the upload, even with make -j
|
||||||
upload: $(TARGET_HEX) verify_size
|
upload: $(TARGET_HEX) verify_size
|
||||||
$(MAKE) reset
|
$(call reset)
|
||||||
$(MAKE) do_upload
|
$(call do_upload)
|
||||||
|
|
||||||
raw_upload: $(TARGET_HEX) verify_size
|
raw_upload: $(TARGET_HEX) verify_size
|
||||||
$(MAKE) error_on_caterina
|
$(call error_on_caterina)
|
||||||
$(MAKE) do_upload
|
$(call do_upload)
|
||||||
|
|
||||||
do_upload:
|
do_upload:
|
||||||
$(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \
|
$(call do_upload)
|
||||||
|
|
||||||
|
do_upload = $(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \
|
||||||
$(AVRDUDE_UPLOAD_HEX)
|
$(AVRDUDE_UPLOAD_HEX)
|
||||||
|
|
||||||
do_eeprom: $(TARGET_EEP) $(TARGET_HEX)
|
do_eeprom:
|
||||||
$(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \
|
$(call do_eeprom)
|
||||||
|
|
||||||
|
do_eeprom = $(TARGET_EEP) $(TARGET_HEX) \
|
||||||
|
$(AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \
|
||||||
$(AVRDUDE_UPLOAD_EEP)
|
$(AVRDUDE_UPLOAD_EEP)
|
||||||
|
|
||||||
eeprom: $(TARGET_HEX) verify_size
|
eeprom: $(TARGET_HEX) verify_size
|
||||||
$(MAKE) reset
|
$(call reset)
|
||||||
$(MAKE) do_eeprom
|
$(call do_eeprom)
|
||||||
|
|
||||||
raw_eeprom: $(TARGET_HEX) verify_size
|
raw_eeprom: $(TARGET_HEX) verify_size
|
||||||
$(MAKE) error_on_caterina
|
$(call error_on_caterina)
|
||||||
$(MAKE) do_eeprom
|
$(call do_eeprom)
|
||||||
|
|
||||||
reset:
|
reset:
|
||||||
$(call arduino_output,Resetting Arduino...)
|
$(call reset)
|
||||||
|
|
||||||
|
reset = $(call arduino_output,Resetting Arduino...) \
|
||||||
$(RESET_CMD)
|
$(RESET_CMD)
|
||||||
|
|
||||||
|
|
||||||
# stty on MacOS likes -F, but on Debian it likes -f redirecting
|
# stty on MacOS likes -F, but on Debian it likes -f redirecting
|
||||||
# stdin/out appears to work but generates a spurious error on MacOS at
|
# stdin/out appears to work but generates a spurious error on MacOS at
|
||||||
# least. Perhaps it would be better to just do it in perl ?
|
# least. Perhaps it would be better to just do it in perl ?
|
||||||
|
|
Loading…
Reference in a new issue