build: De-duplicate _DIRS before calling mkdir
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>
This commit is contained in:
parent
9a44236452
commit
4b755c9672
1 changed files with 1 additions and 1 deletions
|
@ -80,7 +80,7 @@ endif
|
||||||
_DIRS := $(BUILDDIR)/$(PROJ)
|
_DIRS := $(BUILDDIR)/$(PROJ)
|
||||||
.PHONY: _make_dirs
|
.PHONY: _make_dirs
|
||||||
_make_dirs:
|
_make_dirs:
|
||||||
@mkdir -p $(_DIRS)
|
@mkdir -p $(sort $(_DIRS))
|
||||||
|
|
||||||
$(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs
|
$(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs
|
||||||
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
|
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
|
||||||
|
|
Loading…
Reference in a new issue