Parcourir la source

Merge pull request #438 from TheZoc/osx-makefile

Updated Makefile to allow building TinyXML2 as a static library
Lee Thomason il y a 9 ans
Parent
commit
ceb646812a
1 fichiers modifiés avec 17 ajouts et 4 suppressions
  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
 test: clean xmltest
 	./xmltest
 	./xmltest
-clean:
-	rm -f *.o xmltest
+
+staticlib: tinyxml2.a
+
+tinyxml2.a: tinyxml2.o
+	$(AR) $(ARFLAGS)s $@ $^
+	
+tinyxml2.o: tinyxml2.cpp tinyxml2.h
+