-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (30 loc) · 1.07 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
NAME = "meshstats"
VERSION = $(shell ack "\"version\":\s*\((\d+),\s*(\d+)\)" meshstats/__init__.py --output="\$$1.\$$2" --nocolor)
PACKAGE_NAME = $(NAME)-$(VERSION)
SOURCE_DIR = $(NAME)
BUILD_DIR = ./release
.DEFAULT_GOAL := check
.PHONY: clean build release check tag version
build:
@mkdir -p $(BUILD_DIR)/$(PACKAGE_NAME)
@rsync -av --exclude-from=build_excludes.txt ./$(SOURCE_DIR)/ $(BUILD_DIR)/$(PACKAGE_NAME)/$(NAME)
@cp COPYING.txt $(BUILD_DIR)/$(PACKAGE_NAME)/$(NAME)
@cp CHANGELOG.md $(BUILD_DIR)/$(PACKAGE_NAME)/$(NAME)
@cd $(BUILD_DIR)/$(PACKAGE_NAME); zip -r "$(PACKAGE_NAME).zip" $(NAME)
@mv $(BUILD_DIR)/$(PACKAGE_NAME)/$(PACKAGE_NAME).zip $(BUILD_DIR)/
@echo "Created '$(BUILD_DIR)/$(PACKAGE_NAME).zip'"
check:
@flake8 --show-source $(SOURCE_DIR)
clean:
@rm -rf $(BUILD_DIR)
@echo "Deleted $(BUILD_DIR)"
release: clean check version build tag
@echo "Done"
tag:
@git tag -a "v$(VERSION)" -m "Version $(VERSION)"
@echo "Created tag 'v$(VERSION)'"
@echo "Don't forget to run:"
@echo
@echo " git push origin --tags"
version:
@echo "Version = '$(VERSION)'"