forked from etiennesky/profiletool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (65 loc) · 2.87 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
#/***************************************************************************
# ProfileTool
#
# ProfileTool
# -------------------
# begin : 2012-03-03
# copyright : (C) 2012 by patricev
# email : XXX
# ***************************************************************************/
#
#/***************************************************************************
# * *
# * 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. *
# * *
# ***************************************************************************/
# Makefile for a PyQGIS plugin
PLUGINNAME = profiletool
PY_FILES = __init__.py profileplugin.py
PY_FILES1 = doProfile.py selectPointTool.py
EXTRAS = metadata.txt resources.qrc
UI_FILES1 = ui/profiletool.py
RESOURCE_FILES = resources.py
TOOL_DIR = tools ui
ICONS_DIR = icons
UI_SOURCES=$(wildcard ui/*.ui)
UI_FILES=$(patsubst %.ui,%.py,$(UI_SOURCES))
RC_SOURCES=$(wildcard *.qrc)
RC_FILES=$(patsubst %.qrc,%.py,$(RC_SOURCES))
GEN_FILES = ${UI_FILES} ${RC_FILES}
all: $(GEN_FILES)
ui: $(UI_FILES)
resources: $(RC_FILES)
$(UI_FILES): %.py: %.ui
pyuic4 -o $@ $<
$(RC_FILES): %.py: %.qrc
pyrcc4 -o $@ $<
clean:
rm -f $(GEN_FILES) *.pyc
compile: $(UI_FILES) $(RESOURCE_FILES)
# The deploy target only works on unix like operating system where
# the Python plugin directory is located at:
# $HOME/.qgis2/python/plugins
deploy: all
mkdir -p $(HOME)/.qgis2/python/plugins/$(PLUGINNAME)
mkdir -p $(HOME)/.qgis2/python/plugins/$(PLUGINNAME)/tools
mkdir -p $(HOME)/.qgis2/python/plugins/$(PLUGINNAME)/icons
cp -vf $(PY_FILES) $(HOME)/.qgis2/python/plugins/$(PLUGINNAME)
cp -vf $(UI_FILES1) $(HOME)/.qgis2/python/plugins/$(PLUGINNAME)/tools
cp -vf $(RESOURCE_FILES) $(HOME)/.qgis2/python/plugins/$(PLUGINNAME)
# cp -vf $(RC_FILES) $(HOME)/.qgis2/python/plugins/$(PLUGINNAME)
cp -vf $(EXTRAS) $(HOME)/.qgis2/python/plugins/$(PLUGINNAME)
cp -rvf $(TOOL_DIR) $(HOME)/.qgis2/python/plugins/$(PLUGINNAME)
cp -rvf $(ICONS_DIR) $(HOME)/.qgis2/python/plugins/$(PLUGINNAME)
# The dclean target removes compiled python files from plugin directory
# also delets any .svn entry
dclean:
find $(HOME)/.qgis2/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
# 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)/.qgis2/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)