summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-03-20 00:36:10 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-03-20 00:36:10 -0700
commit5642f4d6e28ae97ef8e556112faaeb197630cf9e (patch)
tree90a2e5f4294b16db1de9d0396d78c40adf0b3f01
parentd1aad862d65dd057b8acf3ca5b82301bc02690d2 (diff)
Add release target to Makefile
-rw-r--r--Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index d0980a0..6857dcb 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,9 @@ BUILD=build/make-$(CXX)-$(config)-$(defines)
SOURCES=src/pugixml.cpp $(filter-out tests/fuzz_%,$(wildcard tests/*.cpp))
EXECUTABLE=$(BUILD)/test
+VERSION=$(shell sed -n 's/.*version \(.*\).*/\1/p' src/pugiconfig.hpp)
+RELEASE=$(shell git ls-files src docs/*.html docs/*.css docs/samples docs/images docs/manual scripts contrib readme.txt)
+
CXXFLAGS=-g -Wall -Wextra -Werror -pedantic
LDFLAGS=
@@ -50,6 +53,11 @@ fuzz:
clean:
rm -rf $(BUILD)
+release: build/pugixml-$(VERSION).tar.gz build/pugixml-$(VERSION).zip
+
+build/pugixml-%: .FORCE | $(RELEASE)
+ perl tests/archive.pl $@ $|
+
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(OBJECTS) $(LDFLAGS) -o $@
@@ -59,4 +67,4 @@ $(BUILD)/%.o: %
-include $(OBJECTS:.o=.d)
-.PHONY: all test clean
+.PHONY: all test clean release .FORCE