-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
47 lines (37 loc) · 950 Bytes
/
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
LINKY := python ./scripts/linky.py
MD_SRC := $(shell find . -name '*.md')
.DEFAULT_GOAL: help
.PHONY: help
help :
@echo "Makefile for TerraFirmaCraft/Documentation"
@echo " help : Show this information"
@echo " deploy : Build and host the documentation"
@echo " test : Run validations and sanitize"
@echo " dos2unix : Run dos2unix on all .md files"
@echo " setup-wsl : Setup script for WSL"
.PHONY: deploy
deploy: test
bundle exec jekyll serve
.PHONY: fix
fix: dos2unix tab2space test
.PHONY: test
test:
$(LINKY) validate
$(LINKY) sanitize
.PHONY: dos2unix
dos2unix:
@dos2unix $(MD_SRC)
.PHONY: tab2space
tab2space:
-@for f in $(MD_SRC) ; do \
expand -t 4 $$f > $$f.new ; \
rm $$f ; \
mv $$f.new $$f ; \
done
.PHONY: setup-wsl
setup-wsl:
sudo apt install make gcc g++
sudo apt-get install glib1g-dev liblzma-dev patch
sudo apt install ruby-full
sudo gem install jekyll bundler
sudo bundle install