# -----------------------------------------------
DEBUG ?= 0
+NODOC ?= 0
# -----------------------------------------------
# TOOLS
# -----------------------------------------------
TAR ?= tar
+PNDOC ?= pandoc
# -----------------------------------------------
# SYSTEM DETECTION
EXEFILE = $(APPNAME).$(SUFFIX)
TARFILE = $(OUTDIR)/$(APPNAME).$(ISODATE).$(OS_TYPE).tgz
+ifneq ($(NODOCS),1)
+DOCFILE = README.html
+else
+DOCFILE = README.md
+endif
+
# -----------------------------------------------
# MAKE RULES
# -----------------------------------------------
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"
-% ![](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
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
* **`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)
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
-$< --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)
$(CXX) $(CXXFLAGS) -o $@ -c $<
clean:
- rm -rf $(OBJDIR)/*.o
- rm -rf $(LIBDIR)/*.a
+ rm -f $(OBJDIR)/*.o
+ rm -f $(LIBDIR)/*.a