]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
build: De-duplicate _DIRS before calling mkdir
authorFelix Fietkau <nbd@nbd.name>
Thu, 4 Apr 2024 13:03:27 +0000 (15:03 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 15 Apr 2024 20:19:42 +0000 (23:19 +0300)
If the build path is long, the contents of the _DIRS variable can be
very long, since it repeats the same directories very often. In some
cases, this has triggered an "Argument list too long" build error.

Reported-by: Robert Marko <robimarko@gmail.com>
Suggested-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
src/build.rules

index acda8847284d7d3fb1b704a17e385409f66d508d..c756ccb84e8ced5c431b548d0179158c9389ea25 100644 (file)
@@ -80,7 +80,7 @@ endif
 _DIRS := $(BUILDDIR)/$(PROJ)
 .PHONY: _make_dirs
 _make_dirs:
-       @mkdir -p $(_DIRS)
+       @mkdir -p $(sort $(_DIRS))
 
 $(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs
        $(Q)$(CC) -c -o $@ $(CFLAGS) $<