diff mbox series

[v2] include/buildrules: substitute ".o" for ".lo" only at the very end

Message ID 20210217222656.1762426-1-mmayer@broadcom.com (mailing list archive)
State New
Headers show
Series [v2] include/buildrules: substitute ".o" for ".lo" only at the very end | expand

Commit Message

Markus Mayer Feb. 17, 2021, 10:26 p.m. UTC
To prevent issues when the ".o" extension appears in a directory path,
ensure that the ".o" -> ".lo" substitution is only performed for the
file extension immediately preceeding the ":" of a makefile rule.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---

Change since v1:
    - reworked the regex as suggested by David
      https://www.spinics.net/lists/linux-xfs/msg49712.html

 include/buildrules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/buildrules b/include/buildrules
index 7a139ff07de8..f6663615d278 100644
--- a/include/buildrules
+++ b/include/buildrules
@@ -133,7 +133,7 @@  rmltdep:
 	$(Q)rm -f .ltdep
 
 .ltdep: $(CFILES) $(HFILES)
-	$(Q)$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o,\1.lo,' > .ltdep
+	$(Q)$(MAKEDEP) $(CFILES) | $(SED) -e 's,^\([^:]*\)\.o: ,\1.lo: ,' > .ltdep
 
 depend: rmdep .dep