-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
200 lines (167 loc) · 7.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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#/***************************************************************************
# DigitizingTools
#
# Subsumes different tools neded during digitizing sessions
# -------------------
# begin : 2013-02-25
# copyright : (C) 2013 by Bernhard Ströbl / Kommunale Immobilien Jena
# email : [email protected]
# ***************************************************************************/
#
#/***************************************************************************
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation; either version 2 of the License, or *
# * (at your option) any later version. *
# * *
# ***************************************************************************/
# CONFIGURATION
PLUGIN_UPLOAD = $(CURDIR)/plugin_upload.py
# Makefile for a PyQGIS plugin
#Add iso code for any locales you want to support here (space separated)
# default is no locales
# LOCALES = af
LOCALES = digitizingtools_de digitizingtools_fr
# If locales are enabled, set the name of the lrelease binary on your system. If
# you have trouble compiling the translations, you may have to specify the full path to
# lrelease
LRELEASE = lrelease
#LRELEASE = lrelease-qt4
# translation
SOURCES = digitizingtools.py __init__.py dtDialog.py tools/dtutils.py
#TRANSLATIONS = i18n/digitizingtools_de.ts i18n/digitizingtools_pt.ts
# global
PLUGINNAME = DigitizingTools
PY_FILES = digitizingtools.py __init__.py dtDialog.py
TOOLS = tools/dtutils.py tools/dtsplitmultipart.py tools/dtcutter.py tools/dtclipper.py \
tools/dtfillring.py tools/dtfillgap.py tools/dtsplitfeature.py \
tools/dtmovenodebyarea.py tools/dtmovesidebydistance.py \
tools/dtmovenodebyarea_dialog.py tools/dtmovesidebydistance_dialog.py \
tools/dtmovesidebyarea.py tools/dtmovesidebyarea_dialog.py \
tools/dtflipline.py tools/dttools.py tools/dtmedianline.py tools/dtmedianlinetool.py \
tools/dtextractpart.py tools/dtmerge.py tools/dtexchangegeometry.py tools/dtToolsDialog.py \
tools/ui_dtmovenodebyarea.ui tools/ui_dtmovesidebydistance.ui tools/ui_dtmovesidebyarea.ui \
tools/ui_dtchooseremaining.ui
EXTRAS = metadata.txt LICENSE digitizingtools.png
UI_FILES = ui_about.ui ui_dtcutter.ui
RESOURCE_SRC=$(shell grep '^ *<file' dt_icons_rc.qrc | sed 's@</file>@@g;s/.*>//g' | tr '\n' ' ')
COMPILED_RESOURCE_FILES = dt_icons_rc.py
HELP = help/build/html
QGISDIR=.local/share/QGIS/QGIS3/profiles/default
default: compile
compile: $(COMPILED_RESOURCE_FILES)
%.py : %.qrc $(RESOURCES_SRC)
pyrcc5 -o $*.py $<
%.qm : %.ts
$(LRELEASE) $<
#compile: $(UI_FILES) $(RESOURCE_FILES)
#compile: $(UI_FILES)
#compile3:
#%_rc.py : %.qrc
# pyrcc5 -o $*_rc.py -py2 $<
#%.py : %.ui
# pyuic5 -o $@ $<
%.qm : %.ts
lrelease $<
# The deploy target only works on unix like operating system where
deploy: compile transcompile
@echo
@echo "------------------------------------------"
@echo "Deploying plugin to your .qgis3 directory."
@echo "------------------------------------------"
# The deploy target only works on unix like operating system where
# the Python plugin directory is located at:
# $HOME/$(QGISDIR)/python/plugins
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/tools
cp -vf $(PY_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
cp -vf $(UI_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
cp -vf $(TOOLS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/tools
cp -vf $(COMPILED_RESOURCE_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/tools
cp -vf $(EXTRAS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
cp -vfr i18n $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
#cp -vfr $(HELP) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/help
# The dclean target removes compiled python files from plugin directory
# also delets any .svn entry
dclean:
@echo
@echo "-----------------------------------"
@echo "Removing any compiled python files."
@echo "-----------------------------------"
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname ".git" -prune -exec rm -Rf {} \;
# The derase deletes deployed plugin
derase:
@echo
@echo "-------------------------"
@echo "Removing deployed plugin."
@echo "-------------------------"
rm -Rf $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
# The zip target deploys the plugin and creates a zip file with the deployed
# content. You can then upload the zip file on http://plugins.qgis.org
zip: deploy dclean
@echo
@echo "---------------------------"
@echo "Creating plugin zip bundle."
@echo "---------------------------"
# The zip target deploys the plugin and creates a zip file with the deployed
# content. You can then upload the zip file on http://plugins.qgis.org
rm -f $(PLUGINNAME).zip
cd $(HOME)/$(QGISDIR)/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)
# Create a zip package of the plugin named $(PLUGINNAME).zip.
# This requires use of git (your plugin development directory must be a
# git repository).
# To use, pass a valid commit or tag as follows:
# make package VERSION=Version_0.3.2
package: compile
# Create a zip package of the plugin named $(PLUGINNAME).zip.
# This requires use of git (your plugin development directory must be a
# git repository).
# To use, pass a valid commit or tag as follows:
# make package VERSION=Version_0.3.2
@echo
@echo "------------------------------------"
@echo "Exporting plugin to zip package. "
@echo "------------------------------------"
rm -f $(PLUGINNAME).zip
git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION)
echo "Created package: $(PLUGINNAME).zip"
upload: zip
@echo
@echo "-------------------------------------"
@echo "Uploading plugin to QGIS Plugin repo."
@echo "-------------------------------------"
$(PLUGIN_UPLOAD) $(PLUGINNAME).zip
transup:
@echo
@echo "------------------------------------------------"
@echo "Updating translation files with any new strings."
@echo "------------------------------------------------"
@chmod +x scripts/update-strings.sh
@scripts/update-strings.sh $(LOCALES)
transcompile:
@echo
@echo "----------------------------------------"
@echo "Compiled translation files to .qm files."
@echo "----------------------------------------"
@chmod +x scripts/compile-strings.sh
@scripts/compile-strings.sh $(LRELEASE) $(LOCALES)
transclean:
@echo
@echo "------------------------------------"
@echo "Removing compiled translation files."
@echo "------------------------------------"
rm -f i18n/*.qm
clean:
@echo
@echo "------------------------------------"
@echo "Removing uic and rcc generated files"
@echo "------------------------------------"
rm $(COMPILED_UI_FILES) $(COMPILED_RESOURCE_FILES)
doc:
@echo
@echo "------------------------------------"
@echo "Building documentation using sphinx."
@echo "------------------------------------"
cd help; make html