%% "PATTON, BILLY \(SBCSI\)" <[EMAIL PROTECTED]> writes: pb> Here is the skeleton of what I'm doing pb> # create a .a file empty pb> AR_CREATE = if [ ! -f $(PRD_TREE)/$(1)/$(2)/lib/lib$(2).a ] ; then \ pb> $(AR) $(AR_CREATE_OPT) pb> $(PRD_TREE)/$(1)/$(2)/lib/lib$(2).a ; \ pb> $$(CHMOD) $(PRD_TREE)/$(1)/$(2)/lib/lib$(2).a ; \ pb> fi
pb> # add a file to a archive pb> AR_ADD = $(NM) $@ | grep "main.*extern|entry.*CODE" > /dev/null ; \ pb> if [ $$? -ne 0 ] ; then $(AR) $(AR_OPT) $(LIB) $@ > /dev/null ; pb> fi pb> # short hand to create dependencies pb> MKDEP = $(MAKEDEPEND) -proj $(1) -bb $(2) -ifile $$< $$(INCLUDE) pb> # compile .c files to .o pb> COMP_CC = @$$(CC) $$(CCFLAGS) $$(INCLUDE) -o $$@ -c $$< ; \ pb> $(MKDEP) ; $(AR_CREATE); $$(AR_ADD) I don't understand why you want to put .o's into the archive one at a time. Why not do it the same way the linker does, and have only one invocation of "ar"? That is the easy way to make sure you don't have conflicts even with -j, and it will even be more efficient since you have only one invocation of ar instead of one per .o. -- ------------------------------------------------------------------------------- Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at: http://www.gnu.org http://make.paulandlesley.org "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
