-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (34 loc) · 1.41 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
#
# Simple Makefile for Golang based Projects.
#
PROJECT = codemeta-pandoc-examples
VERSION = $(shell grep '"version":' codemeta.json | cut -d\" -f 4)
BRANCH = $(shell git branch | grep '* ' | cut -d\ -f 2)
OS = $(shell uname)
build: CITATION.cff about.md installer.sh
CITATION.cff: .FORCE
@cat codemeta.json | sed -E 's/"@context"/"at__context"/g;s/"@type"/"at__type"/g;s/"@id"/"at__id"/g' >_codemeta.json
@echo '' | pandoc --metadata title="Cite $(PROJECT)" --metadata-file=_codemeta.json --template=codemeta-cff.tmpl >CITATION.cff
about.md: .FORCE
@cat codemeta.json | sed -E 's/"@context"/"at__context"/g;s/"@type"/"at__type"/g;s/"@id"/"at__id"/g' >_codemeta.json
@echo "" | pandoc --metadata-file=_codemeta.json --template codemeta-about.tmpl >about.md 2>/dev/null;
@if [ -f _codemeta.json ]; then rm _codemeta.json; fi
installer.sh: .FORCE
@echo '' | pandoc --metadata title="$(PROJECT)" --metadata-file codemeta.json --template codemeta-installer.tmpl >installer.sh
@chmod 775 installer.sh
@git add -f installer.sh
website: build .FORCE
make -f website.mak
status:
git status
save:
@if [ "$(msg)" != "" ]; then git commit -am "$(msg)"; else git commit -am "Quick Save"; fi
git push origin $(BRANCH)
refresh:
git fetch origin
git pull origin $(BRANCH)
publish: build website save .FORCE
./publish.bash
clean:
@for FNAME in $(HTML_PAGES); do if [ -f "$${FNAME}" ]; then rm "$${FNAME}"; fi; done
.FORCE: