forked from mozilla/openwebapps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (61 loc) · 1.69 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
PYTHON = python
MAKELAUNCHER =
SYS := $(shell uname -s)
ifeq ($(SYS), Darwin)
MAKELAUNCHER := ${MAKE} -C addons/jetpack/mac/
endif
ifeq ($(TOPSRCDIR),)
export TOPSRCDIR = $(shell pwd)
endif
profile :=
ifneq ($(OWA_PROFILE),)
profile := --profiledir="$(OWA_PROFILE)"
endif
deps := $(TOPSRCDIR)/deps
ifneq ($(DEPSDIR),)
deps := $(DEPSDIR)
endif
binary :=
ifneq ($(MOZ_BINARY),)
binary := -b "$(MOZ_BINARY)"
endif
addon_sdk := $(deps)/addon-sdk/bin
oauthorizer := $(deps)/oauthorizer
openwebapps := $(TOPSRCDIR)/addons/jetpack
activities := $(TOPSRCDIR)/addons/activities
ifeq ($(TARGET),activities)
pkgdir := $(activities)
cfx_args := --pkgdir=$(pkgdir) $(binary) $(profile) --package-path=$(oauthorizer) --binary-args="-console -purgecaches $(BINARYARGS)"
else
pkgdir := $(openwebapps)
cfx_args := --pkgdir=$(pkgdir) $(binary) $(profile) --binary-args="-console -purgecaches $(BINARYARGS)"
endif
# Ability to pass in a list of static args in json format
# Ex: export STATIC_ARGS='\"dashboard\":\"myapps.mozillalabs.com\", \"appsyncurl\":\"https://myapps.mozillalabs.com\"'
ifneq ($(STATIC_ARGS),)
cfx_args += --static-args="{$(STATIC_ARGS)}"
endif
test_args :=
ifneq ($(TEST),)
test_args := -f $(TEST)
endif
# might be useful for symlink handling...
SLINK = ln -sf
ifneq ($(findstring MINGW,$(shell uname -s)),)
SLINK = cp -r
export NO_SYMLINK = 1
endif
all: xpi
xpi: pull
$(addon_sdk)/cfx xpi $(cfx_args)
pull:
$(MAKELAUNCHER)
$(PYTHON) build.py -p $(pkgdir)/package.json
test:
$(addon_sdk)/cfx test -v $(cfx_args) $(test_args)
run:
$(MAKELAUNCHER)
$(addon_sdk)/cfx run $(cfx_args)
build_rpms:
cd site/tools; ./build_rpm.sh
.PHONY: xpi clean pull test run build_rpms