-
Notifications
You must be signed in to change notification settings - Fork 251
/
Makefile
151 lines (111 loc) · 4.37 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# ---------------------------------------------------------------
# Makefile for RetopoFlow
# Jonathan Williamson - <[email protected]>
# Originally created by Diego Gangl - <[email protected]>
# ---------------------------------------------------------------
#########################################################
# settings
# TODO: warn if profiling is enabled!
# see https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_6.html
# scripts
HIVE_VAL = $(shell pwd)/scripts/get_hive_value.py
DEBUG_CLEANUP = $(shell pwd)/addon_common/scripts/strip_debugging.py
UPDATE_COPYRIGHT = $(shell pwd)/addon_common/scripts/update_copyright_date.py
DOCS_REBUILD = $(shell pwd)/scripts/prep_help_for_online.py
CREATE_THUMBNAILS = $(shell pwd)/scripts/create_thumbnails.py
BLENDER = ~/software/blender/blender
# name, version, and release are pulled from hive.json file
NAME = "$(shell $(HIVE_VAL) name)"
VERSION = "$(shell $(HIVE_VAL) version)"
RELEASE = "$(shell $(HIVE_VAL) release)"
VVERSION = "v$(VERSION)"
ifeq ($(RELEASE), "official")
ZIP_VERSION = "$(VVERSION)"
else
ZIP_VERSION = "$(VVERSION)-$(RELEASE)"
endif
GIT_TAG_MESSAGE = "This is the $(RELEASE) release for RetopoFlow $(VVERSION)"
BUILD_DIR = $(shell pwd)/../retopoflow_release
INSTALL_DIR = ~/.config/blender/addons
CGCOOKIE_BUILT = $(NAME)/.cgcookie
ZIP_GH = $(NAME)_$(ZIP_VERSION)-GitHub.zip
ZIP_BM = $(NAME)_$(ZIP_VERSION)-BlenderMarket.zip
.DEFAULT_GOAL := info
# .PHONY: _build-pre _build-post
#########################################################
# information
info:
@echo "Information:"
@echo " "$(NAME)" "$(ZIP_VERSION)
@echo " Build Path: "$(BUILD_DIR)
@echo " Install Path: "$(INSTALL_DIR)
@echo "Targets:"
@echo " development: clean, check, gittag, install"
@echo " documentation: build-docs, serve-docs, clean-docs, build-thumbnails"
@echo " build zips: build, build-github, build-blendermarket"
#########################################################
# utilities
clean:
rm -rf $(BUILD_DIR)
@echo "Release folder deleted"
update-copyright:
python3 $(UPDATE_COPYRIGHT)
#########################################################
# documentation targets
build-docs:
# rebuild online docs
python3 $(DOCS_REBUILD)
cd docs && bundle add webrick && bundle update
serve-docs:
cd docs && bundle exec jekyll serve
clean-docs:
cd docs && bundle exec jekyll clean
#########################################################
# build targets
blinfo:
@echo "Updating bl_info in __init__.py by running Blender with --background"
$(BLENDER) --background
check:
# check that we don't have case-conflicting filenames (ex: utils.py Utils.py)
# most Windows setups have issues with these
./scripts/detect_filename_case_conflicts.py
build-thumbnails:
# create thumbnails
cd help/images && python3 $(CREATE_THUMBNAILS)
build:
make _build-docs _build-common _build-github _build-blendermarket
@echo "\n\n"$(NAME)" "$(VVERSION)" is ready"
build-github:
make _build-common _build-github
@echo "\n\n"$(NAME)" "$(VVERSION)" is ready"
build-blendermarket:
make _build-common _build-blendermarket
@echo "\n\n"$(NAME)" "$(VVERSION)" is ready"
# helper targets
_build-docs:
make build-thumbnails build-docs
_build-common:
make check blinfo
mkdir -p $(BUILD_DIR)/$(NAME)
# copy files over to build folder
# note: rsync flag -a == archive (same as -rlptgoD)
rsync -av --progress . $(BUILD_DIR)/$(NAME) --exclude-from="Makefile_excludes"
# run debug cleanup
cd $(BUILD_DIR) && python3 $(DEBUG_CLEANUP) "YES!"
_build-github:
# touch file so that we know it was packaged by us and zip it!
cd $(BUILD_DIR) && echo "This file indicates that CG Cookie built this version of RetopoFlow for release on GitHub." > $(CGCOOKIE_BUILT)
cd $(BUILD_DIR) && zip -r $(ZIP_GH) $(NAME)
_build-blendermarket:
# touch file so that we know it was packaged by us and zip it!
cd $(BUILD_DIR) && echo "This file indicates that CG Cookie built this version of RetopoFlow for release on Blender Market." > $(CGCOOKIE_BUILT)
cd $(BUILD_DIR) && zip -r $(ZIP_BM) $(NAME)
#########################################################
# installing target
install:
rm -r $(INSTALL_DIR)/$(NAME)
cp -r $(BUILD_DIR)/$(NAME) $(INSTALL_DIR)/$(NAME)
gittag:
# create a new annotated (-a) tag and push to GitHub
git tag -a $(VVERSION) -m $(GIT_TAG_MESSAGE)
git push origin $(VVERSION)