You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/11 07:26:28 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #3510: Add LTP build for sim and allow long arguments for archive

xiaoxiang781216 commented on a change in pull request #3510:
URL: https://github.com/apache/incubator-nuttx/pull/3510#discussion_r611144726



##########
File path: tools/Config.mk
##########
@@ -196,6 +196,26 @@ OBJPATH ?= .
 %.ddh: %.c
 	$(Q) $(MKDEP) --obj-path $(OBJPATH) --obj-suffix $(OBJEXT) $(DEPPATH) "$(CC)" -- $(HOSTCFLAGS) -- $< > $@
 
+# MAX_ARGS - Split a single command up into multiple commands based on maximum number
+#   of words in the command arguments.  This is especially useful for cases like assembling
+#   a large archive or deleting a large number of objects.  The Argument list too long error
+#   is based on the number of bytes in the argument so this is not an exact fix, but selecting
+#   a reasonable number for the maximum number of words can still allow for multiple files
+#   to be supplied to a command but also split it up in the large cases.
+# Example: @$(call MAX_ARGS,ar rcs mylib.a ,2,$(OBJS))
+
+define MAX_ARGS
+  $(eval _args:=)
+  $(foreach obj,$3,$(eval _args+=$(obj))$(if $(word $2,$(_args)),$1$(_args)$(EOL)$(eval _args:=)))

Review comment:
       Should we give a fix number of $2 to simplify the caller a little bit?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org