-
-
Notifications
You must be signed in to change notification settings - Fork 93
/
Makefile
86 lines (61 loc) · 1.6 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
BUILD_DIR = $(CURDIR)/build
RPMREPO_DIR := $(BUILD_DIR)/rpmrepo
DEBREPO_DIR := $(BUILD_DIR)/debrepo/stretch
NAME := loudml
unittests ?= $(addprefix tests/, \
test_config.py test_metrics.py test_misc.py test_model.py test_schemas.py \
test_base.py test_memdatasource.py test_donut.py)
install:
python3 setup.py install $(INSTALL_OPTS)
uninstall:
pip3 uninstall -y loudml
clean:
python3 setup.py clean
rm -rf build dist
dev:
python3 setup.py develop --no-deps
test:
nosetests -v tests/
coverage:
nosetests --with-coverage \
-v $(unittests)
unittest:
nosetests -v $(unittests)
$(NAME).rpm: $(NAME).spec
$(call rpmsrc,$(FULLNAME))
$(call rpmbuild,$(FULLNAME),$(NAME))
$(NAME).deb: debian/changelog
$(call debbuild,$(FULLNAME))
.PHONY: rpm deb debian/changelog debian/control
include build.mk
rpm: $(NAME).rpm
@echo -e "\nRPM packages:"
@find $(BUILD_DIR) -name '*.rpm'
deb: $(NAME).deb
@echo -e "\nDEB packages:"
@find . -name '*.deb'
.PHONY: check_deb
check_deb:
scripts/check_deb
$(RPMREPO_DIR)/repodata/repomd.xml: rpm
createrepo $(RPMREPO_DIR)
.PHONY: rpmrepo
rpmrepo: $(RPMREPO_DIR)/repodata/repomd.xml
.PHONY: rpmrepo-archive
rpmrepo-archive: $(BUILD_DIR)/rpmrepo-$(VERSION).tar
$(BUILD_DIR)/rpmrepo-$(VERSION).tar: rpmrepo
tar -C $(BUILD_DIR) -cvf "$@" rpmrepo
$(DEBREPO_DIR)/Packages.gz:
mkdir -p $(dir $@)
cp *.deb $(dir $@)
cd $(dir $@)/.. \
&& dpkg-scanpackages `basename $(dir $@)` | gzip > $@
.PHONY: debrepo
debrepo: $(DEBREPO_DIR)/Packages.gz
repo: rpmrepo
.PHONY: docker
docker:
$(MAKE) -C docker
.PHONY: fmt
fmt:
find loudml -type f -name "*.py" | xargs autopep8 -i