Цитата(alx2 @ Apr 26 2011, 09:05)

Зависимость указывается так:
Код
file.o: file.c file.h
Это означает, что file.o зависит от файлов file.c и file.h и при модификации любого из них будет создаваться заново.
внимательно изучаю автосгенерированные make-файлы и не вижу причин, почему у меня поведение компилятора не совсем правильное... вот такие файлы лежат в папке таргета:
makefileКод
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include src/subdir.mk
-include src/Utilities/subdir.mk
-include src/STM32F10x_StdPeriph_Driver/src/subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(ASM_DEPS)),)
-include $(ASM_DEPS)
endif
ifneq ($(strip $(S_UPPER_DEPS)),)
-include $(S_UPPER_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
SECONDARY_FLASH += \
test3.hex \
SECONDARY_LIST += \
test3.lst \
SECONDARY_SIZE += \
test3.siz \
# All Target
all: test3.elf secondary-outputs
# Tool invocations
test3.elf: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: ARM Yagarto Windows GCC C Linker'
arm-none-eabi-gcc -nostartfiles -Xlinker --gc-sections -Wl,-Map,test3.map -mcpu=cortex-m3 -mthumb -g3 -gdwarf-2 -o"test3.elf" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
test3.hex: test3.elf
@echo 'Invoking: ARM Yagarto Windows GNU Create Flash Image'
arm-none-eabi-objcopy -O ihex test3.elf "test3.hex"
@echo 'Finished building: $@'
@echo ' '
test3.lst: test3.elf
@echo 'Invoking: ARM Yagarto Windows GNU Create Listing'
arm-none-eabi-objdump -h -S test3.elf >"test3.lst"
@echo 'Finished building: $@'
@echo ' '
test3.siz: test3.elf
@echo 'Invoking: ARM Yagarto Windows GNU Print Size'
arm-none-eabi-size --format=berkeley test3.elf
@echo 'Finished building: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(SECONDARY_SIZE)$(OBJS)$(C_DEPS)$(ASM_DEPS)$(SECONDARY_FLASH)$(EXECUTABLES)$(SECONDARY_LIST)$(S_UPPER_DEPS) test3.elf
-@echo ' '
secondary-outputs: $(SECONDARY_FLASH) $(SECONDARY_LIST) $(SECONDARY_SIZE)
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
sources.mkКод
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
ELF_SRCS :=
O_SRCS :=
C_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
ASM_SRCS :=
SECONDARY_SIZE :=
OBJS :=
C_DEPS :=
ASM_DEPS :=
SECONDARY_FLASH :=
EXECUTABLES :=
SECONDARY_LIST :=
S_UPPER_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
src \
src/Utilities \
src/STM32F10x_StdPeriph_Driver/src \
objects.mkКод
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
USER_OBJS :=
LIBS :=
в подпапках с исходниками тоже есть
subdir.mkКод
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../src/core_cm3.c \
../src/main.c \
../src/stm32f10x_it.c \
../src/system_stm32f10x.c
OBJS += \
./src/core_cm3.o \
./src/main.o \
./src/stm32f10x_it.o \
./src/system_stm32f10x.o
C_DEPS += \
./src/core_cm3.d \
./src/main.d \
./src/stm32f10x_it.d \
./src/system_stm32f10x.d
# Each subdirectory must supply rules for building sources it contributes
src/%.o: ../src/%.c
@echo 'Building file: $<'
@echo 'Invoking: ARM Yagarto Windows GCC C Compiler'
arm-none-eabi-gcc -DUSE_STM32_DISCOVERY -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD_VL -I"G:\PRJ\ARM\test3\src\STM32F10x_StdPeriph_Driver\inc" -I"G:\PRJ\ARM\test3\src\STM32F10x_StdPeriph_Driver\src" -I"G:\PRJ\ARM\test3\src\Utilities" -I"G:\PRJ\ARM\test3\src" -O0 -ffunction-sections -fdata-sections -Wall -Wa,-adhlns="$@.lst" -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -mcpu=cortex-m3 -mthumb -g3 -gdwarf-2 -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
на сколько я могу судить, зависимости создаются и должны учитываться. почти такой же формат имеет скрипт, генерируемый Eclipse для WinAVR - отличия в небольших нюансах, но, как я думаю, они не должны влиять - сборка WinAVR идет отлично - только измененные файлы и т.п.
есть подозрение, что make из Yagarto работает не так, либо проблема в чем-то похожем, например, в том, что у меня стоит
WinAVR,
MinGW и
Yagarto, и все прописаны в path... может такое быть, что "чужая" make неверно отрабатывает?