-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.gnu
More file actions
70 lines (53 loc) · 1.62 KB
/
Makefile.gnu
File metadata and controls
70 lines (53 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.SUFFIXES:
MYSERVER=my.blog.site
PGOT-LOC=pgot -i ":src/inc" -d '{"siteurl":"$(shell pwd)/bld/loc","dfile":"index.html"}'
PGOT-PUB=pgot -i ":src/inc" -d '{"siteurl":"https://$(MYSERVER)","dfile":""}'
CHUF=chuf '|||md+' '|||md-' markdown
INC=$(shell find src -type f -name '*.igot')
GOT=$(shell find src -type f -name '*.got')
RAW=$(shell find -L src -type f -name '*.raw')
CPY=$(shell find -L src -type f -name '*.cpy')
all loc: $(RAW:src/%.raw=bld/loc/%) \
$(CPY:src/%.cpy=bld/loc/%) \
$(GOT:src/%.got=bld/loc/%.html)
pub: $(RAW:src/%.raw=bld/pub/%) \
$(CPY:src/%.cpy=bld/pub/%) \
$(GOT:src/%.got=bld/pub/%.html)
bld/loc/% bld/pub/%: src/%.raw
@mkdir -p $(@D)
@echo "raw -> $@"
@cp $< $@
bld/loc/% bld/pub/%: src/%.cpy
@mkdir -p $(@D)
@echo "cpy -> $@"
@cp $< $@
bld/loc/%.html: src/%.got $(INC)
@mkdir -p $(@D)
@echo "pgot -> $@"
@$(PGOT-LOC) $< | $(CHUF) > $@
bld/pub/%.html: src/%.got $(INC)
@mkdir -p $(@D)
@echo "pgot -> $@"
@$(PGOT-PUB) $< | $(CHUF) > $@
cogit: bld/cogit.tar cogit-files.txt
@ echo "Moving cogit tarball to release folder"
mkdir -p ../makehtml-release
mv bld/cogit.tar ../makehtml-release/makehtml-cogit-$(shell date +"%Y-%m-%d").tar
CGTMP=cg.tmp
CGSRT=cgsrt.tmp
bld/cogit.tar: $(CGSRT)
@mkdir -p $(@D)
@echo "generating $@"
@tar -T $< -cf $@
cogit-files.txt: $(CGSRT)
@echo "generating $@"
@while read CGFILE; do sha256sum -b "$$CGFILE"; done < $< > $@
$(CGSRT): $(RAW)
@find src -type f -name '*.raw' > $(CGTMP)
@sort < $(CGTMP) > $@
@rm -f $(CGTMP)
clean:
rm -Rf bld *.tmp
lint: loc
@grep -n -r '<no value>' bld/loc/ || true
.PHONY: all loc pub clean lint