저는 현재 메이크 파일 작성 방법을 배우고 있습니다. 나는 (자동 ARM 칩에서 실행해야 C-프로젝트를 위해 생성 된) 다음 메이크있어, 나는 그것을 이해하려고 노력 해요 :
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include FreeRTOS/Supp_Components/subdir.mk
-include FreeRTOS/MemMang/subdir.mk
-...
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(S_UPPER_DEPS)),)
-include $(S_UPPER_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: FreeRTOS_T02.elf
# Tool invocations
FreeRTOS_T02.elf: $(OBJS) $(USER_OBJS)
@echo 'Building target: [email protected]'
@echo 'Invoking: MCU GCC Linker'
arm-none-eabi-gcc -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -specs=nosys.specs -specs=nano.specs -T LinkerScript.ld -Wl,-Map=output.map -Wl,--gc-sections -lm -o "FreeRTOS_T02.elf" @"objects.list" $(USER_OBJS) $(LIBS)
@echo 'Finished building target: [email protected]'
@echo ' '
$(MAKE) --no-print-directory post-build
# Other Targets
clean:
-$(RM) *
[email protected] ' '
post-build:
[email protected] 'Generating binary and Printing size information:'
arm-none-eabi-objcopy -O binary "FreeRTOS_T02.elf" "FreeRTOS_T02.bin"
arm-none-eabi-size "FreeRTOS_T02.elf"
[email protected] ' '
.PHONY: all clean dependents
.SECONDARY: post-build
-include ../makefile.targets
을 내 머리를 정리하려고 해요 .elf
파일을 만들기위한 규칙에 $(MAKE) --no-print-directory post-build
줄 주위에 있습니다.
변수 $(MAKE)
에 대한 정의를 찾을 수 없으므로 기본 제공되는 것으로 가정합니다. 이 라인은 실제로 무엇을하고 있습니까? docs에서
https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html#MAKE-Variable – Notlikethat