]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/i2c-tools/0004-tools-Module.mk-Add-missing-dependencies.patch
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / i2c-tools / 0004-tools-Module.mk-Add-missing-dependencies.patch
1 From 08b0d67ba7eceb862cb17f52eb1911e9579726ea Mon Sep 17 00:00:00 2001
2 From: Jean Delvare <jdelvare@suse.de>
3 Date: Thu, 14 Dec 2017 08:52:26 +0100
4 Subject: [PATCH] tools/Module.mk: Add missing dependencies
5
6 Better build the library before building the tools which link against
7 it, otherwise parallel builds could run into a race and break.
8
9 Signed-off-by: Jean Delvare <jdelvare@suse.de>
10 Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
11 Acked-by: Angelo Compagnucci <angelo@amarulasolutions.com>
12 Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
13 ---
14  lib/Module.mk   |  7 +++++++
15  tools/Module.mk | 10 +++++-----
16  2 files changed, 12 insertions(+), 5 deletions(-)
17
18 diff --git a/lib/Module.mk b/lib/Module.mk
19 index 8a58f5b..67afe91 100644
20 --- a/lib/Module.mk
21 +++ b/lib/Module.mk
22 @@ -37,6 +37,13 @@ ifeq ($(BUILD_STATIC_LIB),1)
23  LIB_TARGETS    += $(LIB_STLIBNAME)
24  endif
25  
26 +# Library file to link against (static or dynamic)
27 +ifeq ($(USE_STATIC_LIB),1)
28 +LIB_DEPS       := $(LIB_DIR)/$(LIB_STLIBNAME)
29 +else
30 +LIB_DEPS       := $(LIB_DIR)/$(LIB_SHBASENAME)
31 +endif
32 +
33  #
34  # Libraries
35  #
36 diff --git a/tools/Module.mk b/tools/Module.mk
37 index 6421a23..609de7a 100644
38 --- a/tools/Module.mk
39 +++ b/tools/Module.mk
40 @@ -24,19 +24,19 @@ TOOLS_TARGETS       := i2cdetect i2cdump i2cset i2cget i2ctransfer
41  # Programs
42  #
43  
44 -$(TOOLS_DIR)/i2cdetect: $(TOOLS_DIR)/i2cdetect.o $(TOOLS_DIR)/i2cbusses.o
45 +$(TOOLS_DIR)/i2cdetect: $(TOOLS_DIR)/i2cdetect.o $(TOOLS_DIR)/i2cbusses.o $(LIB_DEPS)
46         $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
47  
48 -$(TOOLS_DIR)/i2cdump: $(TOOLS_DIR)/i2cdump.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
49 +$(TOOLS_DIR)/i2cdump: $(TOOLS_DIR)/i2cdump.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
50         $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
51  
52 -$(TOOLS_DIR)/i2cset: $(TOOLS_DIR)/i2cset.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
53 +$(TOOLS_DIR)/i2cset: $(TOOLS_DIR)/i2cset.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
54         $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
55  
56 -$(TOOLS_DIR)/i2cget: $(TOOLS_DIR)/i2cget.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
57 +$(TOOLS_DIR)/i2cget: $(TOOLS_DIR)/i2cget.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
58         $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
59  
60 -$(TOOLS_DIR)/i2ctransfer: $(TOOLS_DIR)/i2ctransfer.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
61 +$(TOOLS_DIR)/i2ctransfer: $(TOOLS_DIR)/i2ctransfer.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
62         $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
63  
64  #
65 -- 
66 2.7.4
67