#! /usr/bin/make -f SAVED_PATH := $(PATH) PWD := $(shell pwd) ifeq ($(MSYSTEM),MINGW32) # Under MinGW, the NIM doc compiler wants absolute pathname arguments # looking like C:\\MinGW\\msys\\1.0\\home ... DOC_ROOT := `pwd -W|sed 's|/|\\\\\\\\|g'` else DOC_ROOT := $(PWD) endif # Collect document names SFX_FILTER := sed -e 's|^\./||;/\/\./d;/^docs\//d;s/\.[a-z]*$$//' PNG_FILES := $(shell find -L . -name '*.png' -print|$(SFX_FILTER)) MD_FILES := $(shell find -L . -name '*.md' -print|$(SFX_FILTER)) EXE_FILES := $(shell find -L . -name '*.nim' -print|$(SFX_FILTER)) TXE_FILES := $(shell find -L ../tests -name '*.nim' -print|$(SFX_FILTER)) # Needed for the NIM compiler that comes with this repo NIMBLE_DIR := $(dir $(PWD))/vendor/.nimble NIM_PATH := $(dir $(PWD))/vendor/nimbus-build-system/vendor/Nim/bin # Support for verbosity: V=1, V=2 etc. ifneq ($(if $V,$V,0),0) MUFFLE := else MUFFLE := 2>/dev/null endif # Support for external NIM compiler unless X=0 ifneq ($(if $X,$X,0),0) PATH := $(SAVED_PATH):$(NIM_PATH):$(NIMBLE_DIR)/bin else PATH := $(NIM_PATH):$(NIMBLE_DIR)/bin:$(SAVED_PATH) endif # Compat version is used with external NIM compiler # NIM_COMPAT := --useVersion:1.2 # Name of NIMDOC compiler, test for newer version on host OS NIM_CMD := nim NIM_TEST := $(NIM_CMD) $(NIM_COMPAT) --help >/dev/null 2>&1 NIM_SELECT := $(NIM_TEST) && echo "$(NIM_CMD) $(NIM_COMPAT)"|| echo "$(NIM_CMD)" # Note that the back ticks are needed in the following assignment NIM_EXE := `$(NIM_SELECT)` # Extra nimdoc flags NIMDOC_FLAGS := --verbosity:0 --hints:off --warnings:off NIMDOC_FLAGS += -d:debug -d:disable_libbacktrace NIMDOC_FLAGS += $(NIMFLAGS) # Nim check flags NIMCHK_FLAGS := c -r --verbosity:0 --hints:off --warnings:off # Markdown compiler (test for discount tool with tables support) MD_CMD := markdown MD_TEST := $(MD_CMD) -VV 2>/dev/null|grep -q TABLES # Default target default: help # ------------------------------------------------------------------------------ # Help page # ------------------------------------------------------------------------------ .SILENT: help help:: echo "Usage: $(MAKE) [