diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-08-15 16:40:25 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-08-15 16:40:25 +0000 |
commit | 00ab25d3213e62538147308a9235437d3f500fb4 (patch) | |
tree | a85f3d81b15dd5c930cb56370e2c82b2af134eda /LUFA | |
parent | 1f1bd69b85fe6946f4e7705abbcd2cf84c296017 (diff) | |
download | lufa-00ab25d3213e62538147308a9235437d3f500fb4.tar.gz lufa-00ab25d3213e62538147308a9235437d3f500fb4.tar.bz2 lufa-00ab25d3213e62538147308a9235437d3f500fb4.zip |
Update the BUILD build system module to early abort and display an error if needed before trying to create the OBJDIR output object file directory.
Diffstat (limited to 'LUFA')
-rw-r--r-- | LUFA/Build/lufa_build.mk | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/LUFA/Build/lufa_build.mk b/LUFA/Build/lufa_build.mk index 175057022..211a8f9f5 100644 --- a/LUFA/Build/lufa_build.mk +++ b/LUFA/Build/lufa_build.mk @@ -152,15 +152,20 @@ endif # Convert input source filenames into a list of required output object files OBJECT_FILES += $(addsuffix .o, $(basename $(SRC))) + +# Check if an output object file directory was specified instead of the input file location ifneq ($(OBJDIR),.) - $(shell mkdir $(OBJDIR) 2> /dev/null) - VPATH += $(dir $(SRC)) + # Prefix all the object filenames with the output object file directory path OBJECT_FILES := $(addprefix $(patsubst %/,%,$(OBJDIR))/, $(notdir $(OBJECT_FILES))) # Check if any object file (without path) appears more than once in the object file list ifneq ($(words $(sort $(OBJECT_FILES))), $(words $(OBJECT_FILES))) $(error Cannot build with OBJDIR parameter set - one or more object file name is not unique) endif + + # Create the output object file directory if it does not exist and add it to the virtual path list + $(shell mkdir $(OBJDIR) 2> /dev/null) + VPATH += $(dir $(SRC)) endif # Create a list of dependency files from the list of object files |