Skip to content

Commit 0161a94

Browse files
labbottbrgl
authored andcommitted
tools: gpio: Correctly add make dependencies for gpio_utils
gpio tools fail to build correctly with make parallelization: $ make -s -j24 ld: gpio-utils.o: file not recognized: file truncated make[1]: *** [/home/labbott/linux_upstream/tools/build/Makefile.build:145: lsgpio-in.o] Error 1 make: *** [Makefile:43: lsgpio-in.o] Error 2 make: *** Waiting for unfinished jobs.... This is because gpio-utils.o is used across multiple targets. Fix this by making gpio-utios.o a proper dependency. Cc: <[email protected]> Signed-off-by: Laura Abbott <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent f88c117 commit 0161a94

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tools/gpio/Build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
gpio-utils-y += gpio-utils.o
12
lsgpio-y += lsgpio.o gpio-utils.o
23
gpio-hammer-y += gpio-hammer.o gpio-utils.o
34
gpio-event-mon-y += gpio-event-mon.o gpio-utils.o

tools/gpio/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ $(OUTPUT)include/linux/gpio.h: ../../include/uapi/linux/gpio.h
3535

3636
prepare: $(OUTPUT)include/linux/gpio.h
3737

38+
GPIO_UTILS_IN := $(output)gpio-utils-in.o
39+
$(GPIO_UTILS_IN): prepare FORCE
40+
$(Q)$(MAKE) $(build)=gpio-utils
41+
3842
#
3943
# lsgpio
4044
#
4145
LSGPIO_IN := $(OUTPUT)lsgpio-in.o
42-
$(LSGPIO_IN): prepare FORCE
46+
$(LSGPIO_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
4347
$(Q)$(MAKE) $(build)=lsgpio
4448
$(OUTPUT)lsgpio: $(LSGPIO_IN)
4549
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
@@ -48,7 +52,7 @@ $(OUTPUT)lsgpio: $(LSGPIO_IN)
4852
# gpio-hammer
4953
#
5054
GPIO_HAMMER_IN := $(OUTPUT)gpio-hammer-in.o
51-
$(GPIO_HAMMER_IN): prepare FORCE
55+
$(GPIO_HAMMER_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
5256
$(Q)$(MAKE) $(build)=gpio-hammer
5357
$(OUTPUT)gpio-hammer: $(GPIO_HAMMER_IN)
5458
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
@@ -57,7 +61,7 @@ $(OUTPUT)gpio-hammer: $(GPIO_HAMMER_IN)
5761
# gpio-event-mon
5862
#
5963
GPIO_EVENT_MON_IN := $(OUTPUT)gpio-event-mon-in.o
60-
$(GPIO_EVENT_MON_IN): prepare FORCE
64+
$(GPIO_EVENT_MON_IN): prepare FORCE $(OUTPUT)gpio-utils-in.o
6165
$(Q)$(MAKE) $(build)=gpio-event-mon
6266
$(OUTPUT)gpio-event-mon: $(GPIO_EVENT_MON_IN)
6367
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@

0 commit comments

Comments
 (0)