aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-06-02 12:00:51 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-06-02 12:00:51 +0000
commit29874f6db7db635e3cb6ee39a595334fc1c6514a (patch)
tree1609dc340b5786b3562d8f7f84db9f882575d9a1 /LUFA
parent276eb35d68f6fc9b3c252c17327c8d18ff7017e3 (diff)
downloadlufa-29874f6db7db635e3cb6ee39a595334fc1c6514a.tar.gz
lufa-29874f6db7db635e3cb6ee39a595334fc1c6514a.tar.bz2
lufa-29874f6db7db635e3cb6ee39a595334fc1c6514a.zip
Simplify build system mandatory parameter/variable sanity checks.
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/Build/lufa.avrdude.in16
-rw-r--r--LUFA/Build/lufa.build.in54
-rw-r--r--LUFA/Build/lufa.dfu.in14
-rw-r--r--LUFA/Build/lufa.doxygen.in2
-rw-r--r--LUFA/Build/lufa.sources.in8
5 files changed, 37 insertions, 57 deletions
diff --git a/LUFA/Build/lufa.avrdude.in b/LUFA/Build/lufa.avrdude.in
index e2b8e5730..fdc5bc1d7 100644
--- a/LUFA/Build/lufa.avrdude.in
+++ b/LUFA/Build/lufa.avrdude.in
@@ -36,20 +36,16 @@ LUFA_BUILD_OPTIONAL_VARS += AVRDUDE_PROGRAMMER AVRDUDE_PORT AVRDUDE_FLAGS
# -----------------------------------------------------------------------------
# Output Messages
-MSG_AVRDUDE_CMD = ' [AVRDUDE] :'
+MSG_AVRDUDE_CMD = ' [AVRDUDE] :'
# Default values of user-supplied variables
-AVRDUDE_PROGRAMMER ?= jtagicemkii
-AVRDUDE_PORT ?= usb
-AVRDUDE_FLAGS ?= -U flash:w:$(TARGET).hex
+AVRDUDE_PROGRAMMER ?= jtagicemkii
+AVRDUDE_PORT ?= usb
+AVRDUDE_FLAGS ?= -U flash:w:$(TARGET).hex
# Sanity check the user MCU and TARGET makefile options
-ifeq ($(MCU),)
- $(error Makefile MCU value not set.)
-endif
-ifeq ($(TARGET),)
- $(error Makefile TARGET value not set.)
-endif
+MCU ?= $(error Makefile MCU value not set.)
+TARGET ?= $(error Makefile TARGET value not set.)
program: $(TARGET).hex
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" with settings \"$(AVRDUDE_FLAGS)\" using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
diff --git a/LUFA/Build/lufa.build.in b/LUFA/Build/lufa.build.in
index 1cdb75a6d..6c9133f83 100644
--- a/LUFA/Build/lufa.build.in
+++ b/LUFA/Build/lufa.build.in
@@ -56,43 +56,31 @@ LUFA_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_
# Output Messages
MSG_BUILD_BEGIN = Begin compilation of project \"$(TARGET)\"...
MSG_BUILD_END = Finished building project \"$(TARGET)\"...
-MSG_COMPILE_CMD = ' [CC] :'
-MSG_REMOVE_CMD = ' [RM] :'
-MSG_LINKER_CMD = ' [LNK] :'
-MSG_SIZE_CMD = ' [SIZE] :'
-MSG_OBJCPY_CMD = ' [OBJCPY] :'
-MSG_OBJDMP_CMD = ' [OBJDMP] :'
+MSG_COMPILE_CMD = ' [CC] :'
+MSG_REMOVE_CMD = ' [RM] :'
+MSG_LINKER_CMD = ' [LNK] :'
+MSG_SIZE_CMD = ' [SIZE] :'
+MSG_OBJCPY_CMD = ' [OBJCPY] :'
+MSG_OBJDMP_CMD = ' [OBJDMP] :'
# Sanity check the user MCU, TARGET, ARCH, SRC, F_USB and LUFA_PATH makefile options
-ifeq ($(TARGET),)
- $(error Makefile TARGET value not set.)
-endif
-ifeq ($(ARCH),)
- $(error Makefile ARCH value not set.)
-endif
-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
+MCU ?= $(error Makefile MCU value not set.)
+TARGET ?= $(error Makefile TARGET value not set.)
+ARCH ?= $(error Makefile ARCH value not set.)
+SRC ?= $(error Makefile SRC value not set.)
+F_USB ?= $(error Makefile F_USB value not set.)
+LUFA_PATH ?= $(error Makefile LUFA_PATH value not set.)
# Default values of user-supplied variables
-BOARD ?= NONE
-OPTIMIZATION ?= s
-F_CPU ?=
-C_STANDARD ?= gnu99
-CPP_STANDARD ?= gnu++98
-C_FLAGS ?=
-CPP_FLAGS ?=
-ASM_FLAGS ?=
-CC_FLAGS ?=
+BOARD ?= NONE
+OPTIMIZATION ?= s
+F_CPU ?=
+C_STANDARD ?= gnu99
+CPP_STANDARD ?= gnu++98
+C_FLAGS ?=
+CPP_FLAGS ?=
+ASM_FLAGS ?=
+CC_FLAGS ?=
# Convert input source file list to differentiate them by type
C_SOURCE = $(filter %.c, $(SRC))
diff --git a/LUFA/Build/lufa.dfu.in b/LUFA/Build/lufa.dfu.in
index ac5edeadc..8c478db84 100644
--- a/LUFA/Build/lufa.dfu.in
+++ b/LUFA/Build/lufa.dfu.in
@@ -37,15 +37,13 @@ LUFA_BUILD_OPTIONAL_VARS +=
# -----------------------------------------------------------------------------
# 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
-ifeq ($(MCU),)
- $(error Makefile MCU value not set.)
-endif
-ifeq ($(TARGET),)
- $(error Makefile TARGET value not set.)
-endif
+MCU ?= $(error Makefile MCU value not set.)
+TARGET ?= $(error Makefile TARGET value not set.)
flip: $(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
flip-ee: $(TARGET).eep
+ @echo $(MSG_DFU_CMD) Copying EEP file to temporary file \"$(TARGET)eep.hex\"
cp $(TARGET).eep $(TARGET)eep.hex
@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 loadbuffer $(TARGET)eep.hex program
batchisp -hardware usb -device $(MCU) -operation start reset 0
+ @echo $(MSG_DFU_CMD) Removing temporary file \"$(TARGET)eep.hex\"
rm $(TARGET)eep.hex
dfu: $(TARGET).hex
diff --git a/LUFA/Build/lufa.doxygen.in b/LUFA/Build/lufa.doxygen.in
index 26cd40d7e..039967cad 100644
--- a/LUFA/Build/lufa.doxygen.in
+++ b/LUFA/Build/lufa.doxygen.in
@@ -36,7 +36,7 @@ LUFA_BUILD_OPTIONAL_VARS += DOXYGEN_CONF DOXYGEN_FAIL_ON_WARNING DOXYGEN_OVERRI
# -----------------------------------------------------------------------------
# Output Messages
-MSG_DOXYGEN_CMD = ' [DOXYGEN] :'
+MSG_DOXYGEN_CMD = ' [DOXYGEN] :'
# Default values of user-supplied variables
DOXYGEN_CONF ?= Doxygen.conf
diff --git a/LUFA/Build/lufa.sources.in b/LUFA/Build/lufa.sources.in
index 37263b602..a2e02e979 100644
--- a/LUFA/Build/lufa.sources.in
+++ b/LUFA/Build/lufa.sources.in
@@ -36,12 +36,8 @@ LUFA_BUILD_OPTIONAL_VARS +=
# -----------------------------------------------------------------------------
# Sanity check the user LUFA_PATH and ARCH makefile options
-ifeq ($(LUFA_PATH),)
- $(error Makefile LUFA_PATH value not set.)
-endif
-ifeq ($(ARCH),)
- $(error Makefile ARCH value not set.)
-endif
+ARCH ?= $(error Makefile ARCH value not set.)
+LUFA_PATH ?= $(error Makefile LUFA_PATH value not set.)
# Allow LUFA_ROOT_PATH to be overridden elsewhere to support legacy LUFA makefiles
LUFA_ROOT_PATH ?= $(LUFA_PATH)