summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: a8461d846ba45d78e0d189559a28ab29e0db20e8 (plain) (blame)
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
#!/usr/bin/env make
# license: gnu gpl version 3 or higher.
# copyright 2016 rsiddharth <s@ricketyspace.net>

guile=$(shell which guile)

bin=$(HOME)/.bin

git_difme=$(bin)/git-difme
git_difme_src=git-difme.scm

config_dir = $(HOME)/.config/git-difme
config_file=$(config_dir)/config
example_config=examples/config

nothing:
	@echo "Give me something to make. "

.PHONY: nothing

git-difme: $(git_difme)

.PHONY: git-difme

config: $(config_file)

.PHONY: config

docs:
	@make -C docs html

.PHONY: docs

push-docs: docs
	@rsync -avz --delete docs/_build/  $(DIFME_DOCS_HOST)

.PHONY: push-docs

docs-clean:
	@make -C docs clean

.PHONY: docs-clean

$(git_difme): $(git_difme_src)
	@mkdir -p $(bin)
	@touch $@
	@echo "#!"$(guile)" \\ \n-e main -s\n!#" > $@
	@cat $< >> $@
	@chmod +x $@

	@echo "Script at" $@
	@echo "Add" $(bin) "to PATH"

$(config_dir):
	@mkdir -p $@

$(config_file): $(example_config) $(config_dir)
	@cp -i $< $@