forked from andonome/lk
generate db with makefile
This commit is contained in:
parent
808ef3bb71
commit
bbd34e24ec
27
Makefile
Normal file
27
Makefile
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
help: ## Print the help message
|
||||||
|
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
|
||||||
|
sort | \
|
||||||
|
column -s ':' -t
|
||||||
|
|
||||||
|
articles != find * -type f -name "*.md"
|
||||||
|
|
||||||
|
db.rec: $(articles)
|
||||||
|
for x in $^ ; do \
|
||||||
|
sed -n '2,/^---$$/ {/^---$$/d; p}' "$$x" |\
|
||||||
|
tr -d '"[]' ;\
|
||||||
|
printf "file: %s\n\n" "$$x" ;\
|
||||||
|
done > $@
|
||||||
|
|
||||||
|
default += db.rec
|
||||||
|
|
||||||
|
.git/info/exclude: $(default)
|
||||||
|
echo $^ | tr ' ' '\n' > $@
|
||||||
|
|
||||||
|
default += .git/info/exclude
|
||||||
|
|
||||||
|
.PHONY: database
|
||||||
|
database: $(default) ## Make a database for recfiles
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
$(RM) $(default)
|
Loading…
Reference in New Issue
Block a user