tools: iio: Correctly add make dependency for iio_utils

iio tools fail to build correctly with make parallelization:

$ make -s -j24
fixdep: error opening depfile: ./.iio_utils.o.d: No such file or directory
make[1]: *** [/home/labbott/linux_upstream/tools/build/Makefile.build:96: iio_utils.o] Error 2
make: *** [Makefile:43: iio_event_monitor-in.o] Error 2
make: *** Waiting for unfinished jobs....

This is because iio_utils.o is used across multiple targets.
Fix this by making iio_utils.o a proper dependency.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Laura Abbott 2019-10-18 13:29:08 -04:00 committed by Jonathan Cameron
parent 506d2e317a
commit 731b60afcb
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,4 @@
iio_utils-y += iio_utils.o
lsiio-y += lsiio.o iio_utils.o
iio_event_monitor-y += iio_event_monitor.o iio_utils.o
iio_generic_buffer-y += iio_generic_buffer.o iio_utils.o

View File

@ -32,20 +32,24 @@ $(OUTPUT)include/linux/iio: ../../include/uapi/linux/iio
prepare: $(OUTPUT)include/linux/iio
IIO_UTILS_IN := $(OUTPUT)iio_utils-in.o
$(IIO_UTILS_IN): prepare FORCE
$(Q)$(MAKE) $(build)=iio_utils
LSIIO_IN := $(OUTPUT)lsiio-in.o
$(LSIIO_IN): prepare FORCE
$(LSIIO_IN): prepare FORCE $(OUTPUT)iio_utils-in.o
$(Q)$(MAKE) $(build)=lsiio
$(OUTPUT)lsiio: $(LSIIO_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
IIO_EVENT_MONITOR_IN := $(OUTPUT)iio_event_monitor-in.o
$(IIO_EVENT_MONITOR_IN): prepare FORCE
$(IIO_EVENT_MONITOR_IN): prepare FORCE $(OUTPUT)iio_utils-in.o
$(Q)$(MAKE) $(build)=iio_event_monitor
$(OUTPUT)iio_event_monitor: $(IIO_EVENT_MONITOR_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
IIO_GENERIC_BUFFER_IN := $(OUTPUT)iio_generic_buffer-in.o
$(IIO_GENERIC_BUFFER_IN): prepare FORCE
$(IIO_GENERIC_BUFFER_IN): prepare FORCE $(OUTPUT)iio_utils-in.o
$(Q)$(MAKE) $(build)=iio_generic_buffer
$(OUTPUT)iio_generic_buffer: $(IIO_GENERIC_BUFFER_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@