forked from rhinstaller/fedup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (38 loc) · 1.23 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
PYTHON=python
VERSION=0.9.1
RELEASE_TAG=0.9.1
all: build
SUBDIRS := systemd man
$(SUBDIRS):
$(MAKE) -C $@
INSTALL_TARGETS = $(SUBDIRS:%=install-%)
$(INSTALL_TARGETS):
$(MAKE) -C $(@:install-%=%) install
CLEAN_TARGETS = $(SUBDIRS:%=clean-%)
$(CLEAN_TARGETS):
$(MAKE) -C $(@:clean-%=%) clean
build: $(SUBDIRS) fedup/version.py
$(PYTHON) setup.py build
install: all $(INSTALL_TARGETS)
$(PYTHON) setup.py install --skip-build --root $(DESTDIR)/
clean: $(CLEAN_TARGETS)
$(PYTHON) setup.py clean
rm -rf build
rm -f $(ARCHIVE)
fedup/version.py: Makefile
echo 'version="$(VERSION)"' > fedup/version.py
ARCHIVE = fedup-$(RELEASE_TAG).tar.xz
archive: $(ARCHIVE)
$(ARCHIVE):
git archive --format=tar --prefix=fedup-$(RELEASE_TAG)/ $(RELEASE_TAG) \
| xz -c > $@ || rm $@
# VERSION-pre<commits-since-last-tag>-g<head-commit-id-short>
# e.g.: 0.9.0-pre7-gedf04c5
SNAPSHOT_VERSION=$(VERSION)-pre$(shell git describe --tags --match '*.*.*' | cut -d- -f2-3)
SNAPSHOT = fedup-$(SNAPSHOT_VERSION).tar.xz
snapshot: $(SNAPSHOT)
$(SNAPSHOT):
git archive --format=tar --prefix=fedup-$(SNAPSHOT_VERSION)/ HEAD \
| xz -c > $@ || rm $@
.PHONY: all archive install clean version
.PHONY: $(ARCHIVE) $(SNAPSHOT) $(SUBDIRS) $(INSTALL_TARGETS) $(CLEAN_TARGETS)