Skip to content
Snippets Groups Projects
Commit 88425d7d authored by Dean Camera's avatar Dean Camera
Browse files

Add .PHONY targets in all build system modules. Alter BUILD module so that the...

Add .PHONY targets in all build system modules. Alter BUILD module so that the existence of source files are checked before the build is started.
parent 9f7f5953
No related branches found
No related tags found
No related merge requests found
...@@ -60,3 +60,6 @@ program: $(TARGET).hex $(MAKEFILE_LIST) ...@@ -60,3 +60,6 @@ program: $(TARGET).hex $(MAKEFILE_LIST)
program-ee: $(TARGET).eep $(MAKEFILE_LIST) program-ee: $(TARGET).eep $(MAKEFILE_LIST)
@echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" with settings \"$(AVRDUDE_EEP_FLAGS)\" using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\" @echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" with settings \"$(AVRDUDE_EEP_FLAGS)\" using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
avrdude -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) $(AVRDUDE_EEP_FLAGS) avrdude -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) $(AVRDUDE_EEP_FLAGS)
# Phony build targets for this module
.PHONY: program program-ee
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
LUFA_BUILD_MODULES += BUILD LUFA_BUILD_MODULES += BUILD
LUFA_BUILD_TARGETS += size checksource all elf hex lss gcc_version clean LUFA_BUILD_TARGETS += size all elf hex lss clean
LUFA_BUILD_MANDATORY_VARS += TARGET ARCH MCU SRC F_USB LUFA_PATH LUFA_BUILD_MANDATORY_VARS += TARGET ARCH MCU SRC F_USB LUFA_PATH
LUFA_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_FLAGS CPP_FLAGS ASM_FLAGS CC_FLAGS LD_FLAGS LUFA_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_FLAGS CPP_FLAGS ASM_FLAGS CC_FLAGS LD_FLAGS
...@@ -20,13 +20,11 @@ LUFA_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_ ...@@ -20,13 +20,11 @@ LUFA_BUILD_OPTIONAL_VARS += BOARD OPTIMIZATION C_STANDARD CPP_STANDARD F_CPU C_
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# TARGETS: # TARGETS:
# #
# size - List application size # size - List built application size
# checksource - Check existance of listed input source files
# all - Build application and list size # all - Build application and list size
# elf - Build application ELF debug object file # elf - Build application ELF debug object file
# hex - Build application HEX object files # hex - Build application HEX object files
# lss - Build application LSS assembly listing file # lss - Build application LSS assembly listing file
# gcc_version - Print version of GCC used
# clean - Remove output files # clean - Remove output files
# #
# MANDATORY PARAMETERS: # MANDATORY PARAMETERS:
...@@ -155,12 +153,11 @@ end: ...@@ -155,12 +153,11 @@ end:
gcc_version: gcc_version:
@$(CROSS)gcc --version @$(CROSS)gcc --version
checksource: check_source:
@for f in $(SRC) $(CPPSRC) $(ASRC); do \ @for f in $(SRC); do \
if [ -f $$f ]; then \ if [ ! -f $$f ]; then \
echo "Found Source File: $$f" ; \ echo "Error: Source file not found: $$f"; \
else \ exit 1; \
echo "Source File Not Found: $$f" ; \
fi; \ fi; \
done done
...@@ -170,8 +167,15 @@ size: ...@@ -170,8 +167,15 @@ size:
$(CROSS)size $(SIZE_MCU_FLAG) $(SIZE_FORMAT_FLAG) $(TARGET).elf ; 2>/dev/null; \ $(CROSS)size $(SIZE_MCU_FLAG) $(SIZE_FORMAT_FLAG) $(TARGET).elf ; 2>/dev/null; \
fi fi
.PHONY: begin gcc_version elf hex lss size end clean:
all: begin gcc_version elf hex lss size end @echo $(MSG_REMOVE_CMD) Removing object files \"$(strip $(notdir $(OBJECT_FILES)))\"
rm -f $(OBJECT_FILES)
@echo $(MSG_REMOVE_CMD) Removing dependency files \"$(strip $(notdir $(DEPENDENCY_FILES)))\"
rm -f $(DEPENDENCY_FILES)
@echo $(MSG_REMOVE_CMD) Removing output files \"$(TARGET).elf $(TARGET).hex $(TARGET).eep $(TARGET).map $(TARGET).lss\"
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).eep $(TARGET).map $(TARGET).lss
all: begin check_source gcc_version elf hex lss size end
elf: $(TARGET).elf elf: $(TARGET).elf
hex: $(TARGET).hex $(TARGET).eep hex: $(TARGET).hex $(TARGET).eep
...@@ -206,13 +210,8 @@ lss: $(TARGET).lss ...@@ -206,13 +210,8 @@ lss: $(TARGET).lss
@echo $(MSG_OBJDMP_CMD) Extracting LSS file data from \"$<\" @echo $(MSG_OBJDMP_CMD) Extracting LSS file data from \"$<\"
$(CROSS)objdump -h -S -z $< > $@ $(CROSS)objdump -h -S -z $< > $@
clean:
@echo $(MSG_REMOVE_CMD) Removing object files \"$(strip $(notdir $(OBJECT_FILES)))\"
rm -f $(OBJECT_FILES)
@echo $(MSG_REMOVE_CMD) Removing dependency files \"$(strip $(notdir $(DEPENDENCY_FILES)))\"
rm -f $(DEPENDENCY_FILES)
@echo $(MSG_REMOVE_CMD) Removing output files \"$(TARGET).elf $(TARGET).hex $(TARGET).eep $(TARGET).map $(TARGET).lss\"
rm -f $(TARGET).elf $(TARGET).hex $(TARGET).eep $(TARGET).map $(TARGET).lss
# Include build dependency files # Include build dependency files
-include $(DEPENDENCY_FILES) -include $(DEPENDENCY_FILES)
# Phony build targets for this module
.PHONY: begin end gcc_version check_source size elf hex lss clean
\ No newline at end of file
...@@ -100,3 +100,6 @@ list_mandatory: ...@@ -100,3 +100,6 @@ list_mandatory:
list_optional: list_optional:
@echo Optional Variables for Included Modules: $(SORTED_LUFA_OPTIONAL_VARS) @echo Optional Variables for Included Modules: $(SORTED_LUFA_OPTIONAL_VARS)
# Phony build targets for this module
.PHONY: help list_modules list_targets list_mandatory list_optional
\ No newline at end of file
...@@ -71,3 +71,6 @@ dfu-ee: $(TARGET).eep $(MAKEFILE_LIST) ...@@ -71,3 +71,6 @@ dfu-ee: $(TARGET).eep $(MAKEFILE_LIST)
@echo $(MSG_DFU_CMD) Programming EEPROM with dfu-programmer using \"$(TARGET).eep\" @echo $(MSG_DFU_CMD) Programming EEPROM with dfu-programmer using \"$(TARGET).eep\"
dfu-programmer $(MCU) eeprom-flash $(TARGET).eep dfu-programmer $(MCU) eeprom-flash $(TARGET).eep
dfu-programmer $(MCU) reset dfu-programmer $(MCU) reset
# Phony build targets for this module
.PHONY: flip flip-ee dfu dfu-ee
\ No newline at end of file
...@@ -50,10 +50,15 @@ MSG_DOXYGEN_CMD := ' [DOXYGEN] :' ...@@ -50,10 +50,15 @@ MSG_DOXYGEN_CMD := ' [DOXYGEN] :'
BASE_DOXYGEN_CMD = ( cat Doxygen.conf $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen - BASE_DOXYGEN_CMD = ( cat Doxygen.conf $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen -
ifeq ($(DOXYGEN_FAIL_ON_WARNING), Y) ifeq ($(DOXYGEN_FAIL_ON_WARNING), Y)
DOXYGEN_CMD = if ( $(BASE_DOXYGEN_CMD) 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then exit 1; fi; DOXYGEN_CMD = if ( $(BASE_DOXYGEN_CMD) 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then exit 1; fi;
else else ifeq ($(DOXYGEN_FAIL_ON_WARNING), N)
DOXYGEN_CMD = $(BASE_DOXYGEN_CMD) DOXYGEN_CMD = $(BASE_DOXYGEN_CMD)
else
$(error DOXYGEN_FAIL_ON_WARNING must be Y or N.)
endif endif
doxygen: doxygen:
@echo $(MSG_DOXYGEN_CMD) Configuration file \"$(DOXYGEN_CONF)\" with parameters \"$(DOXYGEN_OVERRIDE_PARAMS)\" @echo $(MSG_DOXYGEN_CMD) Configuration file \"$(DOXYGEN_CONF)\" with parameters \"$(DOXYGEN_OVERRIDE_PARAMS)\"
$(DOXYGEN_CMD) $(DOXYGEN_CMD)
# Phony build targets for this module
.PHONY: doxygen
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment