Skip to content

Commit 31c7f81

Browse files
tpetazzonithiagomacieira
authored andcommitted
Makefile: use installation logic compatible with old make version
The installation logic used by the Makefile causes a problem with old make versions, such as make 3.81. Indeed, the rule "$(DESTDIR)%/" gets matched even for targets like "$(DESTDIR)$(libdir)/libtinycbor.a". Due to this, with those old make versions, tinycbor.a is installed as a directory, and the library is never copied: make[1]: Entering directory `/home/test/outputs/b1305500555cbb5b959e5be11dee5cf75907f0ce/output/build/tinycbor-v0.3.1' install -d /home/test/outputs/b1305500555cbb5b959e5be11dee5cf75907f0ce/output/target/usr/bin/cbordump install -d /home/test/outputs/b1305500555cbb5b959e5be11dee5cf75907f0ce/output/target/usr/lib/libtinycbor.a install -d /home/test/outputs/b1305500555cbb5b959e5be11dee5cf75907f0ce/output/target/usr/lib/pkgconfig/tinycbor.pc install -d /home/test/outputs/b1305500555cbb5b959e5be11dee5cf75907f0ce/output/target/usr/include/tinycbor/cbor.h install -d /home/test/outputs/b1305500555cbb5b959e5be11dee5cf75907f0ce/output/target/usr/include/tinycbor/cborjson.h make[1]: Leaving directory `/home/test/outputs/b1305500555cbb5b959e5be11dee5cf75907f0ce/output/build/tinycbor-v0.3.1' To address this, we create the destination directory directly within the per-file make targets. Signed-off-by: Thomas Petazzoni <[email protected]> Signed-off-by: Thiago Macieira <[email protected]>
1 parent 1735f9c commit 31c7f81

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,17 @@ $(PACKAGE).tar.gz: | .git
123123
$(PACKAGE).zip: | .git
124124
GIT_DIR=$(SRCDIR).git $(GIT_ARCHIVE) --format=zip -o "$(PACKAGE).zip" HEAD
125125

126-
$(DESTDIR)%/:
127-
$(INSTALL) -d $@
128-
$(DESTDIR)$(libdir)/%: lib/% | $(DESTDIR)$(libdir)/
126+
$(DESTDIR)$(libdir)/%: lib/%
127+
$(INSTALL) -d $(@D)
129128
$(INSTALL_DATA) $< $@
130-
$(DESTDIR)$(bindir)/%: bin/% | $(DESTDIR)$(bindir)/
129+
$(DESTDIR)$(bindir)/%: bin/%
130+
$(INSTALL) -d $(@D)
131131
$(INSTALL_PROGRAM) $< $@
132-
$(DESTDIR)$(pkgconfigdir)/%: % | $(DESTDIR)$(pkgconfigdir)/
132+
$(DESTDIR)$(pkgconfigdir)/%: %
133+
$(INSTALL) -d $(@D)
133134
$(INSTALL_DATA) $< $@
134-
$(DESTDIR)$(includedir)/tinycbor/%: src/% | $(DESTDIR)$(includedir)/tinycbor/
135+
$(DESTDIR)$(includedir)/tinycbor/%: src/%
136+
$(INSTALL) -d $(@D)
135137
$(INSTALL_DATA) $< $@
136138

137139
install-strip:

0 commit comments

Comments
 (0)