From d1aad862d65dd057b8acf3ca5b82301bc02690d2 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 20 Mar 2015 00:34:37 -0700 Subject: Makefile refactoring Simplify test source specification, disable built-in rules and suffixes --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b50ff69..d0980a0 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,12 @@ +.SUFFIXES: +MAKEFLAGS+=-r + config=debug defines=standard BUILD=build/make-$(CXX)-$(config)-$(defines) -SOURCES=src/pugixml.cpp tests/main.cpp tests/allocator.cpp tests/test.cpp tests/writer_string.cpp $(wildcard tests/test_*.cpp) +SOURCES=src/pugixml.cpp $(filter-out tests/fuzz_%,$(wildcard tests/*.cpp)) EXECUTABLE=$(BUILD)/test CXXFLAGS=-g -Wall -Wextra -Werror -pedantic @@ -56,4 +59,4 @@ $(BUILD)/%.o: % -include $(OBJECTS:.o=.d) -.PHONY: all test clean +.PHONY: all test clean -- cgit v1.2.3 From 5642f4d6e28ae97ef8e556112faaeb197630cf9e Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 20 Mar 2015 00:36:10 -0700 Subject: Add release target to Makefile --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Makefile') 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 -- cgit v1.2.3 From d8f900f148f9ef31f9ee214ba6dafad8d088503e Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sat, 21 Mar 2015 21:06:48 -0700 Subject: Add docs target to Makefile --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6857dcb..b43a641 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,11 @@ clean: release: build/pugixml-$(VERSION).tar.gz build/pugixml-$(VERSION).zip +docs: docs/quickstart.html docs/manual.html + +docs/%.html: docs/%.adoc + asciidoctor -b html5 $< -o $@ + build/pugixml-%: .FORCE | $(RELEASE) perl tests/archive.pl $@ $| -- cgit v1.2.3 From 704d27622b554b17e3055bfb3ef4d2ba1bf17a43 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sun, 22 Mar 2015 11:33:45 -0700 Subject: Add include dependencies to HTML targets --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b43a641..be965ae 100644 --- a/Makefile +++ b/Makefile @@ -57,9 +57,6 @@ release: build/pugixml-$(VERSION).tar.gz build/pugixml-$(VERSION).zip docs: docs/quickstart.html docs/manual.html -docs/%.html: docs/%.adoc - asciidoctor -b html5 $< -o $@ - build/pugixml-%: .FORCE | $(RELEASE) perl tests/archive.pl $@ $| @@ -72,4 +69,8 @@ $(BUILD)/%.o: % -include $(OBJECTS:.o=.d) +.SECONDEXPANSION: +docs/%.html: docs/%.adoc $$(shell sed -n 's/include\:\:\(.*\)\[.*/docs\/\1/p' docs/%.adoc) + asciidoctor -b html5 $< -o $@ + .PHONY: all test clean release .FORCE -- cgit v1.2.3 From fc20b0afbbc06371a4239a9d520c16c5fabf9443 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 24 Mar 2015 20:08:06 -0700 Subject: Update Makefile to exclude docs/manual folder from release --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index be965ae..ed2f50d 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ 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) +RELEASE=$(shell git ls-files src docs/*.html docs/*.css docs/samples docs/images scripts contrib readme.txt) CXXFLAGS=-g -Wall -Wextra -Werror -pedantic LDFLAGS= -- cgit v1.2.3 From 10ff488eb96544074c88ba1aae26025b425dba58 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 24 Mar 2015 20:59:04 -0700 Subject: docs: Use automatically retrieved version for docs This eliminates one more hardcoded version from the repo, yay! --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ed2f50d..0e64129 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,6 @@ $(BUILD)/%.o: % .SECONDEXPANSION: docs/%.html: docs/%.adoc $$(shell sed -n 's/include\:\:\(.*\)\[.*/docs\/\1/p' docs/%.adoc) - asciidoctor -b html5 $< -o $@ + asciidoctor -b html5 -a version=$(VERSION) $< -o $@ .PHONY: all test clean release .FORCE -- cgit v1.2.3