Merge branch 'master' into stm32f4

This commit is contained in:
hathach
2019-03-05 05:45:42 -08:00
committed by GitHub
35 changed files with 9036 additions and 212 deletions
+15 -4
View File
@@ -20,6 +20,7 @@ CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy
SIZE = $(CROSS_COMPILE)size
MKDIR = mkdir
SED = sed
CP = cp
@@ -85,11 +86,10 @@ LIB_SOURCE += \
SRC_C += $(LIB_SOURCE)
OBJ = $(addprefix $(BUILD)/obj/, $(SRC_S:.s=.o))
OBJ += $(addprefix $(BUILD)/obj/, $(SRC_C:.c=.o))
OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.S=.o))
all: $(BUILD)/$(BOARD)-firmware.bin
all: $(BUILD)/$(BOARD)-firmware.bin size
OBJ_DIRS = $(sort $(dir $(OBJ)))
$(OBJ): | $(OBJ_DIRS)
@@ -109,7 +109,7 @@ $(BUILD)/$(BOARD)-firmware.bin: $(BUILD)/$(BOARD)-firmware.elf
# to be used to compile all .c files.
vpath %.c . $(TOP)
$(BUILD)/obj/%.o: %.c
@echo CC $@
@echo CC $(notdir $@)
@$(CC) $(CFLAGS) -c -MD -o $@ $<
@# The following fixes the dependency file.
@# See http://make.paulandlesley.org/autodep.html for details.
@@ -119,10 +119,21 @@ $(BUILD)/obj/%.o: %.c
-e '/^$$/ d' -e 's/$$/ :/' < $(@:.o=.d) >> $(@:.o=.P); \
$(RM) $(@:.o=.d)
# ASM sources
vpath %.s . $(TOP)
$(BUILD)/obj/%.o: %.s
@echo "AS $<"
@$(AS) -o $@ $<
#vpath %.S . $(TOP)
#$(BUILD)/obj/%.o: %.S
# @echo AS $(notdir $@)
# @$(CC) -x assembler-with-cpp $(ASFLAGS) -c -o $@ $<
size: $(BUILD)/$(BOARD)-firmware.elf
-@echo ''
@$(SIZE) $<
-@echo ''
clean:
rm -rf build-$(BOARD)