gmake[1]: execvp: /bin/sh: Arg list too long

I am having a code which will create archive after build.
Ibuild code on IBM AIX 5.3.
It supposed to create 2 archive after build.
I am getting 1st archive successfully but when build starts for second archive after some processing it throws an following error message-
ar cq /$projedir/lib/ibm/5.3/libpack_v02.01.00.p.a $object; \
done
gmake[1]: execvp: /bin/sh: Arg list too long
gmake[1]: *** [/$projedir/lib/ibm/5.3/libpack_v02.01.00.p.a] Error 127

Confusing part is both archives are having same format of code & Makefiles.
Why only it is failed for 2nd archive?
Any help is appreciated

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

Hi.

You can increase the arg list size using either smitty or the command

 chdev -l sys0 -a ncargs=N

(where N the number of 4K blocks to use - the default I think is 64)

Only root can raise the ncargs value. In addition please note that tuning to a higher ncargs value puts additional constraints on system memory resources - so make sure your box has a enough free memory or you are running straight into further issues. Default value is 6 - be careful when you change it to a higher value - no need to go directly to the max of 1024.

Kind regards
zxmaus

Thank you all.
It resolved the error.