-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
100 lines (78 loc) · 3.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
# Makefile for CartoDB Plugin plugin
#Add iso code for any locales you want to support here (space separated)
LOCALES = en es
PLUGINNAME = QgisCartoDB
EXTRAS = icon.png metadata.txt
UI_FILES = ui/UI_CartoDBPlugin.py ui/NewConnection.py ui/NewSQL.py ui/ConnectionManager.py ui/ListItem.py ui/Upload.py ui/CreateViz.py
RESOURCE_FILES = resources.py
RESOURCE_SRC=$(shell grep '^ *<file' resources.qrc | sed 's@</file>@@g;s/.*>//g' | tr '\n' ' ')
QGISDIR=.qgis2
PLUGIN_UPLOAD = ./plugin_upload.py
default: compile
compile: $(UI_FILES) $(RESOURCE_FILES)
%.py : %.qrc $(RESOURCES_SRC)
pyrcc4 -o $@ $<
%.py : %.ui
pyuic4 -o $@ $<
install: transcompile compile
@echo
@echo "-------------------------------------------"
@echo "Installing plugin to your .qgis2 directory."
@echo "-------------------------------------------"
rm -f $(PLUGINNAME).zip
mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
cp -r ./* $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
rm -R $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/scripts
rm -R $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/test
rm -Rf $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/qgis_cartodb.egg-info
rm -Rf $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/_site
@echo " "
uninstall:
@echo
@echo "-----------------------------------------------"
@echo "Uninstalling plugin from your .qgis2 directory."
@echo "-----------------------------------------------"
rm -f -R $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
@echo " "
transcompile:
@echo
@echo "----------------------------------------"
@echo "Compiled translation files to .qm files."
@echo "----------------------------------------"
@chmod +x scripts/compile-strings.sh
@scripts/compile-strings.sh $(LOCALES)
transclean:
@echo
@echo "------------------------------------"
@echo "Removing compiled translation files."
@echo "------------------------------------"
rm -f i18n/*.qm
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 ".zip" -delete
rm -f $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/db/database.sqlite
zip: install 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)
upload: zip
@echo
@echo "-------------------------------------"
@echo "Uploading plugin to QGIS Plugin repo."
@echo "-------------------------------------"
$(PLUGIN_UPLOAD) $(PLUGINNAME).zip
clean:
@echo
@echo "------------------------------------"
@echo "Removing uic and rcc generated files"
@echo "------------------------------------"
rm -f $(UI_FILES) $(RESOURCE_FILES)