forked from 3nids/quickfinder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (45 loc) · 1.99 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
#/***************************************************************************
# * *
# * 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 =$(shell basename $(CURDIR))
QGISDIR=.qgis2
PY_FILES = __init__.py $(PLUGINNAME).py
EXTRAS = metadata.txt resources.qrc
TOOL_DIR = gui core ui qgiscombomanager qgissettingmanager
ICONS_DIR = icons
UI_SOURCES=$(wildcard ui/*.ui)
UI_FILES=$(join $(dir $(UI_SOURCES)), $(notdir $(UI_SOURCES:%.ui=%.py)))
RC_SOURCES=$(wildcard *.qrc)
RC_FILES=$(join $(dir $(RC_SOURCES)), $(notdir $(RC_SOURCES:%.qrc=%_rc.py)))
GEN_FILES = ${UI_FILES} ${RC_FILES}
all: $(GEN_FILES)
ui: $(UI_FILES)
resources: $(RC_FILES)
$(UI_FILES): ui/%.py: ui/%.ui
pyuic4 -o $@ $<
$(RC_FILES): %_rc.py: %.qrc
pyrcc4 -o $@ $<
clean:
rm -f $(GEN_FILES)
find $(CURDIR) -iname "*.pyc" -delete
compile: $(UI_FILES) $(RC_FILES)
deploy:
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
cp -rvf * $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/
rm -f $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/$(PLUGINNAME).zip
# The dclean target removes compiled python files from plugin directory
dclean:
find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
rm -f $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/$(PLUGINNAME).zip
# The derase deletes deployed plugin
derase:
rm -Rf $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
zip: deploy dclean
rm -f $(PLUGINNAME).zip
cd $(HOME)/$(QGISDIR)/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)