-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
94 lines (77 loc) · 2.17 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env make
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
LIBS = \
aur \
base-make \
cleanup \
database \
deploy \
interfere \
mirror \
package-make \
package-makedir \
package-prepare \
pkgrel-incrementer \
routines \
routines-garuda \
routines-tkg \
routines-tkg-wine \
sync \
utils
ROUTINES = \
hourly \
morning \
afternoon \
nightly \
midnight \
garuda \
tkg-kernels \
tkg-wine
GUEST_ETC = pacman.conf makepkg.conf.append
GUEST_BIN = internal-makepkg internal-makepkg-depends x11-wrapper
dir_guard=@install -dm755 "$(@D)"
build/chaotic.elf: src/chaotic.c
$(dir_guard)
gcc -DPREFIX="\"$(PREFIX)\"" $< -o $@
$(DESTDIR)$(PREFIX)/bin/chaotic.sh: src/chaotic.sh
$(dir_guard)
install -m755 $< $@
$(DESTDIR)$(PREFIX)/bin/chaotic: build/chaotic.elf
$(dir_guard)
install -o root -g chaotic_op -m4750 $< $@
$(DESTDIR)$(PREFIX)/lib/chaotic/%.sh: src/lib/%.sh
$(dir_guard)
install -m755 $< $@
$(DESTDIR)$(PREFIX)/lib/chaotic/guest/etc/%: guest/etc/%
$(dir_guard)
install -m644 $< $@
$(DESTDIR)$(PREFIX)/lib/chaotic/guest/bin/%: guest/bin/%
$(dir_guard)
install -m755 $< $@
$(DESTDIR)/var/lib/chaotic/interfere:
$(dir_guard)
cd "$(@D)" && git clone 'https://github.com/chaotic-aur/interfere.git' interfere
$(DESTDIR)/var/lib/chaotic/packages:
$(dir_guard)
cd "$(@D)" && git clone 'https://github.com/chaotic-aur/packages.git' packages
$(DESTDIR)/var/cache/chaotic:
@install -dm755 $@
$(DESTDIR)/usr/lib/systemd/system/%: services/%
install -o root -g root -m755 $< $@
build: build/chaotic.elf
install: \
$(foreach f, $(LIBS), $(DESTDIR)$(PREFIX)/lib/chaotic/${f}.sh) \
$(foreach l, $(GUEST_ETC), $(DESTDIR)$(PREFIX)/lib/chaotic/guest/etc/${l}) \
$(foreach l, $(GUEST_BIN), $(DESTDIR)$(PREFIX)/lib/chaotic/guest/bin/${l}) \
$(DESTDIR)$(PREFIX)/bin/chaotic.sh \
$(DESTDIR)$(PREFIX)/bin/chaotic \
$(DESTDIR)/var/lib/chaotic/interfere \
$(DESTDIR)/var/lib/chaotic/packages \
$(DESTDIR)/var/cache/chaotic
install-services: \
$(foreach s, $(ROUTINES), $(DESTDIR)/usr/lib/systemd/system/chaotic-${s}.service) \
$(foreach s, $(ROUTINES), $(DESTDIR)/usr/lib/systemd/system/chaotic-${s}.timer)
systemctl daemon-reload
.PHONY: install install-services build