-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
156 lines (124 loc) · 5.03 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
#/***************************************************************************
# TileMapScalePlugin
#
# Let you add tiled datasets (GDAL WMS) and shows them in the correct scale.
# -------------------
# begin : 2014-03-03
# copyright : (C) 2014 by Matthias Ludwig - Datalyze Solutions
# 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
QGISDIR=.qgis2
# Makefile for a PyQGIS plugin
# translation
SOURCES = QgisMarkerCluster.py ui_info.py __init__.py QgisMarkerClusterWidget.py
#TRANSLATIONS = i18n/tilemapscaleplugin_en.ts
TRANSLATIONS =
# global
PLUGINNAME = QgisMarkerCluster
PY_FILES = QgisMarkerCluster.py __init__.py QgisMarkerClusterWidget.py
LIBS = libs/__init__.py \
libs/QgsClusterLayer.py \
libs/QgsLayerStyles.py \
libs/tilemapscalelevels.py \
EXTRAS = metadata.txt \
INFO.html \
README.txt \
ICONS = icons/draw-freehand.png \
icons/ds_logo.png \
icons/ds_made_by.png \
icons/example.jpg \
icons/help-about.png \
icons/icon.png \
icons/list-add.png \
icons/osm.png \
icons/view-refresh.png \
SVG = datasets/styles/svg/shadow_circle.svg
STYLES = datasets/styles/little_gray_point.qml \
datasets/styles/simple_cluster.qml \
DATASETS = datasets/licence.txt \
datasets/stations_3857.dbf \
datasets/stations_3857.prj \
datasets/stations_3857.qpj \
datasets/stations_3857.shp \
datasets/stations_3857.shx \
UI_FILES = ui_info.py ui_QgisMarkerClusterDockWidget.py
RESOURCE_FILES = resources_rc.py
HELP = help/build/html
default: compile
compile: $(UI_FILES) $(RESOURCE_FILES)
%_rc.py : %.qrc
pyrcc4 -o $*_rc.py $<
%.py : %.ui
pyuic4 -o $@ $<
%.qm : %.ts
lrelease $<
# The deploy target only works on unix like operating system where
# the Python plugin directory is located at:
# $HOME/$(QGISDIR)/python/plugins
deploy: compile doc transcompile
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/icons
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/libs
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/datasets/styles/svg
cp -vf $(PY_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
cp -vf $(LIBS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/libs
cp -vf $(DATASETS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/datasets
cp -vf $(STYLES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/datasets/styles
cp -vf $(SVG) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/datasets/styles/svg
cp -vf $(UI_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
cp -vf $(RESOURCE_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
cp -vf $(EXTRAS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
cp -vf $(ICONS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/icons
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:
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname ".svn" -prune -exec rm -Rf {} \;
# The derase deletes deployed plugin
derase:
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
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
rm -f $(PLUGINNAME).zip
git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION)
echo "Created package: $(PLUGINNAME).zip"
upload: zip
$(PLUGIN_UPLOAD) $(PLUGINNAME).zip
# transup
# update .ts translation files
transup:
pylupdate4 Makefile
# transcompile
# compile translation files into .qm binary format
transcompile: $(TRANSLATIONS:.ts=.qm)
# transclean
# deletes all .qm files
transclean:
rm -f i18n/*.qm
clean:
rm $(UI_FILES) $(RESOURCE_FILES)
# build documentation with sphinx
doc:
cd help; make html