@ -360,49 +360,51 @@ gccversion :
$( eval CMD = $( AR) $@ $( OBJ) )
$( eval CMD = $( AR) $@ $( OBJ) )
@$( BUILD_CMD)
@$( BUILD_CMD)
BEGIN = gccversion check_submodule sizebefore
# Link: create ELF output file from object files.
# Link: create ELF output file from object files.
.SECONDARY : $( BUILD_DIR ) /$( TARGET ) .elf
.SECONDARY : $( BUILD_DIR ) /$( TARGET ) .elf
.PRECIOUS : $( OBJ )
.PRECIOUS : $( OBJ )
%.elf : gccversion sizebefore check_submodule $( OBJ )
%.elf : $( OBJ ) | $( BEGIN )
@$( SILENT) || printf " $( MSG_LINKING) $@ " | $( AWK_CMD)
@$( SILENT) || printf " $( MSG_LINKING) $@ " | $( AWK_CMD)
$( eval CMD = $( CC) $( ALL_CFLAGS) $( filter-out gccversion sizebefore check_submodule, $^) --output $@ $( LDFLAGS) )
$( eval CMD = $( CC) $( ALL_CFLAGS) $^ --output $@ $( LDFLAGS) )
@$( BUILD_CMD)
@$( BUILD_CMD)
# Compile: create object files from C source files.
# Compile: create object files from C source files.
$(OBJDIR)/%.o : %.c
$(OBJDIR)/%.o : %.c | $( BEGIN )
@mkdir -p $( @D)
@mkdir -p $( @D)
@$( SILENT) || printf " $( MSG_COMPILING) $< " | $( AWK_CMD)
@$( SILENT) || printf " $( MSG_COMPILING) $< " | $( AWK_CMD)
$( eval CMD = $( CC) -c $( ALL_CFLAGS) $< -o $@ )
$( eval CMD = $( CC) -c $( ALL_CFLAGS) $< -o $@ )
@$( BUILD_CMD)
@$( BUILD_CMD)
# Compile: create object files from C++ source files.
# Compile: create object files from C++ source files.
$(OBJDIR)/%.o : %.cpp
$(OBJDIR)/%.o : %.cpp | $( BEGIN )
@mkdir -p $( @D)
@mkdir -p $( @D)
@$( SILENT) || printf " $( MSG_COMPILING_CPP) $< " | $( AWK_CMD)
@$( SILENT) || printf " $( MSG_COMPILING_CPP) $< " | $( AWK_CMD)
$( eval CMD = $( CC) -c $( ALL_CPPFLAGS) $< -o $@ )
$( eval CMD = $( CC) -c $( ALL_CPPFLAGS) $< -o $@ )
@$( BUILD_CMD)
@$( BUILD_CMD)
# Compile: create assembler files from C source files.
# Compile: create assembler files from C source files.
%.s : %.c
%.s : %.c | $( BEGIN )
@$( SILENT) || printf " $( MSG_ASSEMBLING) $< " | $( AWK_CMD)
@$( SILENT) || printf " $( MSG_ASSEMBLING) $< " | $( AWK_CMD)
$( eval CMD = $( CC) -S $( ALL_CFLAGS) $< -o $@ )
$( eval CMD = $( CC) -S $( ALL_CFLAGS) $< -o $@ )
@$( BUILD_CMD)
@$( BUILD_CMD)
# Compile: create assembler files from C++ source files.
# Compile: create assembler files from C++ source files.
%.s : %.cpp
%.s : %.cpp | $( BEGIN )
@$( SILENT) || printf " $( MSG_ASSEMBLING) $< " | $( AWK_CMD)
@$( SILENT) || printf " $( MSG_ASSEMBLING) $< " | $( AWK_CMD)
$( eval CMD = $( CC) -S $( ALL_CPPFLAGS) $< -o $@ )
$( eval CMD = $( CC) -S $( ALL_CPPFLAGS) $< -o $@ )
@$( BUILD_CMD)
@$( BUILD_CMD)
# Assemble: create object files from assembler source files.
# Assemble: create object files from assembler source files.
$(OBJDIR)/%.o : %.S
$(OBJDIR)/%.o : %.S | $( BEGIN )
@mkdir -p $( @D)
@mkdir -p $( @D)
@$( SILENT) || printf " $( MSG_ASSEMBLING) $< " | $( AWK_CMD)
@$( SILENT) || printf " $( MSG_ASSEMBLING) $< " | $( AWK_CMD)
$( eval CMD = $( CC) -c $( ALL_ASFLAGS) $< -o $@ )
$( eval CMD = $( CC) -c $( ALL_ASFLAGS) $< -o $@ )
@$( BUILD_CMD)
@$( BUILD_CMD)
# Create preprocessed source for use in sending a bug report.
# Create preprocessed source for use in sending a bug report.
%.i : %.c
%.i : %.c | $( BEGIN )
$( CC) -E -mmcu= $( MCU) $( CFLAGS) $< -o $@
$( CC) -E -mmcu= $( MCU) $( CFLAGS) $< -o $@
# Target: clean project.
# Target: clean project.
@ -492,7 +494,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null)
# Listing of phony targets.
# Listing of phony targets.
.PHONY : all quick finish sizebefore sizeafter gccversion \
.PHONY : all quick finish sizebefore sizeafter gccversion \
b u i l d e l f h e x e e p l s s s y m c o f f e x t c o f f \
b u i l d e l f h e x e e p l s s s y m c o f f e x t c o f f ch e c k _ s u b m o d u l e \
c l e a n c l e a n _ l i s t d e b u g g d b - c o n f i g s h o w _ p a t h \
c l e a n c l e a n _ l i s t d e b u g g d b - c o n f i g s h o w _ p a t h \
p r o g r a m t e e n s y d f u f l i p d f u - e e f l i p - e e d f u - s t a r t \
p r o g r a m t e e n s y d f u f l i p d f u - e e f l i p - e e d f u - s t a r t \
a l l - k e y b o a r d s - d e f a u l t s a l l - k e y b o a r d s a l l - k e y m a p s \
a l l - k e y b o a r d s - d e f a u l t s a l l - k e y b o a r d s a l l - k e y m a p s \