This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
179 lines (141 loc) · 4.03 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
V=0.26
TOOLS = artools
PREFIX ?= /usr
SYSCONFDIR = /etc
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share
BASE_CONF = \
data/conf/artools-base.conf
BASE_BIN = \
bin/base/chroot-run \
bin/base/mkchroot \
bin/base/basestrap \
bin/base/artix-chroot \
bin/base/fstabgen
BASE_DATA = \
$(wildcard data/pacman/pacman*.conf)
PKG_CONF = \
data/conf/artools-pkg.conf
SETARCH_ALIASES = \
PKG_BIN = \
bin/pkg/buildpkg \
bin/pkg/deploypkg \
bin/pkg/commitpkg \
bin/pkg/comparepkg \
bin/pkg/mkchrootpkg \
bin/pkg/pkg2yaml \
bin/pkg/buildtree \
bin/pkg/lddd \
bin/pkg/links-add \
bin/pkg/checkpkg \
bin/pkg/finddeps \
bin/pkg/find-libdeps \
bin/pkg/batchpkg \
bin/pkg/signpkg \
bin/pkg/checkrepo \
bin/pkg/gitearepo
LN_COMMITPKG = \
extrapkg \
corepkg \
testingpkg \
stagingpkg \
communitypkg \
community-testingpkg \
community-stagingpkg \
multilibpkg \
multilib-testingpkg \
multilib-stagingpkg \
kde-unstablepkg \
gnome-unstablepkg \
rebuildpkg
LN_BUILDPKG = \
buildpkg-system \
buildpkg-world \
buildpkg-gremlins \
buildpkg-goblins \
buildpkg-galaxy \
buildpkg-galaxy-gremlins \
buildpkg-galaxy-goblins \
buildpkg-lib32 \
buildpkg-lib32-gremlins \
buildpkg-lib32-goblins \
buildpkg-kde-wobble \
buildpkg-gnome-wobble
LN_DEPLOYPKG = \
deploypkg-system \
deploypkg-world \
deploypkg-gremlins \
deploypkg-goblins \
deploypkg-galaxy \
deploypkg-galaxy-gremlins \
deploypkg-galaxy-goblins \
deploypkg-lib32 \
deploypkg-lib32-gremlins \
deploypkg-lib32-goblins \
deploypkg-kde-wobble \
deploypkg-gnome-wobble
PKG_DATA = \
data/pacman/makepkg.conf \
data/valid-names.conf
PATCHES = \
$(wildcard data/patches/*.patch)
ISO_CONF = \
data/conf/artools-iso.conf
ISO_BIN = \
bin/iso/buildiso
LN_BUILDISO = \
buildiso-gremlins \
buildiso-goblins
DIRMODE = -dm0755
FILEMODE = -m0644
MODE = -m0755
LN = ln -sf
RM = rm -f
M4 = m4 -P --define=m4_artools_pkg_version=$V
CHMODAW = chmod a-w
CHMODX = chmod +x
BIN = $(BASE_BIN) $(PKG_BIN) $(ISO_BIN)
all: $(BIN)
EDIT = sed -e "s|@datadir[@]|$(DATADIR)|g" \
-e "s|@sysconfdir[@]|$(SYSCONFDIR)|g"
%: %.in Makefile lib/util-base.sh
@echo "GEN $@"
@$(RM) "$@"
@{ echo -n 'm4_changequote([[[,]]])'; cat $@.in; } | $(M4) | $(EDIT) >$@
@$(CHMODAW) "$@"
@$(CHMODX) "$@"
@bash -O extglob -n "$@"
clean:
$(RM) $(BIN)
install_base:
install $(DIRMODE) $(DESTDIR)$(SYSCONFDIR)/$(TOOLS)
install $(FILEMODE) $(BASE_CONF) $(DESTDIR)$(SYSCONFDIR)/$(TOOLS)
install $(DIRMODE) $(DESTDIR)$(BINDIR)
install $(MODE) $(BASE_BIN) $(DESTDIR)$(BINDIR)
install $(DIRMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)
install $(FILEMODE) $(BASE_DATA) $(DESTDIR)$(DATADIR)/$(TOOLS)
install $(DIRMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)/setarch-aliases.d
for a in ${SETARCH_ALIASES}; do install $(FILEMODE) setarch-aliases.d/$$a $(DESTDIR)$(DATADIR)/$(TOOLS)/setarch-aliases.d; done
install_pkg:
install $(DIRMODE) $(DESTDIR)$(SYSCONFDIR)/$(TOOLS)
install $(FILEMODE) $(PKG_CONF) $(DESTDIR)$(SYSCONFDIR)/$(TOOLS)
install $(DIRMODE) $(DESTDIR)$(BINDIR)
install $(MODE) $(PKG_BIN) $(DESTDIR)$(BINDIR)
$(LN) find-libdeps $(DESTDIR)$(BINDIR)/find-libprovides
$(LN) links-add $(DESTDIR)$(BINDIR)/links-remove
for l in $(LN_COMMITPKG); do $(LN) commitpkg $(DESTDIR)$(BINDIR)/$$l; done
for l in $(LN_BUILDPKG); do $(LN) buildpkg $(DESTDIR)$(BINDIR)/$$l; done
for l in $(LN_DEPLOYPKG); do $(LN) deploypkg $(DESTDIR)$(BINDIR)/$$l; done
$(LN) artix-chroot $(DESTDIR)$(BINDIR)/artools-chroot
install $(DIRMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)
install $(FILEMODE) $(PKG_DATA) $(DESTDIR)$(DATADIR)/$(TOOLS)
install $(DIRMODE) $(DESTDIR)$(DATADIR)/$(TOOLS)/patches
install $(FILEMODE) $(PATCHES) $(DESTDIR)$(DATADIR)/$(TOOLS)/patches
install_iso:
install $(DIRMODE) $(DESTDIR)$(SYSCONFDIR)/$(TOOLS)
install $(FILEMODE) $(ISO_CONF) $(DESTDIR)$(SYSCONFDIR)/$(TOOLS)
install $(DIRMODE) $(DESTDIR)$(BINDIR)
install $(MODE) $(ISO_BIN) $(DESTDIR)$(BINDIR)
for l in $(LN_BUILDISO); do $(LN) buildiso $(DESTDIR)$(BINDIR)/$$l; done
install: install_base install_pkg install_iso
.PHONY: all clean install install_base install_pkg install_iso