Skip to content

fix .d Makefile rule - #1378

Open
qi77wang wants to merge 1 commit into
FreeRTOS:mainfrom
qi77wang:feature/dot_d_make_rule
Open

qi77wang wants to merge 1 commit into
FreeRTOS:mainfrom
qi77wang:feature/dot_d_make_rule

Conversation

@qi77wang

@qi77wang qi77wang commented Dec 5, 2025

Copy link
Copy Markdown

Change-Id: Ie1d0f9260303d598052ca94305424e2828134229

fix .d make rules

Description

the following make rule not exec when make,
and if this rule exec, has compile error,
this commit will fix these issue.

-%.d: %.c

  •   @set -e; rm -f $@; \
    
  •   $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \
    

Test Steps

cd FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Echo_Qemu_mps2/
make
cat build/startup.d
you will see this output
startup.o build/startup.d : startup.c
/.../toolchain/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/lib/gcc/arm-none-eabi/12.2.1/include/stdint.h
/.../toolchain/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/arm-none-eabi/include/stdint.h \

Checklist:

  1. elf success to generate
  2. .d rule exec correctly

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Change-Id: Ie1d0f9260303d598052ca94305424e2828134229
@kstribrnAmzn kstribrnAmzn self-assigned this Dec 17, 2025
@kstribrnAmzn

Copy link
Copy Markdown
Member

I was unable to duplicate the behavior you've documented. I was able to run make and build the entire demo (output file was build/freertos_tcp_mps2_demo.axf). I was able to execute make startup.d to trigger the makefile target without your changes. Make was able to successfully build the startup.d file.

When viewing the contents with cat startup.d I saw the following output:

startup.o startup.d : startup.c \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include/stdint.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/stdint.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/machine/_default_types.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/features.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/_newlib_version.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/_intsup.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/_stdint.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/stdio.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/_ansi.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/newlib.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/config.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/machine/ieeefp.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/cdefs.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include/stddef.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/lib/gcc/arm-none-eabi/13.2.1/include/stdarg.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/reent.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/_ansi.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/_types.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/machine/_types.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/lock.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/stdio.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/stdlib.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/machine/stdlib.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/alloca.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/string.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/_locale.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/strings.h \
 /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/arm-none-eabi/include/sys/string.h

For reference I am on a Mac. I have ArmGNUToolchain 13.2.Rel1 installed. I've brew installed GNU Make 3.81.

@kstribrnAmzn

Copy link
Copy Markdown
Member

Can you provide more details on your setup and the exact commands you ran which caused the failure?

@kstribrnAmzn

Copy link
Copy Markdown
Member

When I pull your changes I get the following error when running make startup.d:

make: *** No rule to make target `startup.d'.  Stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants