Compare commits

..

No commits in common. "3cd8b940da3abde116c5de1d55546e9691f000e4" and "9ee2a8db79aa1578dd18c29bc34709af1024db4e" have entirely different histories.

7 changed files with 67 additions and 64 deletions

View file

@ -1,9 +0,0 @@
Copyright 2022 Daylin Morgan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -77,15 +77,13 @@ as python {a.bold}f-string{a.end} literals
{a.end}
endef
## info | demonstrate usage of tprint
## info | demonsrtate usage of tprint
.PHONY: task
info:
$(call header, Info Message)
$(call tprint,{a.black_on_cyan}This is task-print output:{a.end})
$(call tprint,{a.b_magenta}This is task-print output:{a.end})
$(call tprint,$(msg))
task.mk:
./generate.py $(shell git describe --tags) > task.mk
define USAGE
{a.$(HEADER_COLOR)}usage:{a.end}

View file

@ -119,8 +119,8 @@ You can take advantage of the builtin python script runner and write multi-line
This is a simple example but a few lines of python in your `Makefile`
may be easier than balancing sub-shells and strung together awk commands.
When `make` expands the function it will take the parameters passed to `py` and expand them.
`$(1)` is the variable name and `$(2)` in this case is the implicit pattern from the rule. Pay attention to quotes.
When `make` expands the function it will take the parameters passed to `py` and expand them `$(1)` is the variable name.
`$(2)` in this case is the implicit pattern from the rule. Pay attention to quotes.
If you need to debug your python script, use `DEBUG=1` when you run `make` and it will first print the script that will be piped to `python`.
```make
@ -135,7 +135,7 @@ list-%:
$(call py,list_files_py,$*)
```
For what it's worth there is also a predefined function for `bash` (named `tbash`) as well should you need to accomplish something similar of more easily embedding your bash script rather than having to escape every line with a backslash.
For what it's worth there is also a predefined function for `bash` (named `tbash`) as well should you need to accomplish something similar of more easily embedding your bash script rather than having to escape every line with '\'.
```make
define bash_script
@ -182,10 +182,10 @@ But I just want a basic help output, surely I don't need python for this... you
```make
## h, help | show this help
.PHONY: help h
help h: Makefile
help h: Makefile params
@awk -v fill=$(shell sed -n 's/^## \(.*\) | .*/\1/p' $< | wc -L)\
'match($$0,/^## (.*) \|/,name) && match($$0,/\| (.*)$$/,help)\
{printf "\033[1;93m%*s\033[0m | \033[30m%s\033[0m\n",\
fill,name[1],help[1];} match($$0,/^### (.*)/,str) \
{printf "%*s \033[30m%s\033[0m\n",fill," ",str[1];}' $<
```
```

View file

