forked from facebookarchive/firefox-toolbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (51 loc) · 1.71 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
# Makefile for compiling .xpt files and building the .xpi.
# This requires a Unix-like environment. On Windows, you
# can install cygwin or MozillaBuild (https://wiki.mozilla.org/MozillaBuild)
#
# Usage: optionally set the MOZSDKDIR environment variable pointing to the
# Gecko SDK if you want to rebuild the .xpt files.
# Run "make" to build the .xpi.
sdkdir ?= ${MOZSDKDIR}
ifeq ($(nocompile),)
ifeq ($(sdkdir),)
nocompile := 1
warn_nocompile := 1
endif
endif
IDLC=${MOZSDKDIR}/bin/xpidl
INC=${MOZSDKDIR}/idl
XPTS=components/facebook.xpt
all: xpi
xpt: $(XPTS)
components/%.xpt: idl/%.idl
ifneq ($(warn_nocompile),)
@echo
@echo "WARNING: the MOZSDKDIR environment variable was not set. .xpt files won't be compiled."
@echo " If this is intentional, you should pass the nocompile=1 variable on the command line to skip this warning:"
@echo " If you change the idl, set the MOZSDKDIR environment variable to point to the location of the Gecko SDK."
@echo " For instance: export MOZSDKDIR=/foo/bar/baz"
endif
ifeq ($(nocompile),)
$(IDLC) -m typelib -w -v -I $(INC) -e $(@) $(<)
endif
appname := facebook
xpi_name := $(appname).xpi
# Set this to 1, for using a .jar file for chrome files.
# Note that the manifest does not support this yet.
use_chrome_jar := 0
ifeq ($(use_chrome_jar),1)
chrome_files := chrome/$(appname).jar
else
chrome_files := chrome
endif
xpi_files := $(chrome_files) license.txt defaults components \
install.rdf chrome.manifest
chrome/$(appname).jar:
rm -f chrome/faceook.jar
cd chrome; zip -9 -r $(appname).jar * -x \*.svn/*; cd ..
xpi: xpt $(xpi_files)
rm -f $(xpi_name)
zip -9 -r $(xpi_name) $(xpi_files) -x \*.svn/*
clean:
rm -f $(xpi_name) chrome/$(appname).jar
.PHONY: all xpi