Added ar magic to make XMLTree.a linkable
authorkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Tue, 24 Mar 2009 00:35:47 +0000 (00:35 +0000)
committerkim <kim@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Tue, 24 Mar 2009 00:35:47 +0000 (00:35 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@275 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

makefile

index e1705ef..53e9fad 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,14 +1,15 @@
 FLAGS =-std=c++0x -O3 -I./libcds/includes/\r
 \r
-OBJECTS=libcds/lib/libcds.a\r
-OBJECTS_TC= TextCollection/TextCollection.o TextCollection/TextCollectionBuilder.o TextCollection/TCImplementation.o TextCollection/Tools.o TextCollection/BitRank.o TextCollection/BSGAP.o TextCollection/incbwt/rlcsa.a\r
+LIBCDS_A=libcds/lib/libcds.a \r
+OBJECTS_TCO= TextCollection/TextCollection.o TextCollection/TextCollectionBuilder.o TextCollection/TCImplementation.o TextCollection/Tools.o TextCollection/BitRank.o TextCollection/BSGAP.o \r
+OBJECTS_TCA=TextCollection/incbwt/rlcsa.a\r
 \r
-all: libcds text_collection XMLTree\r
 \r
-XMLTree: XMLTree.o bp.o darray.o bpcore.o libcds/lib/libcds.a\r
-       cp libcds/lib/libcds.a XMLTree.a\r
-       ar vrcs XMLTree.a XMLTree.o bp.o darray.o bpcore.o $(OBJECTS_TC)\r
+all: libcds text_collection XMLTree\r
 \r
+XMLTree: XMLTree.o bp.o darray.o bpcore.o $(LIBCDS_A) $(OBJECTS_TCO) $(OBJECTS_TCA)\r
+       ar rvcs XMLTree.a XMLTree.o bp.o darray.o bpcore.o $(OBJECTS_TCO)\r
+       echo -e "OPEN XMLTree.a\n ADDLIB " $(OBJECTS_TCA) "\n ADDLIB " $(LIBCDS_A) "\n SAVE" | ar -M\r
 \r
 XMLTree.o: bp.c bp.h bpcore.c XMLTree.cpp XMLTree.h\r
        g++ $(FLAGS) -c XMLTree.cpp\r
@@ -29,4 +30,4 @@ libcds:
        make -C libcds/\r
 \r
 clean:\r
-       rm -f *.\r
+       rm -f *.[oa]\r