@ -16,14 +16,14 @@
font-weight: 700;
}
.terminal-649700464-matrix {
.terminal-649569392-matrix {
font-family: Fira Code, monospace;
font-size: 20px;
line-height: 24.4px;
font-variant-east-asian: full-width;
}
.terminal-649700464-title {
.terminal-649569392-title {
font-size: 18px;
font-weight: bold;
font-family: arial;
@ -33,95 +33,95 @@
-webkit-filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
}
.terminal-649700464-r1 { fill: #94e2d5;font-weight: bold }
.terminal-649700464-r2 { fill: #c6d0f5 }
.terminal-649700464-r3 { fill: #f5c2e7;font-weight: bold }
.terminal-649700464-r4 { fill: #c6d0f5;font-style: italic;;text-decoration: underline; }
.terminal-649700464-r5 { fill: #f9e2af;font-weight: bold }
.terminal-649700464-r6 { fill: #8288a5 }
.terminal-649569392-r1 { fill: #94e2d5;font-weight: bold }
.terminal-649569392-r2 { fill: #c6d0f5 }
.terminal-649569392-r3 { fill: #f5c2e7;font-weight: bold }
.terminal-649569392-r4 { fill: #c6d0f5;font-style: italic;;text-decoration: underline; }
.terminal-649569392-r5 { fill: #f9e2af;font-weight: bold }
.terminal-649569392-r6 { fill: #8288a5 }
</style>
<defs>
<clipPath id="terminal-649700464-clip-terminal">
<clipPath id="terminal-649569392-clip-terminal">
<rect x="0" y="0" width="609.0" height="413.79999999999995" />
</clipPath>
<clipPath id="terminal-649700464-line-0">
<clipPath id="terminal-649569392-line-0">
<rect x="0" y="1.5" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-1">
<clipPath id="terminal-649569392-line-1">
<rect x="0" y="25.9" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-2">
<clipPath id="terminal-649569392-line-2">
<rect x="0" y="50.3" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-3">
<clipPath id="terminal-649569392-line-3">
<rect x="0" y="74.7" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-4">
<clipPath id="terminal-649569392-line-4">
<rect x="0" y="99.1" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-5">
<clipPath id="terminal-649569392-line-5">
<rect x="0" y="123.5" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-6">
<clipPath id="terminal-649569392-line-6">
<rect x="0" y="147.9" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-7">
<clipPath id="terminal-649569392-line-7">
<rect x="0" y="172.3" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-8">
<clipPath id="terminal-649569392-line-8">
<rect x="0" y="196.7" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-9">
<clipPath id="terminal-649569392-line-9">
<rect x="0" y="221.1" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-10">
<clipPath id="terminal-649569392-line-10">
<rect x="0" y="245.5" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-11">
<clipPath id="terminal-649569392-line-11">
<rect x="0" y="269.9" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-12">
<clipPath id="terminal-649569392-line-12">
<rect x="0" y="294.3" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-13">
<clipPath id="terminal-649569392-line-13">
<rect x="0" y="318.7" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-14">
<clipPath id="terminal-649569392-line-14">
<rect x="0" y="343.1" width="610" height="24.65"/>
</clipPath>
<clipPath id="terminal-649700464-line-15">
<clipPath id="terminal-649569392-line-15">
<rect x="0" y="367.5" width="610" height="24.65"/>
</clipPath>
</defs>
<rect fill="#1e1e2e" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="10.1667" y="1" width="626" height="462.8" rx="8"/><text class="terminal-649700464-title" fill="#c6d0f5" text-anchor="middle" x="313" y="27">make&#160;help</text>
<rect fill="#1e1e2e" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="10.1667" y="1" width="626" height="462.8" rx="8"/><text class="terminal-649569392-title" fill="#c6d0f5" text-anchor="middle" x="313" y="27">make&#160;help</text>
<g transform="translate(32,22)">
<circle cx="0" cy="0" r="7" fill="#ff5f57"/>
<circle cx="22" cy="0" r="7" fill="#febc2e"/>
<circle cx="44" cy="0" r="7" fill="#28c840"/>
</g>
<g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-649700464-clip-terminal)">
<g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-649569392-clip-terminal)">
<g class="terminal-649700464-matrix">
<text class="terminal-649700464-r1" x="0" y="20" textLength="73.2" clip-path="url(#terminal-649700464-line-0)">usage:</text><text class="terminal-649700464-r2" x="610" y="20" textLength="12.2" clip-path="url(#terminal-649700464-line-0)">
</text><text class="terminal-649700464-r2" x="97.6" y="44.4" textLength="158.6" clip-path="url(#terminal-649700464-line-1)">make&#160;&lt;recipe&gt;</text><text class="terminal-649700464-r2" x="610" y="44.4" textLength="12.2" clip-path="url(#terminal-649700464-line-1)">
</text><text class="terminal-649700464-r2" x="610" y="68.8" textLength="12.2" clip-path="url(#terminal-649700464-line-2)">
</text><text class="terminal-649700464-r2" x="0" y="93.2" textLength="146.4" clip-path="url(#terminal-649700464-line-3)">&#160;&#160;Turn&#160;your&#160;</text><text class="terminal-649700464-r3" x="146.4" y="93.2" textLength="122" clip-path="url(#terminal-649700464-line-3)">`Makefile`</text><text class="terminal-649700464-r2" x="268.4" y="93.2" textLength="61" clip-path="url(#terminal-649700464-line-3)">&#160;into</text><text class="terminal-649700464-r2" x="610" y="93.2" textLength="12.2" clip-path="url(#terminal-649700464-line-3)">
</text><text class="terminal-649700464-r2" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-649700464-line-4)">&#160;&#160;the&#160;</text><text class="terminal-649700464-r4" x="73.2" y="117.6" textLength="134.2" clip-path="url(#terminal-649700464-line-4)">task&#160;runner</text><text class="terminal-649700464-r2" x="207.4" y="117.6" textLength="231.8" clip-path="url(#terminal-649700464-line-4)">&#160;you&#160;always&#160;needed.</text><text class="terminal-649700464-r2" x="610" y="117.6" textLength="12.2" clip-path="url(#terminal-649700464-line-4)">
</text><text class="terminal-649700464-r2" x="0" y="142" textLength="378.2" clip-path="url(#terminal-649700464-line-5)">&#160;&#160;See&#160;the&#160;example&#160;output&#160;below.</text><text class="terminal-649700464-r2" x="610" y="142" textLength="12.2" clip-path="url(#terminal-649700464-line-5)">
</text><text class="terminal-649700464-r2" x="610" y="166.4" textLength="12.2" clip-path="url(#terminal-649700464-line-6)">
</text><text class="terminal-649700464-r5" x="0" y="190.8" textLength="109.8" clip-path="url(#terminal-649700464-line-7)">bootstrap</text><text class="terminal-649700464-r2" x="109.8" y="190.8" textLength="36.6" clip-path="url(#terminal-649700464-line-7)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="190.8" textLength="366" clip-path="url(#terminal-649700464-line-7)">generate&#160;local&#160;dev&#160;environment</text><text class="terminal-649700464-r2" x="610" y="190.8" textLength="12.2" clip-path="url(#terminal-649700464-line-7)">
</text><text class="terminal-649700464-r5" x="0" y="215.2" textLength="109.8" clip-path="url(#terminal-649700464-line-8)">&#160;&#160;&#160;&#160;&#160;lint</text><text class="terminal-649700464-r2" x="109.8" y="215.2" textLength="36.6" clip-path="url(#terminal-649700464-line-8)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="215.2" textLength="183" clip-path="url(#terminal-649700464-line-8)">lint&#160;the&#160;python</text><text class="terminal-649700464-r2" x="610" y="215.2" textLength="12.2" clip-path="url(#terminal-649700464-line-8)">
</text><text class="terminal-649700464-r5" x="0" y="239.6" textLength="109.8" clip-path="url(#terminal-649700464-line-9)">&#160;&#160;&#160;assets</text><text class="terminal-649700464-r2" x="109.8" y="239.6" textLength="36.6" clip-path="url(#terminal-649700464-line-9)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="239.6" textLength="183" clip-path="url(#terminal-649700464-line-9)">generate&#160;assets</text><text class="terminal-649700464-r2" x="610" y="239.6" textLength="12.2" clip-path="url(#terminal-649700464-line-9)">
</text><text class="terminal-649700464-r5" x="0" y="264" textLength="109.8" clip-path="url(#terminal-649700464-line-10)">&#160;&#160;&#160;list-%</text><text class="terminal-649700464-r2" x="109.8" y="264" textLength="36.6" clip-path="url(#terminal-649700464-line-10)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="264" textLength="366" clip-path="url(#terminal-649700464-line-10)">use&#160;pathlib.Path&#160;to&#160;list&#160;files</text><text class="terminal-649700464-r2" x="610" y="264" textLength="12.2" clip-path="url(#terminal-649700464-line-10)">
</text><text class="terminal-649700464-r5" x="0" y="288.4" textLength="109.8" clip-path="url(#terminal-649700464-line-11)">&#160;&#160;release</text><text class="terminal-649700464-r2" x="109.8" y="288.4" textLength="36.6" clip-path="url(#terminal-649700464-line-11)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="288.4" textLength="366" clip-path="url(#terminal-649700464-line-11)">release&#160;new&#160;version&#160;of&#160;task.mk</text><text class="terminal-649700464-r2" x="610" y="288.4" textLength="12.2" clip-path="url(#terminal-649700464-line-11)">
</text><text class="terminal-649700464-r5" x="0" y="312.8" textLength="109.8" clip-path="url(#terminal-649700464-line-12)">&#160;c,&#160;clean</text><text class="terminal-649700464-r2" x="109.8" y="312.8" textLength="36.6" clip-path="url(#terminal-649700464-line-12)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="312.8" textLength="317.2" clip-path="url(#terminal-649700464-line-12)">remove&#160;the&#160;generated&#160;files</text><text class="terminal-649700464-r2" x="610" y="312.8" textLength="12.2" clip-path="url(#terminal-649700464-line-12)">
</text><text class="terminal-649700464-r5" x="0" y="337.2" textLength="109.8" clip-path="url(#terminal-649700464-line-13)">&#160;&#160;&#160;&#160;&#160;info</text><text class="terminal-649700464-r2" x="109.8" y="337.2" textLength="36.6" clip-path="url(#terminal-649700464-line-13)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="337.2" textLength="329.4" clip-path="url(#terminal-649700464-line-13)">demonstrate&#160;usage&#160;of&#160;tprint</text><text class="terminal-649700464-r2" x="610" y="337.2" textLength="12.2" clip-path="url(#terminal-649700464-line-13)">
</text><text class="terminal-649700464-r5" x="0" y="361.6" textLength="109.8" clip-path="url(#terminal-649700464-line-14)">&#160;&#160;h,&#160;help</text><text class="terminal-649700464-r2" x="109.8" y="361.6" textLength="36.6" clip-path="url(#terminal-649700464-line-14)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="361.6" textLength="170.8" clip-path="url(#terminal-649700464-line-14)">show&#160;this&#160;help</text><text class="terminal-649700464-r2" x="610" y="361.6" textLength="12.2" clip-path="url(#terminal-649700464-line-14)">
</text><text class="terminal-649700464-r2" x="610" y="386" textLength="12.2" clip-path="url(#terminal-649700464-line-15)">
</text><text class="terminal-649700464-r2" x="0" y="410.4" textLength="610" clip-path="url(#terminal-649700464-line-16)">for&#160;more&#160;info:&#160;see&#160;github.com/daylinmorgan/task.mk</text><text class="terminal-649700464-r2" x="610" y="410.4" textLength="12.2" clip-path="url(#terminal-649700464-line-16)">
<g class="terminal-649569392-matrix">
<text class="terminal-649569392-r1" x="0" y="20" textLength="73.2" clip-path="url(#terminal-649569392-line-0)">usage:</text><text class="terminal-649569392-r2" x="610" y="20" textLength="12.2" clip-path="url(#terminal-649569392-line-0)">
</text><text class="terminal-649569392-r2" x="97.6" y="44.4" textLength="158.6" clip-path="url(#terminal-649569392-line-1)">make&#160;&lt;recipe&gt;</text><text class="terminal-649569392-r2" x="610" y="44.4" textLength="12.2" clip-path="url(#terminal-649569392-line-1)">
</text><text class="terminal-649569392-r2" x="610" y="68.8" textLength="12.2" clip-path="url(#terminal-649569392-line-2)">
</text><text class="terminal-649569392-r2" x="0" y="93.2" textLength="146.4" clip-path="url(#terminal-649569392-line-3)">&#160;&#160;Turn&#160;your&#160;</text><text class="terminal-649569392-r3" x="146.4" y="93.2" textLength="122" clip-path="url(#terminal-649569392-line-3)">`Makefile`</text><text class="terminal-649569392-r2" x="268.4" y="93.2" textLength="61" clip-path="url(#terminal-649569392-line-3)">&#160;into</text><text class="terminal-649569392-r2" x="610" y="93.2" textLength="12.2" clip-path="url(#terminal-649569392-line-3)">
</text><text class="terminal-649569392-r2" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-649569392-line-4)">&#160;&#160;the&#160;</text><text class="terminal-649569392-r4" x="73.2" y="117.6" textLength="134.2" clip-path="url(#terminal-649569392-line-4)">task&#160;runner</text><text class="terminal-649569392-r2" x="207.4" y="117.6" textLength="231.8" clip-path="url(#terminal-649569392-line-4)">&#160;you&#160;always&#160;needed.</text><text class="terminal-649569392-r2" x="610" y="117.6" textLength="12.2" clip-path="url(#terminal-649569392-line-4)">
</text><text class="terminal-649569392-r2" x="0" y="142" textLength="378.2" clip-path="url(#terminal-649569392-line-5)">&#160;&#160;See&#160;the&#160;example&#160;output&#160;below.</text><text class="terminal-649569392-r2" x="610" y="142" textLength="12.2" clip-path="url(#terminal-649569392-line-5)">
</text><text class="terminal-649569392-r2" x="610" y="166.4" textLength="12.2" clip-path="url(#terminal-649569392-line-6)">
</text><text class="terminal-649569392-r5" x="0" y="190.8" textLength="109.8" clip-path="url(#terminal-649569392-line-7)">bootstrap</text><text class="terminal-649569392-r2" x="109.8" y="190.8" textLength="36.6" clip-path="url(#terminal-649569392-line-7)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="190.8" textLength="366" clip-path="url(#terminal-649569392-line-7)">generate&#160;local&#160;dev&#160;environment</text><text class="terminal-649569392-r2" x="610" y="190.8" textLength="12.2" clip-path="url(#terminal-649569392-line-7)">
</text><text class="terminal-649569392-r5" x="0" y="215.2" textLength="109.8" clip-path="url(#terminal-649569392-line-8)">&#160;&#160;&#160;&#160;&#160;lint</text><text class="terminal-649569392-r2" x="109.8" y="215.2" textLength="36.6" clip-path="url(#terminal-649569392-line-8)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="215.2" textLength="183" clip-path="url(#terminal-649569392-line-8)">lint&#160;the&#160;python</text><text class="terminal-649569392-r2" x="610" y="215.2" textLength="12.2" clip-path="url(#terminal-649569392-line-8)">
</text><text class="terminal-649569392-r5" x="0" y="239.6" textLength="109.8" clip-path="url(#terminal-649569392-line-9)">&#160;&#160;&#160;assets</text><text class="terminal-649569392-r2" x="109.8" y="239.6" textLength="36.6" clip-path="url(#terminal-649569392-line-9)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="239.6" textLength="183" clip-path="url(#terminal-649569392-line-9)">generate&#160;assets</text><text class="terminal-649569392-r2" x="610" y="239.6" textLength="12.2" clip-path="url(#terminal-649569392-line-9)">
</text><text class="terminal-649569392-r5" x="0" y="264" textLength="109.8" clip-path="url(#terminal-649569392-line-10)">&#160;&#160;&#160;list-%</text><text class="terminal-649569392-r2" x="109.8" y="264" textLength="36.6" clip-path="url(#terminal-649569392-line-10)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="264" textLength="366" clip-path="url(#terminal-649569392-line-10)">use&#160;pathlib.Path&#160;to&#160;list&#160;files</text><text class="terminal-649569392-r2" x="610" y="264" textLength="12.2" clip-path="url(#terminal-649569392-line-10)">
</text><text class="terminal-649569392-r5" x="0" y="288.4" textLength="109.8" clip-path="url(#terminal-649569392-line-11)">&#160;&#160;release</text><text class="terminal-649569392-r2" x="109.8" y="288.4" textLength="36.6" clip-path="url(#terminal-649569392-line-11)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="288.4" textLength="366" clip-path="url(#terminal-649569392-line-11)">release&#160;new&#160;version&#160;of&#160;task.mk</text><text class="terminal-649569392-r2" x="610" y="288.4" textLength="12.2" clip-path="url(#terminal-649569392-line-11)">
</text><text class="terminal-649569392-r5" x="0" y="312.8" textLength="109.8" clip-path="url(#terminal-649569392-line-12)">&#160;c,&#160;clean</text><text class="terminal-649569392-r2" x="109.8" y="312.8" textLength="36.6" clip-path="url(#terminal-649569392-line-12)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="312.8" textLength="317.2" clip-path="url(#terminal-649569392-line-12)">remove&#160;the&#160;generated&#160;files</text><text class="terminal-649569392-r2" x="610" y="312.8" textLength="12.2" clip-path="url(#terminal-649569392-line-12)">
</text><text class="terminal-649569392-r5" x="0" y="337.2" textLength="109.8" clip-path="url(#terminal-649569392-line-13)">&#160;&#160;&#160;&#160;&#160;info</text><text class="terminal-649569392-r2" x="109.8" y="337.2" textLength="36.6" clip-path="url(#terminal-649569392-line-13)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="337.2" textLength="329.4" clip-path="url(#terminal-649569392-line-13)">demonsrtate&#160;usage&#160;of&#160;tprint</text><text class="terminal-649569392-r2" x="610" y="337.2" textLength="12.2" clip-path="url(#terminal-649569392-line-13)">
</text><text class="terminal-649569392-r5" x="0" y="361.6" textLength="109.8" clip-path="url(#terminal-649569392-line-14)">&#160;&#160;h,&#160;help</text><text class="terminal-649569392-r2" x="109.8" y="361.6" textLength="36.6" clip-path="url(#terminal-649569392-line-14)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="361.6" textLength="170.8" clip-path="url(#terminal-649569392-line-14)">show&#160;this&#160;help</text><text class="terminal-649569392-r2" x="610" y="361.6" textLength="12.2" clip-path="url(#terminal-649569392-line-14)">
</text><text class="terminal-649569392-r2" x="610" y="386" textLength="12.2" clip-path="url(#terminal-649569392-line-15)">
</text><text class="terminal-649569392-r2" x="0" y="410.4" textLength="610" clip-path="url(#terminal-649569392-line-16)">for&#160;more&#160;info:&#160;see&#160;github.com/daylinmorgan/task.mk</text><text class="terminal-649569392-r2" x="610" y="410.4" textLength="12.2" clip-path="url(#terminal-649569392-line-16)">
</text>
</g>
</g>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -1,3 +1,5 @@
define #% block name %##% endblock %#_py
#% block script %##% endblock %#
endef

View file

@ -1,6 +1,7 @@
#% extends "py-script.mk" %#
#% block name %#vars#% endblock %#
#% block script %#
import os
##- '$(ansi_py)' -##

13
task.mk
View file

@ -1,7 +1,7 @@
# }> [github.com/daylinmorgan/task.mk] <{ #
# Copyright (c) 2022 Daylin Morgan
# MIT License
# v22.9.5-3-g9c67418
# 22.9.5
#
# task.mk should be included at the bottom of your Makefile.
# See below for the standard configuration options that should be set prior to including this file.
@ -103,6 +103,7 @@ pysh = printf "$(call create_string,$($(1)))" | python3
define help_py
import os
import re
@ -140,10 +141,12 @@ for goal, msg in goals:
print(f"""$(EPILOG)""")
endef
define ansi_py
import os
import sys
@ -194,18 +197,22 @@ class Ansi:
a = ansi = Ansi()
endef
define info_py
$(ansi_py)
print(f"""$(2)""")
endef
define print_ansi_py
$(ansi_py)
codes_names = {
@ -217,10 +224,13 @@ for code in sorted(codes_names.keys(), key=lambda item: (len(item), item)):
print("{:>20} {}".format(codes_names[code], code + "******" + ansi.end))
endef
define vars_py
import os
$(ansi_py)
@ -235,5 +245,6 @@ for v in vars:
print()
endef