#! /usr/bin/make -f SAVED_PATH := $(PATH) PWD := $(shell pwd) # Collect document names SFX_FILTER := sed -e 's|^\./||;/\/\./d;/^docs\//d;s/\.[a-z]*$$//' PNG_FILES := $(shell find . -name '*.png' -print|$(SFX_FILTER)) MD_FILES := $(shell find . -name '*.md' -print|$(SFX_FILTER)) EXE_FILES := $(shell find . -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 ifeq ($(V),1) MUFFLE := else MUFFLE := 2>/dev/null endif # Support for external NIM compiler unless X=0 ifneq ($(X),0) # works with external nim 1.5.1 (not the local 1.2.10 one) 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 NIM 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)` # 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) [