Browse Source

tools/Module.mk: Add missing dependencies

Better build the library before building the tools which link against
it, otherwise parallel builds could run into a race and break.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
Acked-by: Angelo Compagnucci <angelo@amarulasolutions.com>
tags/v4.1
Jean Delvare 8 years ago
parent
commit
08b0d67ba7
  1. 7
      lib/Module.mk
  2. 10
      tools/Module.mk

7
lib/Module.mk

@ -37,6 +37,13 @@ ifeq ($(BUILD_STATIC_LIB),1)
LIB_TARGETS += $(LIB_STLIBNAME)
endif
# Library file to link against (static or dynamic)
ifeq ($(USE_STATIC_LIB),1)
LIB_DEPS := $(LIB_DIR)/$(LIB_STLIBNAME)
else
LIB_DEPS := $(LIB_DIR)/$(LIB_SHBASENAME)
endif
#
# Libraries
#

10
tools/Module.mk

@ -24,19 +24,19 @@ TOOLS_TARGETS := i2cdetect i2cdump i2cset i2cget i2ctransfer
# Programs
#
$(TOOLS_DIR)/i2cdetect: $(TOOLS_DIR)/i2cdetect.o $(TOOLS_DIR)/i2cbusses.o
$(TOOLS_DIR)/i2cdetect: $(TOOLS_DIR)/i2cdetect.o $(TOOLS_DIR)/i2cbusses.o $(LIB_DEPS)
$(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
$(TOOLS_DIR)/i2cdump: $(TOOLS_DIR)/i2cdump.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
$(TOOLS_DIR)/i2cdump: $(TOOLS_DIR)/i2cdump.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
$(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
$(TOOLS_DIR)/i2cset: $(TOOLS_DIR)/i2cset.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
$(TOOLS_DIR)/i2cset: $(TOOLS_DIR)/i2cset.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
$(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
$(TOOLS_DIR)/i2cget: $(TOOLS_DIR)/i2cget.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
$(TOOLS_DIR)/i2cget: $(TOOLS_DIR)/i2cget.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
$(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
$(TOOLS_DIR)/i2ctransfer: $(TOOLS_DIR)/i2ctransfer.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
$(TOOLS_DIR)/i2ctransfer: $(TOOLS_DIR)/i2ctransfer.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
$(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
#

Loading…
Cancel
Save