This repository has been archived by the owner on Feb 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
76 lines (56 loc) · 1.79 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
69
70
71
72
73
74
75
76
# makefile --- main makefile for Göktuğ's configuration.
export UMASK=
SYSTEM_CONFIG_DIR = systems/$(shell hostname)
all: help
### Help:
help:
@echo "System type: $(HOST)";\
echo "Targets:";\
echo " setup set up $$HOME and $$USER after system initialisation";\
echo " setup-light like above, but skip building binaries";\
echo " src build programs in src/";\
echo " emacs.d build emacs's configs, extensions, pakcages";\
echo " invade run invasion";\
echo " dotfiles build dotfiles";\
echo " clean delete build artefacts";
### System initialisation:
.PHONY: setup setup-light fetch-config.m4 etc
setup: fetch-config.m4 dotfiles invade emacs.d src
sh lib/setup.sh
setup-light: fetch-config.m4 dotfiles invade src
@echo === Done, consider running make setup later
invade:
./bin/invade -v $(HOME)
$(MAKE) -C emacs.d -$(MAKEFLAGS) invade
ifneq ($(wildcard $(SYSTEM_CONFIG_DIR)),) # if $SYSTEM_CONFIG_DIR exists, run its invasion
cd $(SYSTEM_CONFIG_DIR) && ../../bin/invade -v $(HOME)
endif
fetch-config.m4:
if [ -e config.m4 ]; then \
:; \
elif [ -e ../store/config.m4 ]; then \
cp ../store/config.m4 . ;\
elif [ -e $(HOME)/Documents/config.m4 ]; then \
cp $(HOME)/Documents/config.m4 . ;\
else \
touch config.m4 ;\
fi
### Build rules:
emacs.d:
$(MAKE) -C emacs.d -$(MAKEFLAGS) all
dotfiles:
$(MAKE) -C dotfiles -$(MAKEFLAGS) all
src:
$(MAKE) -C src -$(MAKEFLAGS) all
### Clean:
clean-dotfiles:
$(MAKE) -C dotfiles -$(MAKEFLAGS) clean
clean-src:
$(MAKE) -C src -$(MAKEFLAGS) clean
clean: clean-bin clean-dotfiles
deep-clean:
git clean -dfx
### Postamble:
.PHONY: all build dotfiles clean src clean-src
.PHONY: clean-dotfiles deep-clean emacs.d
.PHONY: fetch-config.m4