-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
68 lines (49 loc) · 1.83 KB
/
Makefile
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
-include config.mk
BUILD_DIR = user-manual/
PATHSVR=/var/www/manuals.cc4s.org
PORT = 8888
EMACS_BIN ?= emacs
EMACS = $(EMACS_BIN) -Q --batch
INDEX = index.org
ORGFILES = $(shell find . -name '*.org')
ID_LOCATION_FILE = id-locations
SITEMAPS = algorithms/sitemap.org objects/sitemap.org
TANGLING_FILES = $(shell find . -name '*.org' | xargs grep -H tangle | awk -F: '{print $$1}')
TANGLING_FILES_DIR = .emacs/tangle
TANGLING_FILES_CACHE = $(patsubst %,$(TANGLING_FILES_DIR)/%,$(TANGLING_FILES))
$(TANGLING_FILES_DIR)/%: %
mkdir -p $(@D)
$(EMACS) $< -f org-babel-tangle && touch $@
publish: $(ORGFILES) tangle sitemaps
$(EMACS) --load config/site.el $(INDEX) -f cc4s/publish-site
tangle: $(TANGLING_FILES_CACHE)
force:
touch $(ORGFILES)
$(MAKE) publish
refresh:
$(EMACS) --load config/site.el $(INDEX) -f package-refresh-contents
clean:
rm -r $(BUILD_DIR) $(ID_LOCATION_FILE) sitemap.org .emacs/org-timestamps* \
$(SITEMAPS)
clean-emacs:
rm -r .emacs
algorithms/sitemap.org: $(shell find algorithms/ | grep -v sitemap.org)
./tools/create-sitemap.sh "Algorithm List" algorithms/ > $@
objects/sitemap.org: $(shell find objects/ | grep -v sitemap.org)
./tools/create-sitemap.sh "Object List" objects/ > $@
sitemaps: $(SITEMAPS)
clean-all: clean clean-emacs
serve:
python3 -m http.server $(PORT)
vim:
mkdir -p ~/.vim/ftdetect
mkdir -p ~/.vim/syntax
wget https://raw.githubusercontent.com/alejandrogallo/org-syntax.vim/main/ftdetect/org.vim \
-O ~/.vim/ftdetect/org.vim
wget https://raw.githubusercontent.com/alejandrogallo/org-syntax.vim/main/syntax/org.vim \
-O ~/.vim/syntax/org.vim
deploy: user-manual
rsync --recursive --itemize-changes --delete user-manual $(PATHSVR)
# rsync --recursive --itemize-changes --delete data $(PATHSVR)
.PHONY: sitemaps
.PHONY: init serve publish tangle refresh clean clean-emacs clean-all force vim