Makefile 7.36 KB
Newer Older
1
Version=0.15.9
udeved's avatar
udeved committed
2

udeved's avatar
udeved committed
3 4
PREFIX = /usr/local
SYSCONFDIR = /etc
udeved's avatar
udeved committed
5

udeved's avatar
udeved committed
6
SYSCONF = \
7 8
	data/manjaro-tools.conf \
	data/branding.desc.d
udeved's avatar
udeved committed
9 10

BIN_BASE = \
udeved's avatar
udeved committed
11 12 13 14
	bin/mkchroot \
	bin/basestrap \
	bin/manjaro-chroot \
	bin/fstabgen \
15
	bin/signfile \
udeved's avatar
udeved committed
16
	bin/chroot-run
udeved's avatar
udeved committed
17

udeved's avatar
udeved committed
18 19 20 21 22 23 24 25 26
LIBS_BASE = \
	lib/util.sh \
	lib/util-mount.sh \
	lib/util-msg.sh \
	lib/util-fstab.sh

SHARED_BASE = \
	data/pacman-default.conf \
	data/pacman-multilib.conf \
27
	data/pacman-mirrors.conf
udeved's avatar
udeved committed
28

udeved's avatar
udeved committed
29
LIST_PKG = \
udeved's avatar
udeved committed
30
	$(wildcard data/pkg.list.d/*.list)
udeved's avatar
udeved committed
31

32
ARCH_CONF = \
udeved's avatar
udeved committed
33
	$(wildcard data/make.conf.d/*.conf)
34

udeved's avatar
udeved committed
35
BIN_PKG = \
udeved's avatar
udeved committed
36 37 38 39 40
	bin/checkpkg \
	bin/lddd \
	bin/finddeps \
	bin/find-libdeps \
	bin/signpkgs \
41
	bin/mkchrootpkg \
udeved's avatar
udeved committed
42
	bin/buildpkg \
udeved's avatar
udeved committed
43
	bin/buildtree
udeved's avatar
udeved committed
44

udeved's avatar
udeved committed
45
LIBS_PKG = \
udeved's avatar
udeved committed
46
	$(wildcard lib/util-pkg*.sh)
udeved's avatar
udeved committed
47

udeved's avatar
udeved committed
48
SHARED_PKG = \
Bernhard Landauer's avatar
Bernhard Landauer committed
49
	data/makepkg.conf
udeved's avatar
udeved committed
50

udeved's avatar
udeved committed
51
LIST_ISO = \
udeved's avatar
udeved committed
52
	$(wildcard data/iso.list.d/*.list)
udeved's avatar
udeved committed
53

udeved's avatar
udeved committed
54 55 56
BIN_ISO = \
	bin/buildiso \
	bin/testiso \
Bernhard Landauer's avatar
Bernhard Landauer committed
57
	bin/deployiso \
Bernhard Landauer's avatar
Bernhard Landauer committed
58
	bin/signiso
udeved's avatar
udeved committed
59 60

LIBS_ISO = \
udeved's avatar
udeved committed
61
	$(wildcard lib/util-iso*.sh) \
62
	lib/util-publish.sh
udeved's avatar
udeved committed
63

udeved's avatar
udeved committed
64
SHARED_ISO = \
65
	data/pacman-mhwd.conf \
artoo's avatar
artoo committed
66
	data/mkinitcpio.conf \
udeved's avatar
udeved committed
67 68
	data/profile.conf.example

udeved's avatar
udeved committed
69
CPIOHOOKS = \
udeved's avatar
udeved committed
70
	$(wildcard initcpio/hooks/*)
udeved's avatar
udeved committed
71

udeved's avatar
udeved committed
72
CPIOINST = \
udeved's avatar
udeved committed
73
	$(wildcard initcpio/install/*)
udeved's avatar
udeved committed
74

75 76 77
CPIO = \
	initcpio/script/miso_shutdown

Ramon Buldó's avatar
Ramon Buldó committed
78
MAN_XML = \
79 80
	buildpkg.xml \
	buildtree.xml \
Ramon Buldó's avatar
Ramon Buldó committed
81
	buildiso.xml \
udeved's avatar
udeved committed
82
	deployiso.xml \
udeved's avatar
udeved committed
83
	check-yaml.xml \
Ramon Buldó's avatar
Ramon Buldó committed
84 85
	manjaro-tools.conf.xml \
	profile.conf.xml
Ramon Buldó's avatar
Ramon Buldó committed
86

87 88 89 90
BIN_YAML = \
	bin/check-yaml

LIBS_YAML = \
91
	lib/util-yaml.sh
92 93

SHARED_YAML = \
94 95
	data/linux.preset

96
all: $(BIN_BASE) $(BIN_PKG) $(BIN_ISO) $(BIN_YAML) doc
udeved's avatar
udeved committed
97

udeved's avatar
udeved committed
98
edit = sed -e "s|@datadir[@]|$(DESTDIR)$(PREFIX)/share/manjaro-tools|g" \
99
	-e "s|@sysconfdir[@]|$(DESTDIR)$(SYSCONFDIR)/manjaro-tools|g" \
artoo's avatar
artoo committed
100
	-e "s|@libdir[@]|$(DESTDIR)$(PREFIX)/lib/manjaro-tools|g" \
udeved's avatar
udeved committed
101
	-e "s|@version@|${Version}|"
102 103

%: %.in Makefile
udeved's avatar
udeved committed
104 105 106 107 108 109
	@echo "GEN $@"
	@$(RM) "$@"
	@m4 -P $@.in | $(edit) >$@
	@chmod a-w "$@"
	@chmod +x "$@"

Ramon Buldó's avatar
Ramon Buldó committed
110 111
doc:
	mkdir -p man
Ramon Buldó's avatar
Ramon Buldó committed
112
	$(foreach var,$(MAN_XML),xsltproc /usr/share/docbook2X/xslt/man/docbook.xsl docbook/$(var) | db2x_manxml --output-dir man ;)
Ramon Buldó's avatar
Ramon Buldó committed
113

udeved's avatar
udeved committed
114
clean:
udeved's avatar
udeved committed
115
	rm -f $(BIN_BASE) ${BIN_PKG} ${BIN_ISO}
Ramon Buldó's avatar
Ramon Buldó committed
116
	rm -rf man
udeved's avatar
udeved committed
117

udeved's avatar
udeved committed
118
install_base:
119
	install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools
udeved's avatar
udeved committed
120
	install -m0644 ${SYSCONF} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools
udeved's avatar
udeved committed
121

udeved's avatar
udeved committed
122
	install -dm0755 $(DESTDIR)$(PREFIX)/bin
udeved's avatar
udeved committed
123
	install -m0755 ${BIN_BASE} $(DESTDIR)$(PREFIX)/bin
udeved's avatar
udeved committed
124

125
	install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
udeved's avatar
udeved committed
126
	install -m0644 ${LIBS_BASE} $(DESTDIR)$(PREFIX)/lib/manjaro-tools
udeved's avatar
udeved committed
127

udeved's avatar
udeved committed
128
	install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
udeved's avatar
udeved committed
129
	install -m0644 ${SHARED_BASE} $(DESTDIR)$(PREFIX)/share/manjaro-tools
udeved's avatar
udeved committed
130 131

install_pkg:
udeved's avatar
udeved committed
132 133
	install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/pkg.list.d
	install -m0644 ${LIST_PKG} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/pkg.list.d
udeved's avatar
udeved committed
134

135 136
	install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/make.conf.d
	install -m0644 ${ARCH_CONF} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/make.conf.d
137

udeved's avatar
udeved committed
138
	install -dm0755 $(DESTDIR)$(PREFIX)/bin
udeved's avatar
udeved committed
139 140
	install -m0755 ${BIN_PKG} $(DESTDIR)$(PREFIX)/bin

udeved's avatar
udeved committed
141
	ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
udeved's avatar
udeved committed
142

udeved's avatar
udeved committed
143 144 145
	install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
	install -m0644 ${LIBS_PKG} $(DESTDIR)$(PREFIX)/lib/manjaro-tools

146
	install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
udeved's avatar
udeved committed
147 148 149 150 151 152 153
	install -m0644 ${SHARED_PKG} $(DESTDIR)$(PREFIX)/share/manjaro-tools

	install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man1
	gzip -c man/buildpkg.1 > $(DESTDIR)$(PREFIX)/share/man/man1/buildpkg.1.gz
	gzip -c man/buildtree.1 > $(DESTDIR)$(PREFIX)/share/man/man1/buildtree.1.gz

install_iso:
udeved's avatar
udeved committed
154 155
	install -dm0755 $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/iso.list.d
	install -m0644 ${LIST_ISO} $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/iso.list.d
udeved's avatar
udeved committed
156 157 158 159

	install -dm0755 $(DESTDIR)$(PREFIX)/bin
	install -m0755 ${BIN_ISO} $(DESTDIR)$(PREFIX)/bin

160
	install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
udeved's avatar
udeved committed
161
	install -m0644 ${LIBS_ISO} $(DESTDIR)$(PREFIX)/lib/manjaro-tools
udeved's avatar
udeved committed
162

163 164 165 166 167 168
	install -dm0755 $(DESTDIR)$(SYSCONFDIR)/initcpio/hooks
	install -m0755 ${CPIOHOOKS} $(DESTDIR)$(SYSCONFDIR)/initcpio/hooks

	install -dm0755 $(DESTDIR)$(SYSCONFDIR)/initcpio/install
	install -m0755 ${CPIOINST} $(DESTDIR)$(SYSCONFDIR)/initcpio/install

udeved's avatar
udeved committed
169
	install -m0755 ${CPIO} $(DESTDIR)$(SYSCONFDIR)/initcpio
udeved's avatar
udeved committed
170

171

udeved's avatar
udeved committed
172 173 174
	install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
	install -m0644 ${SHARED_ISO} $(DESTDIR)$(PREFIX)/share/manjaro-tools

udeved's avatar
udeved committed
175
	install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man1
Ramon Buldó's avatar
Ramon Buldó committed
176
	gzip -c man/buildiso.1 > $(DESTDIR)$(PREFIX)/share/man/man1/buildiso.1.gz
udeved's avatar
udeved committed
177
	gzip -c man/deployiso.1 > $(DESTDIR)$(PREFIX)/share/man/man1/deployiso.1.gz
udeved's avatar
udeved committed
178

udeved's avatar
udeved committed
179
	install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man5
Ramon Buldó's avatar
Ramon Buldó committed
180 181
	gzip -c man/manjaro-tools.conf.5 > $(DESTDIR)$(PREFIX)/share/man/man5/manjaro-tools.conf.5.gz
	gzip -c man/profile.conf.5 > $(DESTDIR)$(PREFIX)/share/man/man5/profile.conf.5.gz
udeved's avatar
udeved committed
182

183 184 185 186 187 188 189
install_yaml:
	install -dm0755 $(DESTDIR)$(PREFIX)/bin
	install -m0755 ${BIN_YAML} $(DESTDIR)$(PREFIX)/bin

	install -dm0755 $(DESTDIR)$(PREFIX)/lib/manjaro-tools
	install -m0644 ${LIBS_YAML} $(DESTDIR)$(PREFIX)/lib/manjaro-tools

190 191 192
	install -dm0755 $(DESTDIR)$(PREFIX)/share/manjaro-tools
	install -m0644 ${SHARED_YAML} $(DESTDIR)$(PREFIX)/share/manjaro-tools

udeved's avatar
udeved committed
193 194 195
	install -dm0755 $(DESTDIR)$(PREFIX)/share/man/man1
	gzip -c man/check-yaml.1 > $(DESTDIR)$(PREFIX)/share/man/man1/check-yaml.1.gz

udeved's avatar
udeved committed
196
uninstall_base:
udeved's avatar
udeved committed
197
	for f in ${SYSCONF}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/$$f; done
udeved's avatar
udeved committed
198 199 200
	for f in ${BIN_BASE}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
	for f in ${SHARED_BASE}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
	for f in ${LIBS_BASE}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
udeved's avatar
udeved committed
201 202

uninstall_pkg:
udeved's avatar
udeved committed
203
	for f in ${LIST_PKG}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/pkg.list.d/$$f; done
204
	for f in ${ARCH_CONF}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/make.conf.d/$$f; done
udeved's avatar
udeved committed
205
	for f in ${BIN_PKG}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
udeved's avatar
udeved committed
206
	rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
udeved's avatar
udeved committed
207 208 209 210
	for f in ${SHARED_PKG}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
	for f in ${LIBS_PKG}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
	rm -f $(DESTDIR)$(PREFIX)/share/man/man1/buildpkg.1.gz
	rm -f $(DESTDIR)$(PREFIX)/share/man/man1/buildtree.1.gz
udeved's avatar
udeved committed
211

udeved's avatar
udeved committed
212
uninstall_iso:
udeved's avatar
udeved committed
213
	for f in ${LIST_ISO}; do rm -f $(DESTDIR)$(SYSCONFDIR)/manjaro-tools/iso.list.d/$$f; done
udeved's avatar
udeved committed
214 215
	for f in ${BIN_ISO}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
	for f in ${SHARED_ISO}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
216

udeved's avatar
udeved committed
217
	for f in ${LIBS_ISO}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
udeved's avatar
udeved committed
218 219 220
	for f in ${CPIOHOOKS}; do rm -f $(DESTDIR)$(SYSCONFDIR)/initcpio/hooks/$$f; done
	for f in ${CPIOINST}; do rm -f $(DESTDIR)$(SYSCONFDIR)/initcpio/install/$$f; done
	for f in ${CPIO}; do rm -f $(DESTDIR)$(SYSCONFDIR)/initcpio/$$f; done
Ramon Buldó's avatar
Ramon Buldó committed
221
	rm -f $(DESTDIR)$(PREFIX)/share/man/man1/buildiso.1.gz
udeved's avatar
udeved committed
222
	rm -f $(DESTDIR)$(PREFIX)/share/man/man1/deployiso.1.gz
udeved's avatar
udeved committed
223 224
	rm -f $(DESTDIR)$(PREFIX)/share/man/man5/manjaro-tools.conf.5.gz
	rm -f $(DESTDIR)$(PREFIX)/share/man/man5/profile.conf.5.gz
Ramon Buldó's avatar
Ramon Buldó committed
225

226 227 228
uninstall_yaml:
	for f in ${BIN_YAML}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
	for f in ${LIBS_YAML}; do rm -f $(DESTDIR)$(PREFIX)/lib/manjaro-tools/$$f; done
229
	for f in ${SHARED_YAML}; do rm -f $(DESTDIR)$(PREFIX)/share/manjaro-tools/$$f; done
udeved's avatar
udeved committed
230
	rm -f $(DESTDIR)$(PREFIX)/share/man/man1/check-yaml.1.gz
231 232

install: install_base install_pkg install_iso install_yaml
udeved's avatar
udeved committed
233

234
uninstall: uninstall_base uninstall_pkg uninstall_iso uninstall_yaml
udeved's avatar
udeved committed
235 236

dist:
udeved's avatar
udeved committed
237
	git archive --format=tar --prefix=manjaro-tools-$(Version)/ $(Version) | gzip -9 > manjaro-tools-$(Version).tar.gz
udeved's avatar
udeved committed
238
	gpg --detach-sign --use-agent manjaro-tools-$(Version).tar.gz
udeved's avatar
udeved committed
239 240

.PHONY: all clean install uninstall dist