chiark
/
gitweb
/
~mdw
/
epls
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dd8326f
)
Makefile: Improve output appearance.
author
Mark Wooding
<mdw@distorted.org.uk>
Mon, 14 Mar 2022 17:53:42 +0000
(17:53 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Mon, 14 Mar 2022 20:06:38 +0000
(20:06 +0000)
Makefile
patch
|
blob
|
blame
|
history
diff --git
a/Makefile
b/Makefile
index 30acdd803139db645166c77b476ebcaabf21bd6c..8cfecb59d79c0c70accf0574f57a2f58e845712d 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-8,8
+8,11
@@
force:
V ?= 0
V_AT = $(V_AT_$V)
V_AT_0 = @
V ?= 0
V_AT = $(V_AT_$V)
V_AT_0 = @
+v-print = $(call v-print.$V,$1,$2)
+v-print.1 = :
+v-print.0 = printf " %-8s %s\n" "$1" "$2"
v-tag = $(call v-tag.$V,$1)
v-tag = $(call v-tag.$V,$1)
-v-tag.0 = @
printf " %-8s %s\n" "$1" "$@"
;
+v-tag.0 = @
$(call v-print.0,$1,$@)
;
TARGETS =
CLEANFILES += $(TARGETS)
TARGETS =
CLEANFILES += $(TARGETS)
@@
-137,11
+140,22
@@
all: $(TARGETS)
CHECKS = $(foreach p,$(PLAYLISTS), check/$p)
check: $(CHECKS)
$(CHECKS): check/%: %.m3u8
CHECKS = $(foreach p,$(PLAYLISTS), check/$p)
check: $(CHECKS)
$(CHECKS): check/%: %.m3u8
- diff -u $< ref/$*.m3u8
+
$(V_AT)
diff -u $< ref/$*.m3u8
.PHONY: check $(CHECKS)
LINKS = $(foreach p,$(PLAYLISTS), link/$p)
link: $(LINKS)
$(LINKS): link/%:
.PHONY: check $(CHECKS)
LINKS = $(foreach p,$(PLAYLISTS), link/$p)
link: $(LINKS)
$(LINKS): link/%:
- ln -frs $*.m3u8 "$(ARCHIVEROOT)/$($*_INITIAL)/$($*_FULLNAME).m3u8"
+ $(V_AT) \
+ ok=nil t="$(ARCHIVEROOT)/$($*_INITIAL)/$($*_FULLNAME).m3u8"; \
+ if [ -L "$$t" ]; then \
+ case $$(realpath "$$t") in \
+ "$(abspath $*.m3u8)") ok=t ;; \
+ esac; \
+ fi; \
+ case $$ok in \
+ t) ;; \
+ *) $(call v-print,LINK,$*); \
+ ln -frs $*.m3u8 "$$t.new" && mv "$$t.new" "$$t" ;; \
+ esac
.PHONY: link $(LINKS)
.PHONY: link $(LINKS)