-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
99 lines (79 loc) · 3.17 KB
/
Makefile
File metadata and controls
99 lines (79 loc) · 3.17 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#=====================================================================
# make site
#=====================================================================
#=====================================================================
# Setup
#=====================================================================
# CORE MACROS
ifeq ($(OS), Windows_NT)
CD=cd
else
CD=cd -P "$(CURDIR)"; cd # This handles the case when CURDIR is a softlink
endif
CP=cp
MAKE=make
MV=mv
RM=rm -f
MKDIR=mkdir -p
RMDIR=$(RM) -r
ASPELL=aspell
SORT=sort
R_SCRIPT = Rscript
# Capabilities
HAS_ASPELL := $(shell $(R_SCRIPT) -e "cat(Sys.getenv('HAS_ASPELL', !is.na(utils:::aspell_find_program('aspell'))))")
#=====================================================================
# Configs
#=====================================================================
#=====================================================================
# Global
#=====================================================================
all: sites build
#=====================================================================
# Pages
#=====================================================================
build:
$(R_SCRIPT) -e "bhgc.website::build()"
europe:
touch content/sites/germany/index.md
make build
sites: html/sites/index.html
html/sites/index.html: content/sites/sites.dcf content/sites/index.md content/sites/*/index.md content/sites/incl/index.md.rsp R/bhgc_sites.R
touch content/sites/index.md
touch content/sites/*/index.md
make build
tags:
@grep -F "Tags:" content/sites/sites.dcf | sed 's/Tags: //g' | sed 's/, /\n/g' | sort -u
site-pages:
@tags=$$(grep -F "Tags:" content/sites/sites.dcf | sed 's/Tags: //g' | sed 's/, /\n/g' | sort -u); \
for tag in $${tags}; do \
echo "Tag: $${tag}"; \
tag_lc=$$(echo "$${tag}" | tr "[:upper:]" "[:lower:]"); \
dir="content/sites/$${tag_lc}"; \
mkdir -p "$${dir}"; \
file="$${dir}/index.md"; \
if [ ! -f "$${file}" ] ; then \
echo "# Flying Sites - <%= tag <- c(\"$${tag}\" = \"$${tag}\"); tag %>\n\n<%@include file=\"content/sites/incl/index.md.rsp\"%>" > "$${file}"; \
echo "Updated: $${file}"; \
fi; \
done; \
echo "Rerun: make sites"
#=====================================================================
# Publish (=go live!)
#=====================================================================
deploy:
rsync -avvz --perms --chmod=ugo+rx --progress html/ bhgc.org:~/public_html/bhgc.org/
publish: deploy
#=====================================================================
# Archive data bases
#=====================================================================
db_save:
$(MKDIR) db/
wget --no-check-certificate https://bhgc.glidelink.net/hangglider_report -O db/hangglider_report.html
wget --no-check-certificate https://bhgc.glidelink.net/harness_report -O db/harness_report.html
wget --no-check-certificate https://bhgc.glidelink.net/parachute_report -O db/parachute_report.html
wget --no-check-certificate https://bhgc.glidelink.net/pilot_report -O db/pilot_report.html
#=====================================================================
# Cleanups
#=====================================================================
clean:
$(RM) -rf html/