a question about archive

I am now using a package written by someone else. I am following the README instruction enclosed in the parent folder to compile. The parent folder contains two subfolders, i.e. "f1" and "f2". I'll denote the parent folder by ../ in the following context.

Each of these two subfolders has its own makefile. In "f1", "makefilef1.mk" generates an archive "arch.a" in the parent folder, i.e. ../ as following

1
2
3
arch.a: $(LIB_OBJ)
        $(AR) $(ARFLAGS) ../arch.a $(LIB_OBJ)
	$(RANLIB) ../arch.a


Then in "f2" "makefilef2.mk" generates an archive with the same name "arch.a" in the ../ too as this (this part of codes is same as above):

1
2
3
arch.a: $(LIB_OBJ)
	$(AR) $(ARFLAGS) ../arch.a $(LIB_OBJ)
	$(RANLIB) ../arch.a


My question is: When I generate the second archive with the same name "arch.a" in the same folder, i.e. the parent folder ../, will the archive "arch.a" generated by "makefilef1.mk" be overwritten by the the one generated by "makefilef2.mk"? Or these two archives are just merged?

Thank you so much.
Last edited on
bump up~
This should be addressed in the README. If it isn't, then it's not important. Whatever result you get at the end of the process is the correct one.
Hi helios,

I got everything right after following the instruction of README strictly. Any the README file doesn't explain what I asked.

Further questions:

1. Archive files can only help after the very first compilation, right?
2. How much can archive files help/speed up the following re-compilation? Should the help be significant?

Thanks a lot.
It think it depends on what flags are set in the variable $(ARFLAGS):

http://linux.die.net/man/1/ar

I would imagine the objects in the archive are updated with the newly compiled versions from each subdirectory.
Galik,

Thank you for your response. Yes, you are right. The AR flag, i.e. ARFLAGS, is defined with "-r", which clearly indicates that everything new is appended at the end of the original archive file. Again, thanks.

Topic archived. No new replies allowed.