OSDN Git Service

Updated main Makefile to actually generate HTML documents (by default).
authorLoRd_MuldeR <mulder2@gmx.de>
Fri, 21 Feb 2020 23:30:10 +0000 (00:30 +0100)
committerLoRd_MuldeR <mulder2@gmx.de>
Tue, 25 Feb 2020 19:58:47 +0000 (20:58 +0100)
Makefile
README.md
build.cmd
frontend/Makefile
libmhash384/Makefile

index 75cfaa8..7838b1c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,12 +3,14 @@
 # -----------------------------------------------
 
 DEBUG ?= 0
+NODOC ?= 0
 
 # -----------------------------------------------
 # TOOLS
 # -----------------------------------------------
 
 TAR ?= tar
+PNDOC ?= pandoc
 
 # -----------------------------------------------
 # SYSTEM DETECTION
@@ -46,6 +48,12 @@ endif
 EXEFILE = $(APPNAME).$(SUFFIX)
 TARFILE = $(OUTDIR)/$(APPNAME).$(ISODATE).$(OS_TYPE).tgz
 
+ifneq ($(NODOCS),1)
+DOCFILE = README.html
+else
+DOCFILE = README.md
+endif
+
 # -----------------------------------------------
 # MAKE RULES
 # -----------------------------------------------
@@ -54,21 +62,28 @@ TARFILE = $(OUTDIR)/$(APPNAME).$(ISODATE).$(OS_TYPE).tgz
 
 all: $(TARFILE)
 
-clean: $(CLEANUP)
-
-$(TARFILE): $(SUBDIRS)
+$(TARFILE): $(SUBDIRS) $(DOCFILE)
        @printf "\033[1;36m===[Make package]===\033[0m\n"
        @mkdir -p $(dir $@)
        rm -f $@
-       $(TAR) -czvf $@ COPYING.txt -C $(BINDIR) $(EXEFILE) BUILD_TAG.txt
+       $(TAR) -czvf $@ COPYING.txt $(DOCFILE) img/mhash384/*.jpg -C $(BINDIR) $(EXEFILE) BUILD_TAG.txt
        @printf "\033[1;32mCompleted.\033[0m\n"
 
 $(SUBDIRS):
        @printf "\033[1;36m===[Make %s]===\033[0m\n" $@
-       $(MAKE) -B -C $@
+       $(MAKE) -C $@
        @printf "\033[1;32mCompleted.\033[0m\n"
-       
+
+%.html: %.md
+       @printf "\033[1;36m===[Make %s]===\033[0m\n" $(basename $@)
+       $(PNDOC) --from markdown_github+pandoc_title_block+header_attributes+implicit_figures+yaml_metadata_block --to html5 --toc -N --standalone -H etc/css/style.inc -o $@ $<
+
+clean: $(CLEANUP)
+       @printf "\033[1;31m===[Clean package]===\033[0m\n"
+       rm -f *.html
+       @printf "\033[1;32mExtinguished.\033[0m\n"
+
 $(CLEANUP):
        @printf "\033[1;31m===[Clean %s]===\033[0m\n" $(basename $@)
-       $(MAKE) -B -C $(basename $@) clean
+       $(MAKE) -C $(basename $@) clean
        @printf "\033[1;32mExtinguished.\033[0m\n"
index 8c58c5e..b247c6a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
-% ![](img/mhash384/MHash-384.jpg)  
-MHash-384
-% Simple fast portable secure hashing library
+---
+title: "![MHash-384](img/mhash384/MHash-384.jpg)"
+subtitle: "**Yet another simple fast portable secure hashing library**"
+---
+
 
 # Introduction
 
@@ -484,7 +486,7 @@ The provided makefiles should build successfully with GNUmake on any supported p
 
 In order to build MHash-384, simply run **`make`** from the MHash-384 base directory, for example:
 
-    $ make CXX=clang++ MARCH=x86-64 MTUNE=intel STATIC=1
+    $ make -B MARCH=x86-64 MTUNE=intel STATIC=1
 
 ### Make file parameters
 
@@ -494,10 +496,12 @@ The following options can be used to tweak the behavior of the provided makefile
 * **`MTUNE`**: Tune the generated machine code for the specified CPU type, see [*-mtune*](https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/x86-Options.html#index-mtune-16) for details (default is `native`)
 * **`STATIC`**: If set to `1`, link with *static* CRT libraries; otherwise link with *shared* CRT libraries (default is `0`)
 * **`DEBUG`**: If set to `1`, generate a binary suitable for debugging; otherwise generate an optimized binary (default is `0`)
+* **`NODOCS`**: If set to `1`, the HTML documents are **no** generated; useful where pandoc is unavailable (default is `0`)
 * **`CXX`**: The C++ compiler to be used (default is *system-specific*, e.g. `g++` or `clang++`)
 * **`AR`**: The archiver to be used (default is *system-specific*, usually `ar`)
 * **`STRIP`**: The strip program to be used (default is `strip`)
 * **`WNDRS`**: The Windows resource compiler to be used, used on Cygwin and MinGW only (default is `windres`)
+* **`PNDOC`**: The pandoc document converter to be used (default is `pandoc`)
 * **`TAR`**: The tarball program to be used (default is `tar`)
 * **`SANITIZE`**: Instrument the binary with the specified sanitizer, e.g. `address` to enable [*AddressSanitizer*](https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Instrumentation-Options.html#index-fsanitize_003daddress) (*no* default)
 
index 3fa7c2e..2eab20b 100644 (file)
--- a/build.cmd
+++ b/build.cmd
@@ -332,7 +332,7 @@ REM =========================================================================
 
 set "PACKAGE_NAMES=win-x86,win-x64,java,dotnet,python,delphi"
 
-"%PANDOC_PATH%\pandoc.exe" --from markdown_github+pandoc_title_block+header_attributes+implicit_figures --to html5 --toc -N --standalone -H "%~dp0\..\Prerequisites\Pandoc\css\github-pandoc.inc" -o %~dp0\README.html "%~dp0\README.md"
+"%PANDOC_PATH%\pandoc.exe" --from markdown_github+pandoc_title_block+header_attributes+implicit_figures+yaml_metadata_block --to html5 --toc -N --standalone -H "%~dp0\etc\css\style.inc" -o %~dp0\README.html "%~dp0\README.md"
 if not "%ERRORLEVEL%"=="0" (
        echo Error: Failed to generate documents^^!
        pause
index aecd29f..9e6bcb0 100644 (file)
@@ -119,6 +119,6 @@ $(TAGFILE): $(EXEFILE)
        -$< --version > $@
 
 clean:
-       rm -rf $(OBJDIR)/*.o
-       rm -rf $(OBJDIR)/*.h
-       rm -rf $(BINDIR)/*.$(SUFFIX)
+       rm -f $(OBJDIR)/*.o
+       rm -f $(OBJDIR)/*.h
+       rm -f $(BINDIR)/*.$(SUFFIX)
index 74d4862..e780e13 100644 (file)
@@ -62,5 +62,5 @@ $(OBJDIR)/%.o: $(SRCDIR)/%.cpp
        $(CXX) $(CXXFLAGS) -o $@ -c $<
 
 clean:
-       rm -rf $(OBJDIR)/*.o
-       rm -rf $(LIBDIR)/*.a
+       rm -f $(OBJDIR)/*.o
+       rm -f $(LIBDIR)/*.a