projects
/
pub
/
lufa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fe3a5c2
)
Add OBJDIR optional build variable to the BULD build system module, to allow the...
author
Dean Camera
<dean@fourwalledcubicle.com>
Sun, 10 Jun 2012 19:39:40 +0000
(19:39 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Sun, 10 Jun 2012 19:39:40 +0000
(19:39 +0000)
Bootloaders/makefile
patch
|
blob
|
blame
|
history
Demos/Device/ClassDriver/makefile
patch
|
blob
|
blame
|
history
Demos/Device/Incomplete/TestAndMeasurement/makefile
patch
|
blob
|
blame
|
history
Demos/Device/LowLevel/makefile
patch
|
blob
|
blame
|
history
Demos/DualRole/ClassDriver/makefile
patch
|
blob
|
blame
|
history
Demos/Host/ClassDriver/makefile
patch
|
blob
|
blame
|
history
Demos/Host/LowLevel/makefile
patch
|
blob
|
blame
|
history
LUFA/Build/lufa.build.in
patch
|
blob
|
blame
|
history
LUFA/DoxygenPages/BuildSystem.txt
patch
|
blob
|
blame
|
history
Projects/makefile
patch
|
blob
|
blame
|
history
diff --git
a/Bootloaders/makefile
b/Bootloaders/makefile
index
0c183e7
..
bffee42
100644
(file)
--- a/
Bootloaders/makefile
+++ b/
Bootloaders/makefile
@@
-23,7
+23,9
@@
ifeq ($(MAKELEVEL), 10)
endif
all:
endif
all:
+ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
+endif
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
diff --git
a/Demos/Device/ClassDriver/makefile
b/Demos/Device/ClassDriver/makefile
index
99e7c24
..
0e1dfae
100644
(file)
--- a/
Demos/Device/ClassDriver/makefile
+++ b/
Demos/Device/ClassDriver/makefile
@@
-23,7
+23,9
@@
ifeq ($(MAKELEVEL), 10)
endif
all:
endif
all:
+ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
+endif
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
diff --git
a/Demos/Device/Incomplete/TestAndMeasurement/makefile
b/Demos/Device/Incomplete/TestAndMeasurement/makefile
index
1495062
..
cbd4319
100644
(file)
--- a/
Demos/Device/Incomplete/TestAndMeasurement/makefile
+++ b/
Demos/Device/Incomplete/TestAndMeasurement/makefile
@@
-19,7
+19,7
@@
TARGET = TestAndMeasurement
SRC = $(TARGET).c Descriptors.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
LUFA_PATH = ../../../../LUFA/
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/
SRC = $(TARGET).c Descriptors.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
LUFA_PATH = ../../../../LUFA/
CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/
-LD_FLAGS =
+LD_FLAGS =
# Default target
all:
# Default target
all:
diff --git
a/Demos/Device/LowLevel/makefile
b/Demos/Device/LowLevel/makefile
index
99e7c24
..
0e1dfae
100644
(file)
--- a/
Demos/Device/LowLevel/makefile
+++ b/
Demos/Device/LowLevel/makefile
@@
-23,7
+23,9
@@
ifeq ($(MAKELEVEL), 10)
endif
all:
endif
all:
+ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
+endif
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
diff --git
a/Demos/DualRole/ClassDriver/makefile
b/Demos/DualRole/ClassDriver/makefile
index
a6ccbf1
..
dc41c9b
100644
(file)
--- a/
Demos/DualRole/ClassDriver/makefile
+++ b/
Demos/DualRole/ClassDriver/makefile
@@
-23,7
+23,9
@@
ifeq ($(MAKELEVEL), 10)
endif
all:
endif
all:
+ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
+endif
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
diff --git
a/Demos/Host/ClassDriver/makefile
b/Demos/Host/ClassDriver/makefile
index
776fa18
..
128a22f
100644
(file)
--- a/
Demos/Host/ClassDriver/makefile
+++ b/
Demos/Host/ClassDriver/makefile
@@
-23,7
+23,9
@@
ifeq ($(MAKELEVEL), 10)
endif
all:
endif
all:
+ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
+endif
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
diff --git
a/Demos/Host/LowLevel/makefile
b/Demos/Host/LowLevel/makefile
index
776fa18
..
128a22f
100644
(file)
--- a/
Demos/Host/LowLevel/makefile
+++ b/
Demos/Host/LowLevel/makefile
@@
-23,7
+23,9
@@
ifeq ($(MAKELEVEL), 10)
endif
all:
endif
all:
+ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
+endif
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
diff --git
a/LUFA/Build/lufa.build.in
b/LUFA/Build/lufa.build.in
index
1c5df4f
..
6e348d9
100644
(file)
--- a/
LUFA/Build/lufa.build.in
+++ b/
LUFA/Build/lufa.build.in
@@
-9,7
+9,7
@@
LUFA_BUILD_MODULES += BUILD
LUFA_BUILD_TARGETS += size symbol-sizes all elf hex lss clean
LUFA_BUILD_MANDATORY_VARS += TARGET ARCH MCU SRC F_USB LUFA_PATH
LUFA_BUILD_MODULES += BUILD
LUFA_BUILD_TARGETS += size symbol-sizes all elf hex lss clean
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
OBJDIR
LUFA_BUILD_PROVIDED_VARS +=
LUFA_BUILD_PROVIDED_MACROS +=
LUFA_BUILD_PROVIDED_VARS +=
LUFA_BUILD_PROVIDED_MACROS +=
@@
-54,6
+54,9
@@
LUFA_BUILD_PROVIDED_MACROS +=
# CC_FLAGS - Common flags to pass to the C/C++ compiler and
# assembler
# LD_FLAGS - Flags to pass to the linker
# CC_FLAGS - Common flags to pass to the C/C++ compiler and
# assembler
# LD_FLAGS - Flags to pass to the linker
+# OBJDIR - Directory for the output object and dependency
+# files; if equal to ".", the output files will
+# be generated in the same folder as the sources
#
# PROVIDED VARIABLES:
#
#
# PROVIDED VARIABLES:
#
@@
-79,6
+82,7
@@
C_FLAGS ?=
CPP_FLAGS ?=
ASM_FLAGS ?=
CC_FLAGS ?=
CPP_FLAGS ?=
ASM_FLAGS ?=
CC_FLAGS ?=
+OBJDIR ?= .
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
# Sanity check user supplied values
$(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
@@
-91,6
+95,7
@@
$(call ERROR_IF_EMPTY, BOARD)
$(call ERROR_IF_EMPTY, OPTIMIZATION)
$(call ERROR_IF_EMPTY, C_STANDARD)
$(call ERROR_IF_EMPTY, CPP_STANDARD)
$(call ERROR_IF_EMPTY, OPTIMIZATION)
$(call ERROR_IF_EMPTY, C_STANDARD)
$(call ERROR_IF_EMPTY, CPP_STANDARD)
+$(call ERROR_IF_EMPTY, OBJDIR)
# Determine the utility prefix to use for the selected architecture
ifeq ($(ARCH), AVR8)
# Determine the utility prefix to use for the selected architecture
ifeq ($(ARCH), AVR8)
@@
-129,7
+134,14
@@
ifneq ($(UNKNOWN_SOURCE),)
endif
# Convert input source filenames into a list of required output object files
endif
# Convert input source filenames into a list of required output object files
-OBJECT_FILES = $(filter %.o, $(C_SOURCE:%.c=%.o) $(CPP_SOURCE:%.cpp=%.o) $(ASM_SOURCE:%.S=%.o))
+OBJECT_FILES = $(filter %.o, $(C_SOURCE:%.c=%.o) $(CPP_SOURCE:%.cpp=%.o) $(ASM_SOURCE:%.S=%.o))
+ifneq ($(OBJDIR),.)
+ $(shell mkdir $(OBJDIR) 2>&1 | /dev/null)
+ VPATH += $(dir $(SRC))
+
+ OBJECT_FILES := $(addprefix $(patsubst %/,%,$(OBJDIR))/, $(notdir $(OBJECT_FILES)))
+endif
+
DEPENDENCY_FILES = $(OBJECT_FILES:%.o=%.d)
# Create a list of common flags to pass to the compiler/linker/assembler
DEPENDENCY_FILES = $(OBJECT_FILES:%.o=%.d)
# Create a list of common flags to pass to the compiler/linker/assembler
@@
-211,15
+223,15
@@
elf: $(TARGET).elf
hex: $(TARGET).hex $(TARGET).eep
lss: $(TARGET).lss
hex: $(TARGET).hex $(TARGET).eep
lss: $(TARGET).lss
-%.o: %.c $(MAKEFILE_LIST)
+
$(OBJDIR)/
%.o: %.c $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Compiling C file \"$<\"
$(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_C_FLAGS) $(CC_FLAGS) $(C_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
@echo $(MSG_COMPILE_CMD) Compiling C file \"$<\"
$(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_C_FLAGS) $(CC_FLAGS) $(C_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
-%.o: %.cpp $(MAKEFILE_LIST)
+
$(OBJDIR)/
%.o: %.cpp $(MAKEFILE_LIST)
@echo $(MSG_COMPILE_CMD) Compiling C++ file \"$<\"
$(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_CPP_FLAGS) $(CC_FLAGS) $(CPP_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
@echo $(MSG_COMPILE_CMD) Compiling C++ file \"$<\"
$(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_CPP_FLAGS) $(CC_FLAGS) $(CPP_FLAGS) -MMD -MP -MF $(@:%.o=%.d) $< -o $@
-%.o: %.S $(MAKEFILE_LIST)
+
$(OBJDIR)/
%.o: %.S $(MAKEFILE_LIST)
@echo $(MSG_ASSEMBLE_CMD) Assembling \"$<\"
$(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_ASM_FLAGS) $(CC_FLAGS) $(ASM_FLAGS) $< -o $@
@echo $(MSG_ASSEMBLE_CMD) Assembling \"$<\"
$(CROSS)gcc -c $(BASE_CC_FLAGS) $(BASE_ASM_FLAGS) $(CC_FLAGS) $(ASM_FLAGS) $< -o $@
diff --git
a/LUFA/DoxygenPages/BuildSystem.txt
b/LUFA/DoxygenPages/BuildSystem.txt
index
fe29aeb
..
61087a5
100644
(file)
--- a/
LUFA/DoxygenPages/BuildSystem.txt
+++ b/
LUFA/DoxygenPages/BuildSystem.txt
@@
-162,6
+162,11
@@
* <td><tt>LD_FLAGS</tt></td>
\r
* <td>Flags to pass to the linker, after the automatically generated flags.</td>
\r
* </tr>
\r
* <td><tt>LD_FLAGS</tt></td>
\r
* <td>Flags to pass to the linker, after the automatically generated flags.</td>
\r
* </tr>
\r
+ * <tr>
\r
+ * <td><tt>OBJDIR</tt></td>
\r
+ * <td>Directory to place the generated object and dependency files. If set to "." the same folder as the source file will be used.
\r
+ * \note When this option is enabled, all source filenames must be unique.</td>
\r
+ * </tr>
\r
* </table>
\r
*
\r
* \section SSec_BuildModule_BUILD_ProvideVariables Module Provided Variables
\r
* </table>
\r
*
\r
* \section SSec_BuildModule_BUILD_ProvideVariables Module Provided Variables
\r
diff --git
a/Projects/makefile
b/Projects/makefile
index
5c30bc9
..
e169689
100644
(file)
--- a/
Projects/makefile
+++ b/
Projects/makefile
@@
-23,7
+23,9
@@
ifeq ($(MAKELEVEL), 10)
endif
all:
endif
all:
+ifeq ($(OBJDIR),)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) clean all;)
+endif
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)
%:
@$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -s -C $(PROJECT) $@;)