1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Thu, 4 Apr 2024 12:59:41 +0200
3 Subject: [PATCH] build: de-duplicate _DIRS before calling mkdir
5 If the build path is long, the contents of the _DIRS variable can be very long,
6 since it repeats the same directories very often.
7 In some cases, this has triggered an "Argument list too long" build error.
9 Suggested-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 @@ -80,7 +80,7 @@ endif
16 _DIRS := $(BUILDDIR)/$(PROJ)
20 + @mkdir -p $(sort $(_DIRS))
22 $(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs
23 $(Q)$(CC) -c -o $@ $(CFLAGS) $<