This repository was archived by the owner on Apr 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (61 loc) · 1.48 KB
/
Makefile
File metadata and controls
76 lines (61 loc) · 1.48 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
N_CPUS := $(shell nproc 2> /dev/null || gnproc 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null)
MAKEFLAGS := --no-builtin-rules -j $(N_CPUS)
USER := xand
HOST := hackfreeordie.org
PORT := 22
USER_AT_HOST := $(USER)@$(HOST)
DIR_EMAIL := email
DIR_WEB_LOCAL := www
DIR_WEB_SERVER := /var/www
CMD_GENERATE := ./generate
.PHONY: build
build: web email
.PHONY: web
web:
mkdir -p $(DIR_WEB_LOCAL)
$(CMD_GENERATE) -o $(DIR_WEB_LOCAL) web
.PHONY: email
email:
mkdir -p $(DIR_EMAIL)
$(CMD_GENERATE) -o $(DIR_EMAIL) email
.PHONY: serve
serve:
./serve --dev --port 8080 $(DIR_WEB_LOCAL)
.PHONY: rebuild
rebuild: clean
$(MAKE) build
.PHONY: clean
clean:
rm -rf $(DIR_WEB_LOCAL) $(DIR_EMAIL)
.PHONY: preview
preview: rebuild
$(MAKE) serve
.PHONY: publish
publish:
rsync \
-avz \
--delete \
--omit-dir-times \
--copy-links \
./$(DIR_WEB_LOCAL)/* \
-e 'ssh -p $(PORT)' \
$(USER_AT_HOST):$(DIR_WEB_SERVER)
ssh -p $(PORT) $(USER_AT_HOST) chmod -R a+rX $(DIR_WEB_SERVER)
.PHONY: deps
deps:
raco pkg install --skip-installed --auto gregor markdown text-block
.PHONY: TODO
TODO:
@grep \
--exclude=Makefile \
--exclude-dir=view \
--exclude-dir=$(DIR_WEB_LOCAL) \
--exclude-dir=.git \
--color=always \
-rIHn TODO .
.PHONY: strip
strip:
# Strip metadata from photos:
find data/meetings -maxdepth 2 -type d -name photos \
| xargs -I% find % -maxdepth 1 -type f -iname '*.jp*g' \
| xargs -P $(N_CPUS) -I% sh -c 'exiftool -all= % && rm -f %_original'