summaryrefslogtreecommitdiffstats
path: root/contrib/gen_manual
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2017-05-10 20:26:04 (GMT)
committerYann Collet <cyan@fb.com>2017-05-10 20:26:04 (GMT)
commitb8575f2d2b1e05c20812215759b29bf2d0f7a708 (patch)
treea026a79e25bd21d158905e92a62ab4096fed8be2 /contrib/gen_manual
parentfe932c4527aabd1c642b67fddf90e9be8ea380f8 (diff)
downloadlz4-b8575f2d2b1e05c20812215759b29bf2d0f7a708.zip
lz4-b8575f2d2b1e05c20812215759b29bf2d0f7a708.tar.gz
lz4-b8575f2d2b1e05c20812215759b29bf2d0f7a708.tar.bz2
updated Makefile
to automatically build manual files with make all
Diffstat (limited to 'contrib/gen_manual')
-rw-r--r--contrib/gen_manual/.gitignore2
-rw-r--r--contrib/gen_manual/Makefile26
2 files changed, 24 insertions, 4 deletions
diff --git a/contrib/gen_manual/.gitignore b/contrib/gen_manual/.gitignore
new file mode 100644
index 0000000..6ea967f
--- /dev/null
+++ b/contrib/gen_manual/.gitignore
@@ -0,0 +1,2 @@
+# build artefact
+gen_manual
diff --git a/contrib/gen_manual/Makefile b/contrib/gen_manual/Makefile
index adbcca2..9fbe858 100644
--- a/contrib/gen_manual/Makefile
+++ b/contrib/gen_manual/Makefile
@@ -35,7 +35,15 @@ CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -W
CFLAGS += $(MOREFLAGS)
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
-
+LZ4API = ../../lib/lz4.h
+LZ4MANUAL = ../../doc/lz4_manual.html
+LZ4FAPI = ../../lib/lz4frame.h
+LZ4FMANUAL = ../../doc/lz4frame_manual.html
+LIBVER_MAJOR_SCRIPT:=`sed -n '/define LZ4_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(LZ4API)`
+LIBVER_MINOR_SCRIPT:=`sed -n '/define LZ4_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(LZ4API)`
+LIBVER_PATCH_SCRIPT:=`sed -n '/define LZ4_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < $(LZ4API)`
+LIBVER_SCRIPT:= $(LIBVER_MAJOR_SCRIPT).$(LIBVER_MINOR_SCRIPT).$(LIBVER_PATCH_SCRIPT)
+LZ4VER := $(shell echo $(LIBVER_SCRIPT))
# Define *.exe as extension for Windows systems
ifneq (,$(filter Windows%,$(OS)))
@@ -45,14 +53,24 @@ EXT =
endif
-.PHONY: default gen_manual
-
+.PHONY: default
default: gen_manual
gen_manual: gen_manual.cpp
- $(CXX) $(FLAGS) $^ -o $@$(EXT)
+ $(CXX) $(FLAGS) $^ -o $@$(EXT)
+
+$(LZ4MANUAL) : gen_manual $(LZ4API)
+ echo "Update lz4 manual in /doc"
+ ./gen_manual $(LZ4VER) $(LZ4API) $@
+
+$(LZ4FMANUAL) : gen_manual $(LZ4FAPI)
+ echo "Update lz4frame manual in /doc"
+ ./gen_manual $(LZ4VER) $(LZ4FAPI) $@
+.PHONY: manuals
+manuals: gen_manual $(LZ4MANUAL) $(LZ4FMANUAL)
+.PHONY: clean
clean:
@$(RM) gen_manual$(EXT)
@echo Cleaning completed