git » libjio » commit 488fbec

libjio: Take the version from the Makefile instead of hardcoding it

author Alberto Bertogli
2009-07-26 15:21:36 UTC
committer Alberto Bertogli
2009-07-26 15:25:34 UTC
parent 11b47633f1a7501e8df149b38c369a0ca0d00e3a

libjio: Take the version from the Makefile instead of hardcoding it

This patch make libjio.pc and Doxygen.base take the version from the
Makefile instead of hardcoding it.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

.gitignore +1 -0
libjio/Makefile +2 -1
libjio/doxygen/{Doxyfile.base => Doxyfile.base.in} +1 -1
libjio/doxygen/Makefile +12 -3
libjio/libjio.pc.in +1 -1

diff --git a/.gitignore b/.gitignore
index fbb6f00..a8dd35f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,5 +15,6 @@ tests/performance/random
 *.pyo
 libjio/doxygen/doc.internal
 libjio/doxygen/doc.public
+libjio/doxygen/Doxygen.base
 libjio/build-flags
 
diff --git a/libjio/Makefile b/libjio/Makefile
index ec503d5..ba1413c 100644
--- a/libjio/Makefile
+++ b/libjio/Makefile
@@ -74,6 +74,7 @@ libjio.pc: build-flags libjio.pc.in
 	@echo "generating libjio.pc"
 	@cat libjio.pc.in | \
 		sed 's@++PREFIX++@$(DESTDIR)@g' | \
+		sed 's@++VERSION++@$(LIB_VER)@g' | \
 		sed 's@++CFLAGS++@$(MANDATORY_CFLAGS)@g' \
 		> libjio.pc
 
@@ -113,7 +114,7 @@ $(OBJS): build-flags
 	$(NICE_CC) $(ALL_CFLAGS) -c $< -o $@
 
 doxygen:
-	$(MAKE) -C doxygen
+	$(MAKE) LIB_VER=$(LIB_VER) -C doxygen
 
 clean:
 	rm -f libjio.a libjio.so libjio.so.$(LIB_VER) libjio.pc
diff --git a/libjio/doxygen/Doxyfile.base b/libjio/doxygen/Doxyfile.base.in
similarity index 99%
rename from libjio/doxygen/Doxyfile.base
rename to libjio/doxygen/Doxyfile.base.in
index aae43eb..3bfcf8f 100644
--- a/libjio/doxygen/Doxyfile.base
+++ b/libjio/doxygen/Doxyfile.base.in
@@ -1,6 +1,6 @@
 DOXYFILE_ENCODING      = UTF-8
 PROJECT_NAME           = libjio
-PROJECT_NUMBER         = 0.51
+PROJECT_NUMBER         = ++VERSION++
 OUTPUT_DIRECTORY       = 
 CREATE_SUBDIRS         = NO
 OUTPUT_LANGUAGE        = English
diff --git a/libjio/doxygen/Makefile b/libjio/doxygen/Makefile
index 3b020d0..d69197f 100644
--- a/libjio/doxygen/Makefile
+++ b/libjio/doxygen/Makefile
@@ -10,14 +10,23 @@ default: all
 
 all: public internal
 
-public:
+# $(LIB_VER) must be defined externally if we want the generated docs to
+# specify a version number. Usually, this Makefile will be invoked by
+# libjio's, which has that variable properly defined.
+Doxyfile.base: Doxyfile.base.in
+	@echo "generating Doxyfile.base"
+	@cat Doxyfile.base.in | \
+		sed 's@++VERSION++@$(LIB_VER)@g' \
+		> Doxyfile.base
+
+public: Doxyfile.base
 	$(NICE_DOXYGEN) Doxyfile.public
 
-internal:
+internal: Doxyfile.base
 	$(NICE_DOXYGEN) Doxyfile.internal
 
 clean:
-	rm -rf doc.internal doc.public
+	rm -rf doc.internal doc.public Doxyfile.base
 
 
 .PHONY: all clean default doxygen internal public
diff --git a/libjio/libjio.pc.in b/libjio/libjio.pc.in
index 79f0b99..4e5adc2 100644
--- a/libjio/libjio.pc.in
+++ b/libjio/libjio.pc.in
@@ -6,7 +6,7 @@ includedir=${prefix}/include
 Name: libjio
 Description: A library for Journaled I/O
 URL: http://blitiri.com.ar/p/libjio/
-Version: 0.51
+Version: ++VERSION++
 Libs: -L${libdir} -ljio
 Cflags: -I${includedir} ++CFLAGS++