]> git.notmuchmail.org Git - notmuch/commitdiff
build: remove trailing '/.' when doing mkdir -p .deps/.
authorTomi Ollila <tomi.ollila@iki.fi>
Sun, 3 Nov 2013 14:05:35 +0000 (16:05 +0200)
committerDavid Bremner <david@tethera.net>
Mon, 13 Jan 2014 18:12:15 +0000 (14:12 -0400)
When make variable $@ does not contain directory part, $(@D)
resolves as '.'. In this case .deps/$(@D) is '.deps/.'
In some systems `mkdir [-p] directory/.` fails.
To make this compatible with more system substitute trailing
'/.' (slashdot) with '' (empty string) whenever it occurs there.

Makefile.local

index 72524eb361e4a05804c39ce3a237756f3952609b..c85e09c52b212a0f1ee0fe1afa99e9d1f337203e 100644 (file)
@@ -236,11 +236,11 @@ endif
 quiet ?= $($(shell echo $1 | sed -e s'/ .*//'))
 
 %.o: %.cc $(global_deps)
-       @mkdir -p .deps/$(@D)
+       @mkdir -p $(patsubst %/.,%,.deps/$(@D))
        $(call quiet,CXX $(CPPFLAGS) $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d
 
 %.o: %.c $(global_deps)
-       @mkdir -p .deps/$(@D)
+       @mkdir -p $(patsubst %/.,%,.deps/$(@D))
        $(call quiet,CC $(CPPFLAGS) $(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d
 
 .PHONY : clean