This repository has been archived by the owner on Jun 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
63 lines (50 loc) · 1.66 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
# ***** BEGIN LICENSE BLOCK *****
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2010-2013, 2016 Matthew Turnbull <[email protected]>. All Rights Reserved.
#
# ***** END LICENSE BLOCK *****
GREP = grep
CUT = cut
LS = ls
SORT = sort
TAIL = tail
EXPR = expr
RM = rm
MKDIR = mkdir
ZIP = zip
ECHO = echo
PY = env python2
XRSDK = $(shell $(LS) -d /opt/mozilla/firefox-sdk-* | $(SORT) -V | $(TAIL) -1)
XRSDK_VERS = $(shell $(GREP) "^Milestone=" $(XRSDK)/bin/platform.ini | $(CUT) -d"=" -f2 | $(CUT) -d"." -f1)
TLIB_CACHE = components/cache
NAME = $(shell $(GREP) "^name=" install.manifest | $(CUT) -d"=" -f2)
VERSION = $(shell $(GREP) "^version=" install.manifest | $(CUT) -d"=" -f2)
FILES = $(shell $(GREP) "^files=" install.manifest | $(CUT) -d"=" -f2)
XPT_FILES = $(patsubst %.idl,%.xpt,$(wildcard components/*.idl))
all: clean xpi
debug:
@$(ECHO) "SDK Path: $(XRSDK)"
@$(ECHO) "SDK Version: $(XRSDK_VERS)"
@$(ECHO) "S4E Version: $(VERSION)"
@$(ECHO) "S4E XPT files: $(XPT_FILES)"
clean:
$(RM) -f *.xpi
$(RM) -f install.rdf
$(RM) -f components/*.xpt
$(RM) -rf components/cache
$(RM) -f xpidl_debug
$(TLIB_CACHE):
$(MKDIR) $@
%.xpt: %.idl $(TLIB_CACHE)
$(PY) $(XRSDK)/sdk/bin/typelib.py --cachedir=$(TLIB_CACHE) \
-I $(XRSDK)/idl -o $*.xpt $*.idl
xpt: $(XPT_FILES)
install.rdf: install.manifest
./buildInstallRdf
rdf: install.rdf
xpi: xpt rdf
$(ZIP) -r $(NAME)-$(VERSION).xpi $(FILES) $(XPT_FILES)