Pārlūkot izejas kodu

Updated Makefile to allow building TinyXML2 as a static library

Felipe "Zoc" Silveira 10 gadi atpakaļ
vecāks
revīzija
48daa2dd81
1 mainītis faili ar 17 papildinājumiem un 4 dzēšanām
  1. 17 4
      Makefile

+ 17 - 4
Makefile

@@ -1,6 +1,19 @@
-all: xmltest
-xmltest: xmltest.cpp tinyxml2.cpp tinyxml2.h
+all: xmltest staticlib
+
+rebuild: clean all
+
+xmltest: xmltest.cpp tinyxml2.a
+
+clean:
+	$(RM) *.o xmltest tinyxml2.a
+	
 test: clean xmltest
 	./xmltest
-clean:
-	rm -f *.o xmltest
+
+staticlib: tinyxml2.a
+
+tinyxml2.a: tinyxml2.o
+	$(AR) $(ARFLAGS)s $@ $^
+	
+tinyxml2.o: tinyxml2.cpp tinyxml2.h
+