Simplify build system mandatory parameter/variable sanity checks.

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

@ -36,20 +36,16 @@ LUFA_BUILD_OPTIONAL_VARS += AVRDUDE_PROGRAMMER AVRDUDE_PORT AVRDUDE_FLAGS
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Output Messages # Output Messages
MSG_AVRDUDE_CMD = ' [AVRDUDE] :' MSG_AVRDUDE_CMD = ' [AVRDUDE] :'
# Default values of user-supplied variables # Default values of user-supplied variables
AVRDUDE_PROGRAMMER ?= jtagicemkii AVRDUDE_PROGRAMMER ?= jtagicemkii
AVRDUDE_PORT ?= usb 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)\"

@ -56,43 +56,31 @@ LUFA_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_
# Output Messages # Output Messages
MSG_BUILD_BEGIN = Begin compilation of project \"$(TARGET)\"... MSG_BUILD_BEGIN = Begin compilation of project \"$(TARGET)\"...
MSG_BUILD_END = Finished building project \"$(TARGET)\"... MSG_BUILD_END = Finished building project \"$(TARGET)\"...
MSG_COMPILE_CMD = ' [CC] :' MSG_COMPILE_CMD = ' [CC] :'
MSG_REMOVE_CMD = ' [RM] :' MSG_REMOVE_CMD = ' [RM] :'
MSG_LINKER_CMD = ' [LNK] :' MSG_LINKER_CMD = ' [LNK] :'
MSG_SIZE_CMD = ' [SIZE] :' MSG_SIZE_CMD = ' [SIZE] :'
MSG_OBJCPY_CMD = ' [OBJCPY] :' 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
OPTIMIZATION ?= s OPTIMIZATION ?= s
F_CPU ?= F_CPU ?=
C_STANDARD ?= gnu99 C_STANDARD ?= gnu99
CPP_STANDARD ?= gnu++98 CPP_STANDARD ?= gnu++98
C_FLAGS ?= C_FLAGS ?=
CPP_FLAGS ?= CPP_FLAGS ?=
ASM_FLAGS ?= ASM_FLAGS ?=
CC_FLAGS ?= CC_FLAGS ?=
# Convert input source file list to differentiate them by type # Convert input source file list to differentiate them by type
C_SOURCE = $(filter %.c, $(SRC)) C_SOURCE = $(filter %.c, $(SRC))

@ -37,15 +37,13 @@ LUFA_BUILD_OPTIONAL_VARS +=
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Output Messages # Output Messages
MSG_DFU_CMD = ' [DFU] :' MSG_COPY_CMD = ' [CP] :'
MSG_REMOVE_CMD = ' [RM] :'
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,7 +36,7 @@ LUFA_BUILD_OPTIONAL_VARS += DOXYGEN_CONF DOXYGEN_FAIL_ON_WARNING DOXYGEN_OVERRI
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Output Messages # Output Messages
MSG_DOXYGEN_CMD = ' [DOXYGEN] :' MSG_DOXYGEN_CMD = ' [DOXYGEN] :'
# Default values of user-supplied variables # Default values of user-supplied variables
DOXYGEN_CONF ?= Doxygen.conf DOXYGEN_CONF ?= Doxygen.conf

@ -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