-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
63 lines (48 loc) · 2.14 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
# Basic Makefile
UUID = [email protected]
BASE_MODULES = extension.js metadata.json popup_dialog.js prefs.js prefs_keys.js stylesheet.css utils.js wikipedia_client.js wikipedia_image.js wikipedia_image_results_view.js wikipedia_image_view.js wikipedia_page.js wikipedia_results_view.js wikipedia_result_view.js wikipedia_search_suggestion.js viewer.js
EXTRA_MODULES = wikipedia.png
TOLOCALIZE = extension.js prefs.js wikipedia_image_results_view.js wikipedia_results_view.js wikipedia_result_view.js wikipedia_search_suggestion.js
MSGSRC = $(wildcard po/*.po)
all: extension
clean:
rm -f ./schemas/gschemas.compiled
extension: ./schemas/gschemas.compiled $(MSGSRC:.po=.mo)
./schemas/gschemas.compiled: ./schemas/org.gnome.shell.extensions.wikipedia-search-provider.gschema.xml
glib-compile-schemas ./schemas/
potfile: ./po/wikipedia_search_provider.pot
mergepo: potfile
for l in $(MSGSRC); do \
msgmerge -U $$l ./po/wikipedia_search_provider.pot; \
done;
./po/wikipedia_search_provider.pot: $(TOLOCALIZE)
mkdir -p po
xgettext -k_ -kN_ -o po/wikipedia_search_provider.pot --package-name "Wikipedia Search Provier" $(TOLOCALIZE)
./po/%.mo: ./po/%.po
msgfmt -c $< -o $@
install: install-local
zip-file: _build
cd _build ; \
zip -qr "$(UUID).zip" .
mv _build/$(UUID).zip ./
-rm -fR _build
_build: all
-rm -fR ./_build
mkdir -p _build
cp $(BASE_MODULES) $(EXTRA_MODULES) _build
mkdir -p _build/schemas
cp schemas/*.xml _build/schemas/
cp schemas/gschemas.compiled _build/schemas/
mkdir -p _build/locale
for l in $(MSGSRC:.po=.mo) ; do \
lf=_build/locale/`basename $$l .mo`; \
mkdir -p $$lf; \
mkdir -p $$lf/LC_MESSAGES; \
cp $$l $$lf/LC_MESSAGES/wikipedia_search_provider.mo; \
done;
#What does the first "-" mean at the beginning of the line in a Makefile ?
#It means that make itself will ignore any error code from rm.
#In a makefile, if any command fails then the make process itself discontinues
#processing. By prefixing your commands with -, you notify make that it should
#continue processing rules no matter the outcome of the command.
#mkdir -p, --parents no error if existing, make parent directories as needed