From 06b065f6a82cbd03a8437d289b7feb13bc4e1f2d Mon Sep 17 00:00:00 2001 From: Joan Josep Ordinas Rosa Date: Mon, 26 Nov 2018 12:43:55 +0100 Subject: [PATCH] Implementing target `dag` --- bin/sake | 19 +++++++++++++------ docs/Sakefile | 11 ++++++----- share/sake.d/main.make | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/bin/sake b/bin/sake index 74ecc20..8845863 100755 --- a/bin/sake +++ b/bin/sake @@ -40,6 +40,13 @@ fi # Run _sake case $1 in + dag) + make -f Sakefile -Bdn \ + | sed -n \ + -e "s/'//g" \ + -e 's/\.$//' \ + -e 's/Considering target file //p' + ;; help) echo 1>&2 "${SELF}: Target \`help\` not implemented." exit 1 @@ -51,12 +58,12 @@ case $1 in list) echo 'Usage: sake [goal] [[options] [variable=string] ...]' echo 'Goals:' - _sake --jobs=1 --dry-run --print-data-base --question 2>&1 \ - | grep -v '^[SmM]akefile' \ - | awk '/^[^ \t.%][-A-Za-z0-9_.]*:/ { print $1 }' \ - | sort --unique \ - | sed 's/:\+$//' \ - | pr --omit-pagination --width=80 --columns=6 + make -f Sakefile -dpq 2>&1 \ + | grep -v '^[SmM]akefile' \ + | awk '/^[^ \t.%][-A-Za-z0-9_.]*:/ { print $1 }' \ + | sort --unique \ + | sed 's/:\+$//' \ + | pr --omit-pagination --width=80 --columns=6 ;; touch) if test -e config.yaml; then touch config.yaml; else touch config.json; fi diff --git a/docs/Sakefile b/docs/Sakefile index 2935dbb..d166c87 100644 --- a/docs/Sakefile +++ b/docs/Sakefile @@ -16,11 +16,8 @@ ######################################################################## #Meta := .meta -#JQTFLAGS += #VERBOSE := 1 #TRACE := 1 -#VNU := java -jar /usr/local/vnu/vnu.jar -#JQTFLAGS += ... ######################################################################## # Starting makefile @@ -28,11 +25,15 @@ include $(JQTLIB)/sake.d/main.make +ifdef __build + ######################################################################## -# Last phase, after metadata configuration. +# Variables to define after include if default values must be changed. ######################################################################## -ifdef __build +#JQTFLAGS += +#VNU := java -jar /usr/local/vnu/vnu.jar +#JQTFLAGS += ... # Add some Pandoc options JQTFLAGS += -5 --toc-depth=4 diff --git a/share/sake.d/main.make b/share/sake.d/main.make index de480aa..08d180f 100644 --- a/share/sake.d/main.make +++ b/share/sake.d/main.make @@ -128,7 +128,7 @@ __build := 1 # Standard targets. ######################################################################## -sake_builtin := new help touch list +sake_builtin := new help touch list dag .PHONY: build clean clobber nuke configure $(sake_builtin) # Filter builtin tools defined in `sake`script.