Skip to content

Commit

Permalink
Implementing target dag
Browse files Browse the repository at this point in the history
  • Loading branch information
fadado committed Nov 26, 2018
1 parent e727f4d commit 06b065f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
19 changes: 13 additions & 6 deletions bin/sake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 6 additions & 5 deletions docs/Sakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,24 @@
########################################################################

#Meta := .meta
#JQTFLAGS +=
#VERBOSE := 1
#TRACE := 1
#VNU := java -jar /usr/local/vnu/vnu.jar
#JQTFLAGS += ...

########################################################################
# Starting makefile
########################################################################

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
Expand Down
2 changes: 1 addition & 1 deletion share/sake.d/main.make
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 06b065f

Please sign in to comment.