Possible Duplicate:
How to merge two “ar” static libraries into one
I have multiple archive file as below
folder1/libfolder1.a
folder2/libfolder2.a
folder3/libfolder3.a
all these library have bunch of obj files.
I want to create one single archive of all these library.
ar -rcs libGlobal.a folder1/libfolder1.a folder2/libfolder2.a folder3/libfolder3.a
but it doest work. It says I need to extract all these .a files and once I have all these obj file, I can do like below
ar -rcs `ls *.o`
but I dont want to do all this nasty stuff. I want to have clear solution something like
ar -rcs libGlobal.a `ar -x folder1/libfolder1.a` `ar -x folder2/libfolder2.a` `ar -x folder3/libfolder3.a`
the solution I want similar to this because the folder structure that I have given in this example is not that simple.
Any help would be appreciated