Skip to content

Commit

Permalink
mk/compile.mk: fix header dependency in .d file
Browse files Browse the repository at this point in the history
Dependency file .o.d are not updated when a header file is removed from
a source file.
Add option -MP used to fix error generated when removing header files.

Signed-off-by: Thomas Bourgoin <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
  • Loading branch information
tbourgoi authored and jforissier committed Feb 12, 2025
1 parent 71aed2d commit acdc32a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mk/compile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ comp-cppflags-$2 = $$(filter-out $$(CPPFLAGS_REMOVE) $$(cppflags-remove) \
$$(cppflags-lib$$(comp-lib-$2)) $$(cppflags-$2)) \
-D__FILE_ID__=$$(subst -,_,$$(subst /,_,$$(subst .,_,$$(patsubst $$(out-dir)/%,%,$1))))

comp-flags-$2 += -MD -MF $$(comp-dep-$2) -MT $$@
comp-flags-$2 += -MD -MF $$(comp-dep-$2) -MP -MT $$@
comp-flags-$2 += $$(comp-cppflags-$2)

comp-cmd-$2 = $$(comp-compiler-$2) $$(comp-flags-$2) -c $$< -o $$@
Expand Down

0 comments on commit acdc32a

Please sign in to comment.