1From d84216a678edaca81c0899318231cdcca2100d38 Mon Sep 17 00:00:00 2001
2From: James Hilliard <james.hilliard1@gmail.com>
3Date: Mon, 17 Oct 2022 16:39:56 -0600
4Subject: [PATCH] Fix output_dir make dependency
5
6Object file targets need to depend on the output_dir target.
7
8Fixes:
9make --shuffle=reverse -j1
10cc -o obj/mtp_op_truncateobject.o src/mtp_operations/mtp_op_truncateobject.c -c  -I./inc -lpthread -Wall -O3
11Assembler messages:
12Fatal error: can't create obj/mtp_op_truncateobject.o: No such file or directory
13make: *** [Makefile:19: obj/mtp_op_truncateobject.o] Error 1 shuffle=reverse
14
15[paul@crapouillou.net: Backport from upstream commit d84216a]
16Signed-off-by: Paul Cercueil <paul@crapouillou.net>
17---
18 Makefile | 6 +++---
19 1 file changed, 3 insertions(+), 3 deletions(-)
20
21diff --git a/Makefile b/Makefile
22index 7c98b63..c28e186 100644
23--- a/Makefile
24+++ b/Makefile
25@@ -7,15 +7,15 @@ objects := $(sources:src/%.c=obj/%.o)
26 ops_sources := $(wildcard src/mtp_operations/*.c)
27 ops_objects := $(ops_sources:src/mtp_operations/%.c=obj/%.o)
28
29-all: output_dir umtprd
30+all: umtprd
31
32 umtprd: $(objects) $(ops_objects)
33 	${CC} -o $@    $^ $(LDFLAGS) -lpthread
34
35-$(objects): obj/%.o: src/%.c
36+$(objects): obj/%.o: src/%.c | output_dir
37 	${CC} -o $@ $^ -c $(CPPFLAGS) $(CFLAGS)
38
39-$(ops_objects): obj/%.o: src/mtp_operations/%.c
40+$(ops_objects): obj/%.o: src/mtp_operations/%.c | output_dir
41 	${CC} -o $@ $^ -c $(CPPFLAGS) $(CFLAGS)
42
43 output_dir:
44--
452.35.1
46
47