-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
50 lines (44 loc) · 1.24 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
include vars.mk
BINS = xbps-src
SUBDIRS = etc libexec helpers shutils chroot
.PHONY: all
all:
for bin in $(BINS); do \
sed -e "s|@@XBPS_INSTALL_PREFIX@@|$(PREFIX)|g" \
-e "s|@@XBPS_INSTALL_ETCDIR@@|$(ETCDIR)|g" \
-e "s|@@XBPS_INSTALL_SHAREDIR@@|$(SHAREDIR)|g" \
-e "s|@@XBPS_INSTALL_SBINDIR@@|$(SBINDIR)|g" \
-e "s|@@XBPS_INSTALL_LIBEXECDIR@@|$(LIBEXECDIR)|g" \
-e "s|@@XBPS_SRC_VERSION@@|$(VERSION)|g" \
$$bin.sh.in > $$bin; \
done
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir || exit 1; \
done
.PHONY: clean
clean:
-rm -f $(BINS)
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir clean || exit 1; \
done
.PHONY: install
install: all
install -d $(DESTDIR)$(SBINDIR)
for bin in $(BINS); do \
install -m 755 $$bin $(DESTDIR)$(SBINDIR); \
done
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir install || exit 1; \
done
.PHONY: uninstall
uninstall:
for bin in $(DESTDIR)$(BINS); do \
rm -f $(DESTDIR)$(SBINDIR)/$$bin; \
done
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir uninstall || exit 1; \
done
dist:
@echo "Building distribution tarball for tag: v$(VERSION) ..."
-@git archive --format=tar --prefix=xbps-src-$(VERSION)/ \
v$(VERSION) | gzip -9 > ~/xbps-src-$(VERSION).tar.gz