-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
62 lines (42 loc) · 1.21 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
NAME = $(shell cat bundle.json | sed -n 's/"name"//p' | tr -d '", :')
PROJECT = sanji-bundle-$(NAME)
VERSION = $(shell cat bundle.json | sed -n 's/"version"//p' | tr -d '", :')
PROJECT_VERSION=$(PROJECT)-$(VERSION)
ARCHIVE=$(CURDIR)/$(PROJECT)-$(VERSION).tar.gz
SANJI_VER=1.0
INSTALL_DIR=$(DESTDIR)/usr/lib/sanji-$(SANJI_VER)/$(NAME)
STAGING_DIR=$(CURDIR)/staging
PROJECT_STAGING_DIR=$(STAGING_DIR)/$(PROJECT_VERSION)
FILES= \
bundle.json \
Makefile \
README.md \
requirements.txt \
index.py \
status/__init__.py \
daemon/mxsysstatusd \
data/properties.json.factory \
data/status.json.factory
INSTALL_FILES=$(addprefix $(INSTALL_DIR)/,$(FILES))
STAGING_FILES=$(addprefix $(PROJECT_STAGING_DIR)/,$(FILES))
.PHONY: clean dist pylint test
all:
clean:
rm -rf $(PROJECT)-*.tar.gz $(STAGING_DIR)
dist: $(ARCHIVE)
pylint:
flake8 --exclude=.git,env,.env -v .
test:
nosetests --with-coverage --cover-erase --cover-package=status -v
$(ARCHIVE): $(STAGING_FILES)
cd $(STAGING_DIR) && \
tar zcf $@ $(PROJECT_VERSION)
$(PROJECT_STAGING_DIR)/%: %
mkdir -p $(dir $@)
cp -a $< $@
install: $(INSTALL_FILES)
$(INSTALL_DIR)/%: %
mkdir -p $(dir $@)
install $< $@
uninstall:
-rm $(addprefix $(INSTALL_DIR)/,$(FILES))