Simplify build system mandatory parameter/variable sanity checks.

pull/1469/head
Dean Camera 13 years ago
parent 276eb35d68
commit 29874f6db7

@ -44,12 +44,8 @@ AVRDUDE_PORT ?= usb
AVRDUDE_FLAGS ?= -U flash:w:$(TARGET).hex AVRDUDE_FLAGS ?= -U flash:w:$(TARGET).hex
# Sanity check the user MCU and TARGET makefile options # Sanity check the user MCU and TARGET makefile options
ifeq ($(MCU),) MCU ?= $(error Makefile MCU value not set.)
$(error Makefile MCU value not set.) TARGET ?= $(error Makefile TARGET value not set.)
endif
ifeq ($(TARGET),)
$(error Makefile TARGET value not set.)
endif
program: $(TARGET).hex program: $(TARGET).hex
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" with settings \"$(AVRDUDE_FLAGS)\" using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\" @echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" with settings \"$(AVRDUDE_FLAGS)\" using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"

@ -64,24 +64,12 @@ MSG_OBJCPY_CMD = ' [OBJCPY] :'
MSG_OBJDMP_CMD = ' [OBJDMP] :' MSG_OBJDMP_CMD = ' [OBJDMP] :'
# Sanity check the user MCU, TARGET, ARCH, SRC, F_USB and LUFA_PATH makefile options # Sanity check the user MCU, TARGET, ARCH, SRC, F_USB and LUFA_PATH makefile options
ifeq ($(TARGET),) MCU ?= $(error Makefile MCU value not set.)
$(error Makefile TARGET value not set.) TARGET ?= $(error Makefile TARGET value not set.)
endif ARCH ?= $(error Makefile ARCH value not set.)
ifeq ($(ARCH),) SRC ?= $(error Makefile SRC value not set.)
$(error Makefile ARCH value not set.) F_USB ?= $(error Makefile F_USB value not set.)
endif LUFA_PATH ?= $(error Makefile LUFA_PATH value not set.)
ifeq ($(MCU),)
$(error Makefile MCU value not set.)
endif
ifeq ($(SRC),)
$(error Makefile SRC value not set.)
endif
ifeq ($(F_USB),)
$(error Makefile F_USB value not set.)
endif
ifeq ($(LUFA_PATH),)
$(error Makefile LUFA_PATH value not set.)
endif
# Default values of user-supplied variables # Default values of user-supplied variables
BOARD ?= NONE BOARD ?= NONE

@ -37,15 +37,13 @@ LUFA_BUILD_OPTIONAL_VARS +=
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Output Messages # Output Messages
MSG_COPY_CMD = ' [CP] :'
MSG_REMOVE_CMD = ' [RM] :'
MSG_DFU_CMD = ' [DFU] :' MSG_DFU_CMD = ' [DFU] :'
# Sanity check the user MCU and TARGET makefile options # Sanity check the user MCU and TARGET makefile options
ifeq ($(MCU),) MCU ?= $(error Makefile MCU value not set.)
$(error Makefile MCU value not set.) TARGET ?= $(error Makefile TARGET value not set.)
endif
ifeq ($(TARGET),)
$(error Makefile TARGET value not set.)
endif
flip: $(TARGET).hex flip: $(TARGET).hex
@echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$(TARGET).hex\" @echo $(MSG_DFU_CMD) Programming FLASH with batchisp using \"$(TARGET).hex\"
@ -54,11 +52,13 @@ flip: $(TARGET).hex
batchisp -hardware usb -device $(MCU) -operation start reset 0 batchisp -hardware usb -device $(MCU) -operation start reset 0
flip-ee: $(TARGET).eep flip-ee: $(TARGET).eep
@echo $(MSG_DFU_CMD) Copying EEP file to temporary file \"$(TARGET)eep.hex\"
cp $(TARGET).eep $(TARGET)eep.hex cp $(TARGET).eep $(TARGET)eep.hex
@echo $(MSG_DFU_CMD) Programming EEPROM with batchisp using \"$(TARGET).eep\" @echo $(MSG_DFU_CMD) Programming EEPROM with batchisp using \"$(TARGET).eep\"
batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0 batchisp -hardware usb -device $(MCU) -operation start reset 0
@echo $(MSG_DFU_CMD) Removing temporary file \"$(TARGET)eep.hex\"
rm $(TARGET)eep.hex rm $(TARGET)eep.hex
dfu: $(TARGET).hex dfu: $(TARGET).hex

@ -36,12 +36,8 @@ LUFA_BUILD_OPTIONAL_VARS +=
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Sanity check the user LUFA_PATH and ARCH makefile options # Sanity check the user LUFA_PATH and ARCH makefile options
ifeq ($(LUFA_PATH),) ARCH ?= $(error Makefile ARCH value not set.)
$(error Makefile LUFA_PATH value not set.) LUFA_PATH ?= $(error Makefile LUFA_PATH value not set.)
endif
ifeq ($(ARCH),)
$(error Makefile ARCH value not set.)
endif
# Allow LUFA_ROOT_PATH to be overridden elsewhere to support legacy LUFA makefiles # Allow LUFA_ROOT_PATH to be overridden elsewhere to support legacy LUFA makefiles
LUFA_ROOT_PATH ?= $(LUFA_PATH) LUFA_ROOT_PATH ?= $(LUFA_PATH)

Loading…
Cancel
Save