Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 859 lines (733 sloc) 28.984 kb
0f51ea4 Initial "build system"
Chris Jones authored
1 # To support gonk's build/envsetup.sh
2 SHELL = bash
3
d78390f @jhford use ?= instead of = for GIT and HG
jhford authored
4 GIT ?= git
5 HG ?= hg
156ac02 @jhford make git a makefile variable to allow alternate paths to git program
jhford authored
6
21dde64 @ThinkerYzu Include local.mk at Makefile
ThinkerYzu authored
7 -include local.mk
3d78dce Touch up makefile a bit
Chris Jones authored
8 -include .config.mk
0f51ea4 Initial "build system"
Chris Jones authored
9
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
10 all: build
89c6876 @andreasgal add qemu and galaxy s2 kernels
authored
11
ff495bd @ThinkerYzu Export env. ANDROID_SDK_PLATFORM and MAKE_FLAGS to gecko configuration.
ThinkerYzu authored
12 MAKE_FLAGS ?= -j16
572039c @ThinkerYzu Config kernel for Android emulator with goldfish_armv7_defconfig.
ThinkerYzu authored
13 GONK_MAKE_FLAGS ?=
89c6876 @andreasgal add qemu and galaxy s2 kernels
authored
14
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
15 GONK_BASE ?= glue/gonk
16 FASTBOOT ?= $(abspath $(GONK_BASE)/out/host/linux-x86/bin/fastboot)
d2cd070 Makefile hackery for Galaxy S II, and fix broken -jN
Chris Jones authored
17 HEIMDALL ?= heimdall
e524ff8 Merge
Chris Jones authored
18 TOOLCHAIN_HOST = linux-x86
bc0f5ee @michaelwu Fix gecko toolchain on GB
michaelwu authored
19 TOOLCHAIN_PATH ?= $(GONK_BASE)/prebuilt/$(TOOLCHAIN_HOST)/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
20 KERNEL_TOOLCHAIN_PATH ?= $(GONK_BASE)/prebuilt/$(TOOLCHAIN_HOST)/toolchain/arm-eabi-4.4.3/bin
89c6876 @andreasgal add qemu and galaxy s2 kernels
authored
21
2766ec5 Add GAIA_PATH in the Makefile and have it be overrideable, to make it ea...
Chris Jones authored
22 GAIA_PATH ?= $(abspath gaia)
23 GECKO_PATH ?= $(abspath gecko)
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
24 GONK_PATH = $(abspath $(GONK_BASE))
5e8c651 @ThinkerYzu Add the reason of fallbacking GONK_TARGET
ThinkerYzu authored
25
2766ec5 Add GAIA_PATH in the Makefile and have it be overrideable, to make it ea...
Chris Jones authored
26 TEST_DIRS = $(abspath $(GAIA_PATH)/tests) $(abspath marionette/marionette/tests/unit-tests.ini)
83f48b4 @malini enable make test
malini authored
27
5e8c651 @ThinkerYzu Add the reason of fallbacking GONK_TARGET
ThinkerYzu authored
28 # We need adb for config-* targets. Adb is built by building system
29 # of gonk that needs a correct product name provided by "GONK_TARGET".
30 # But, "GONK_TARGET" is not set properly before running any config-*
31 # target since "GONK" is not defined. We fallback "GONK_TARGET" to
32 # generic-eng to build adb for config-* targets.
56729e0 @ThinkerYzu Fallback to generic-eng for a clean copy
ThinkerYzu authored
33 ifdef GONK
5b7b0e8 @ThinkerYzu Build Gecko for ARMv7 instead of ARMv5
ThinkerYzu authored
34 GONK_TARGET ?= full_$(GONK)-eng
56729e0 @ThinkerYzu Fallback to generic-eng for a clean copy
ThinkerYzu authored
35 else # fallback to generic for a clean copy.
36 GONK_TARGET ?= generic-eng
37 endif
0f51ea4 Initial "build system"
Chris Jones authored
38
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
39 REPO_PATH := $(abspath repo)
40
41 glue/gonk-ics/.repo: $(REPO_PATH)
42 mkdir -p glue/gonk-ics
43 cd glue/gonk-ics && \
44 $(REPO_PATH) init -u git://github.com/mozilla-b2g/gonk-ics-manifest.git
45
46 .PHONY: gonk-ics-sync
47 gonk-ics-sync: glue/gonk-ics/.repo
48 cd glue/gonk-ics && \
49 $(REPO_PATH) sync
50
7957af2 @ThinkerYzu Fake JDK and no recovery image
ThinkerYzu authored
51 # This path includes tools to simulate JDK tools. Gonk would check
52 # version of JDK. These fake tools do nothing but print out version
53 # number to stop gonk from error.
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
54 FAKE_JDK_PATH ?= $(abspath fake-jdk-tools)
7957af2 @ThinkerYzu Fake JDK and no recovery image
ThinkerYzu authored
55
0f51ea4 Initial "build system"
Chris Jones authored
56 define GONK_CMD # $(call GONK_CMD,cmd)
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
57 export USE_CCACHE="yes" && \
fd32ad8 Make new build changes play nicely with system sun-jdk.
Chris Jones authored
58 export JAVA_HOME=$(FAKE_JDK_PATH) && \
59 export PATH=$(FAKE_JDK_PATH)/bin:$$PATH && \
3d78dce Touch up makefile a bit
Chris Jones authored
60 cd $(GONK_PATH) && \
0f51ea4 Initial "build system"
Chris Jones authored
61 . build/envsetup.sh && \
3d78dce Touch up makefile a bit
Chris Jones authored
62 lunch $(GONK_TARGET) && \
0f51ea4 Initial "build system"
Chris Jones authored
63 $(1)
64 endef
65
ff495bd @ThinkerYzu Export env. ANDROID_SDK_PLATFORM and MAKE_FLAGS to gecko configuration.
ThinkerYzu authored
66 ANDROID_SDK_PLATFORM ?= android-13
263d23c @ThinkerYzu Add config-qemu make target for Android emulator
ThinkerYzu authored
67 GECKO_CONFIGURE_ARGS ?=
ff495bd @ThinkerYzu Export env. ANDROID_SDK_PLATFORM and MAKE_FLAGS to gecko configuration.
ThinkerYzu authored
68
4653a5a @ThinkerYzu Add comment
ThinkerYzu authored
69 # |make STOP_DEPENDENCY_CHECK=true| to stop dependency checking
9463e97 @michaelwu Disable dependency checking for now due to regressions
michaelwu authored
70 STOP_DEPENDENCY_CHECK ?= true
ff495bd @ThinkerYzu Export env. ANDROID_SDK_PLATFORM and MAKE_FLAGS to gecko configuration.
ThinkerYzu authored
71
b91e60b @ThinkerYzu Use submodule info from .gitmodules to accerate hashing
ThinkerYzu authored
72 define SUBMODULES
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
73 cat .gitmodules |grep path|awk -- '{print $$3;}'
74 endef
75
76 define DEP_LIST_GIT_FILES
156ac02 @jhford make git a makefile variable to allow alternate paths to git program
jhford authored
77 $(GIT) ls-files | xargs -d '\n' stat -c '%n:%Y' --; \
78 $(GIT) ls-files -o -X .gitignore | xargs -d '\n' stat -c '%n:%Y' --
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
79 endef
80
81 define DEP_LIST_HG_FILES
17d2f34 @jhford use GIT/HG variable to invoke git or hg
jhford authored
82 $(HG) locate | xargs -d '\n' stat -c '%n:%Y' --
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
83 endef
84
85 define DEP_LIST_FILES
86 (if [ -d .git ]; then \
87 $(call DEP_LIST_GIT_FILES); \
88 elif [ -d .hg ]; then \
89 $(call DEP_LIST_HG_FILES); \
90 fi)
b91e60b @ThinkerYzu Use submodule info from .gitmodules to accerate hashing
ThinkerYzu authored
91 endef
92
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
93 # Generate hash code for timestamp and filename of source files
94 #
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
95 # This function is for modules as subdirectories of given directory.
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
96 # $(1): the name of subdirectory that you want to hash for.
97 #
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
98 define DEP_HASH_MODULES
99 (_pwd=$$PWD; \
100 for sdir in $$(($(SUBMODULES))|grep "$(strip $1)"); do \
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
101 cd $$sdir; \
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
102 $(call DEP_LIST_FILES); \
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
103 cd $$_pwd; \
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
104 done 2> /dev/null | sort | md5sum | awk -- '{print $$1;}')
105 endef
106
107 # Generate hash code for timestamp and filename of source files
108 #
109 # This function is for the module at given directory.
110 # $(1): the name of subdirectory that you want to hash for.
111 #
112 define DEP_HASH_MODULE
113 (_pwd=$$PWD; cd $1; \
114 $(call DEP_LIST_FILES) \
115 2> /dev/null | sort | md5sum | awk -- '{print $$1;}'; \
116 cd $$_pwd)
117 endef
118
119 # Generate hash code for timestamp and filename of source files
120 #
121 # $(1): the name of subdirectory that you want to hash for.
122 #
123 define DEP_HASH
124 (if [ -d $(strip $1)/.git -o -d $(strip $1)/.hg ]; then \
125 $(call DEP_HASH_MODULE,$1); \
126 else \
127 $(call DEP_HASH_MODULES,$(call DEP_REL_PATH,$1)); \
128 fi)
129 endef
130
131 define DEP_REL_PATH
132 $(patsubst ./%,%,$(patsubst /%,%,$(patsubst $(PWD)%,%,$(strip $1))))
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
133 endef
134
e583f64 @ThinkerYzu Set STOP_DEPENDENCY_CHECK variable to stop dependency checking
ThinkerYzu authored
135 ifeq ($(strip $(STOP_DEPENDENCY_CHECK)),false)
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
136 # Check hash code of sourc files and run commands for necessary.
137 #
138 # $(1): stamp file (where hash code is kept)
139 # $(2): sub-directory where the module is
140 # $(3): commands that you want to run if any of source files is updated.
141 #
142 define DEP_CHECK
e583f64 @ThinkerYzu Set STOP_DEPENDENCY_CHECK variable to stop dependency checking
ThinkerYzu authored
143 (echo -n "Checking dependency for $2 ..."; \
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
144 if [ -e "$1" ]; then \
eb1c917 @ThinkerYzu Fix install-gaia
ThinkerYzu authored
145 LAST_HASH="$$(cat $1)"; \
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
146 CUR_HASH=$$($(call DEP_HASH,$2)); \
147 if [ "$$LAST_HASH" = "$$CUR_HASH" ]; then \
148 echo " (skip)"; \
149 exit 0; \
150 fi; \
151 fi; \
152 echo; \
153 _dep_check_pwd=$$PWD; \
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
154 ($3); \
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
155 cd $$_dep_check_pwd; \
e583f64 @ThinkerYzu Set STOP_DEPENDENCY_CHECK variable to stop dependency checking
ThinkerYzu authored
156 $(call DEP_HASH,$2) > $1)
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
157 endef
e583f64 @ThinkerYzu Set STOP_DEPENDENCY_CHECK variable to stop dependency checking
ThinkerYzu authored
158 else # STOP_DEPENDENCY_CHECK
159 define DEP_CHECK
160 ($3)
161 endef
162 endif # STOP_DEPENDENCY_CHECK
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
163
9cc4e82 @ThinkerYzu Check if ccache is installed
ThinkerYzu authored
164 CCACHE ?= $(shell which ccache)
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
165 ADB := $(abspath $(GONK_BASE)/out/host/linux-x86/bin/adb)
9cc4e82 @ThinkerYzu Check if ccache is installed
ThinkerYzu authored
166
0088a80 @shianyow Add makefile helpers for perf
shianyow authored
167 B2G_PID=$(shell $(ADB) shell toolbox ps | grep "b2g" | awk '{ print $$2; }')
168 GDBSERVER_PID=$(shell $(ADB) shell toolbox ps | grep "gdbserver" | awk '{ print $$2; }')
e407fe3 @shianyow Use pidof to get B2G_PID instead.
shianyow authored
169
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
170 .PHONY: build
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
171 ifeq (glue/gonk,$(GONK_BASE))
a6d26a4 don't build gaia when building gonk, do it for the build target and upda...
Andreas Gal authored
172 build: gecko-install-hack gaia
d1ebcbe @michaelwu Fix up toplevel Makefile
michaelwu authored
173 $(MAKE) gonk
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
174 else
175 build: gaia
176 $(MAKE) gonk
177 endif
0f51ea4 Initial "build system"
Chris Jones authored
178
131fabc @ThinkerYzu Build also kernel for qemu
ThinkerYzu authored
179 ifeq (qemu,$(KERNEL))
a6d26a4 don't build gaia when building gonk, do it for the build target and upda...
Andreas Gal authored
180 build: kernel bootimg-hack gaia
131fabc @ThinkerYzu Build also kernel for qemu
ThinkerYzu authored
181 endif
182
12c67df Remove mentions of b2g-android. r=tkim
Chris Jones authored
183 KERNEL_DIR = boot/kernel-android-$(KERNEL)
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
184 ifeq (glue/gonk,$(GONK_BASE))
21dde64 @ThinkerYzu Include local.mk at Makefile
ThinkerYzu authored
185 GECKO_OBJDIR = $(GECKO_PATH)/objdir-prof-gonk
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
186 MOZCONFIG = $(abspath config/gecko-prof-gonk)
187 else
188 GECKO_OBJDIR = objdir-gecko
189 MOZCONFIG = $(abspath glue/gonk-ics/gonk-misc/default-gecko-config)
190 endif
191
3b6f277 @michaelwu Remove unnecessary ./ from paths
michaelwu authored
192 GONK_OBJDIR=$(abspath $(GONK_BASE)/out/target/product/$(GONK))
0f51ea4 Initial "build system"
Chris Jones authored
193
7278b6e @ThinkerYzu Introduce gecko-only to avoid annoying messages
ThinkerYzu authored
194 define GECKO_BUILD_CMD
ff495bd @ThinkerYzu Export env. ANDROID_SDK_PLATFORM and MAKE_FLAGS to gecko configuration.
ThinkerYzu authored
195 export MAKE_FLAGS=$(MAKE_FLAGS) && \
263d23c @ThinkerYzu Add config-qemu make target for Android emulator
ThinkerYzu authored
196 export CONFIGURE_ARGS="$(GECKO_CONFIGURE_ARGS)" && \
6001f95 Updates to gonk configuration, update gaia
Michael Wu authored
197 export GONK_PRODUCT="$(GONK)" && \
0fd4d18 @ThinkerYzu Specify a Gecko at out-side of B2G
ThinkerYzu authored
198 export GONK_PATH="$(GONK_PATH)" && \
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
199 export TARGET_TOOLS_PREFIX="$(abspath $(TOOLCHAIN_PATH))" && \
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
200 export MOZCONFIG="$(MOZCONFIG)" && \
e4a3658 @michaelwu Fix quote issue
michaelwu authored
201 export EXTRA_INCLUDE='$(EXTRA_INCLUDE)' && \
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
202 export GECKO_OBJDIR="$(abspath objdir-gecko)" && \
94598fd @jlebar Attempt to keep ld from running out of file descriptors by adding ulimit...
jlebar authored
203 ulimit -n 4096 && \
7ff7843 Use $(MAKE) and flash userdata.
Chris Jones authored
204 $(MAKE) -C $(GECKO_PATH) -f client.mk -s $(MAKE_FLAGS) && \
205 $(MAKE) -C $(GECKO_OBJDIR) package
7278b6e @ThinkerYzu Introduce gecko-only to avoid annoying messages
ThinkerYzu authored
206 endef
207
208 .PHONY: gecko
209 # XXX Hard-coded for prof-android target. It would also be nice if
210 # client.mk understood the |package| target.
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
211 gecko:
212 @$(call DEP_CHECK,$(GECKO_OBJDIR)/.b2g-build-done,$(GECKO_PATH),\
eb1e759 @michaelwu Backout misguided Makefile change
michaelwu authored
213 $(call GECKO_BUILD_CMD) \
214 )
0f51ea4 Initial "build system"
Chris Jones authored
215
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
216 .PHONY: gonk
a6d26a4 don't build gaia when building gonk, do it for the build target and upda...
Andreas Gal authored
217 gonk:
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
218 @$(call DEP_CHECK,$(GONK_PATH)/out/.b2g-build-done,$(GONK_BASE), \
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
219 $(call GONK_CMD,$(MAKE) $(MAKE_FLAGS) $(GONK_MAKE_FLAGS) \
220 CONFIG_ESD=no \
221 GECKO_PATH="$(abspath gecko)" \
222 GECKO_OBJDIR="$(abspath objdir-gecko)" ) ; \
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
223 $(if $(filter qemu,$(KERNEL)), \
224 cp $(GONK_PATH)/system/core/rootdir/init.rc.gonk \
225 $(GONK_PATH)/out/target/product/$(GONK)/root/init.rc))
0f51ea4 Initial "build system"
Chris Jones authored
226
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
227 .PHONY: kernel
582a730 @michaelwu Add galaxy-s2 ics support (gonk only)
michaelwu authored
228 kernel: kernel-$(KERNEL)
229
230 .PHONY: kernel-galaxy-s2
231 kernel-galaxy-s2:
6bf342c @ThinkerYzu Build submodules only for changing hash value of subdirectories
ThinkerYzu authored
232 @$(call DEP_CHECK,$(KERNEL_PATH)/.b2g-build-done,$(KERNEL_PATH),\
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
233 $(if $(filter galaxy-s2,$(KERNEL)), \
234 (rm -rf boot/initramfs && \
235 cd boot/clockworkmod_galaxys2_initramfs && \
156ac02 @jhford make git a makefile variable to allow alternate paths to git program
jhford authored
236 $(GIT) checkout-index -a -f --prefix ../initramfs/); \
bc0f5ee @michaelwu Fix gecko toolchain on GB
michaelwu authored
237 PATH="$$PATH:$(abspath $(KERNEL_TOOLCHAIN_PATH))" \
4c7a86a @michaelwu Fix fresh builds of the sgs2 kernel
michaelwu authored
238 $(MAKE) -C $(KERNEL_PATH) $(MAKE_FLAGS) ARCH=arm \
239 CROSS_COMPILE="$(CCACHE) arm-eabi-"; \
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
240 find "$(KERNEL_DIR)" -name "*.ko" | \
241 xargs -I MOD cp MOD "$(PWD)/boot/initramfs/lib/modules"; \
242 ) \
bc0f5ee @michaelwu Fix gecko toolchain on GB
michaelwu authored
243 PATH="$$PATH:$(abspath $(KERNEL_TOOLCHAIN_PATH))" \
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
244 $(MAKE) -C $(KERNEL_PATH) $(MAKE_FLAGS) ARCH=arm \
245 CROSS_COMPILE="$(CCACHE) arm-eabi-"; )
0f51ea4 Initial "build system"
Chris Jones authored
246
582a730 @michaelwu Add galaxy-s2 ics support (gonk only)
michaelwu authored
247 kernel-galaxy-s2-ics:
ba7ec45 @michaelwu Add support for building sgs2 ics kernel
michaelwu authored
248 (rm -rf boot/initramfs && \
249 cd boot/initramfs-galaxy-s2-ics && \
250 $(GIT) checkout-index -a -f --prefix ../initramfs/); \
251 export ARCH=arm && \
252 export CROSS_COMPILE="$(CCACHE) $(abspath $(KERNEL_TOOLCHAIN_PATH))/arm-eabi-" && \
253 export USE_SEC_FIPS_MODE=true && \
254 $(MAKE) -C $(KERNEL_PATH) $(MAKE_FLAGS) u1_defconfig && \
8438826 Fix for issue #285. Change ownership of files in initramfs to be root/ro...
Dave Hylands authored
255 $(MAKE) -C $(KERNEL_PATH) $(MAKE_FLAGS) CROSS_COMPILE="$$CROSS_COMPILE" CONFIG_INITRAMFS_SOURCE="$(PWD)/boot/initramfs" CONFIG_INITRAMFS_ROOT_UID=squash CONFIG_INITRAMFS_ROOT_GID=squash && \
ba7ec45 @michaelwu Add support for building sgs2 ics kernel
michaelwu authored
256 mkdir -p boot/initramfs/lib/modules && \
582a730 @michaelwu Add galaxy-s2 ics support (gonk only)
michaelwu authored
257 find "$(KERNEL_DIR)" -name dhd.ko -o -name j4fs.ko -o -name scsi_wait_scan.ko -o -name Si4709_driver.ko | \
ba7ec45 @michaelwu Add support for building sgs2 ics kernel
michaelwu authored
258 xargs -I MOD cp MOD "$(PWD)/boot/initramfs/lib/modules" && \
c093228 Issue #280 - Fix to allow kernels built using ubuntu 12.04 to boot (test...
Dave Hylands authored
259 chmod -R g-w $(PWD)/boot/initramfs && \
8438826 Fix for issue #285. Change ownership of files in initramfs to be root/ro...
Dave Hylands authored
260 $(MAKE) -C $(KERNEL_PATH) $(MAKE_FLAGS) CROSS_COMPILE="$$CROSS_COMPILE" CONFIG_INITRAMFS_SOURCE="$(PWD)/boot/initramfs" CONFIG_INITRAMFS_ROOT_UID=squash CONFIG_INITRAMFS_ROOT_GID=squash
582a730 @michaelwu Add galaxy-s2 ics support (gonk only)
michaelwu authored
261
262 kernel-qemu:
263 PATH="$$PATH:$(abspath $(KERNEL_TOOLCHAIN_PATH))" \
264 $(MAKE) -C $(KERNEL_PATH) $(MAKE_FLAGS) ARCH=arm \
17504b4 @michaelwu Fix kernel-qemu rule
michaelwu authored
265 CROSS_COMPILE="$(CCACHE) arm-eabi-"
582a730 @michaelwu Add galaxy-s2 ics support (gonk only)
michaelwu authored
266 cp -p boot/kernel-android-qemu/arch/arm/boot/zImage \
267 $(GONK_PATH)/device/qemu/kernel
268
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
269 .PHONY: clean
0f51ea4 Initial "build system"
Chris Jones authored
270 clean: clean-gecko clean-gonk clean-kernel
271
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
272 .PHONY: clean-gecko
0f51ea4 Initial "build system"
Chris Jones authored
273 clean-gecko:
12c67df Remove mentions of b2g-android. r=tkim
Chris Jones authored
274 rm -rf $(GECKO_OBJDIR)
0f51ea4 Initial "build system"
Chris Jones authored
275
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
276 .PHONY: clean-gonk
0f51ea4 Initial "build system"
Chris Jones authored
277 clean-gonk:
7ff7843 Use $(MAKE) and flash userdata.
Chris Jones authored
278 @$(call GONK_CMD,$(MAKE) clean)
0f51ea4 Initial "build system"
Chris Jones authored
279
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
280 .PHONY: clean-kernel
0f51ea4 Initial "build system"
Chris Jones authored
281 clean-kernel:
7ff7843 Use $(MAKE) and flash userdata.
Chris Jones authored
282 @PATH="$$PATH:$(abspath $(TOOLCHAIN_PATH))" $(MAKE) -C $(KERNEL_PATH) ARCH=arm CROSS_COMPILE=arm-eabi- clean
1f79dff @jlebar Change clean-kernel to use rm -f, so it doesn't error out if the file do...
jlebar authored
283 @rm -f $(KERNEL_PATH)/.b2g-build-done
89c6876 @andreasgal add qemu and galaxy s2 kernels
authored
284
a4e2e1b Add a "mrproper" target to *really* clean up the source dir.
Chris Jones authored
285 .PHONY: mrproper
286 # NB: this is a VERY DANGEROUS command that will BLOW AWAY ALL
287 # outstanding changes you have. It's mostly intended for "clean room"
288 # builds.
289 mrproper:
17d2f34 @jhford use GIT/HG variable to invoke git or hg
jhford authored
290 $(GIT) submodule foreach '$(GIT) reset --hard' && \
2278dde @malini git clean -dfx should be -d -f -x
malini authored
291 $(GIT) submodule foreach '$(GIT) clean -d -f -x' && \
156ac02 @jhford make git a makefile variable to allow alternate paths to git program
jhford authored
292 $(GIT) reset --hard && \
2278dde @malini git clean -dfx should be -d -f -x
malini authored
293 $(GIT) clean -d -f -x
a4e2e1b Add a "mrproper" target to *really* clean up the source dir.
Chris Jones authored
294
20cd27a makefile fixes for crespo
Andreas Gal authored
295 VENDOR_DIR=$(GONK_PATH)/vendor
296 APNS_CONF=$(VENDOR_DIR)/apns-conf.xml
297
298 $(VENDOR_DIR):
299 mkdir -p $(VENDOR_DIR)
300
301 $(APNS_CONF): $(VENDOR_DIR)
302 wget -O $(APNS_CONF) https://raw.github.com/CyanogenMod/android_vendor_cyanogen/gingerbread/prebuilt/common/etc/apns-conf.xml
7f0a45b download apn list from cyanogenmod and make crespo use it
Andreas Gal authored
303
89c6876 @andreasgal add qemu and galaxy s2 kernels
authored
304 .PHONY: config-galaxy-s2
2895c6b @dougt Stop symlinking mozconfig into the gecko src dir. Instead, just export M...
dougt authored
305 config-galaxy-s2: adb-check-version $(APNS_CONF)
d2cd070 Makefile hackery for Galaxy S II, and fix broken -jN
Chris Jones authored
306 @echo "KERNEL = galaxy-s2" > .config.mk && \
a9a073e @andreasgal add maguro config and build targets
authored
307 echo "KERNEL_PATH = ./boot/kernel-android-galaxy-s2" >> .config.mk && \
d2cd070 Makefile hackery for Galaxy S II, and fix broken -jN
Chris Jones authored
308 echo "GONK = galaxys2" >> .config.mk && \
8b60566 @ThinkerYzu Add adb path to PATH for config-galaxy-s2 target
ThinkerYzu authored
309 export PATH=$$PATH:$$(dirname $(ADB)) && \
d2cd070 Makefile hackery for Galaxy S II, and fix broken -jN
Chris Jones authored
310 cp -p config/kernel-galaxy-s2 boot/kernel-android-galaxy-s2/.config && \
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
311 cd glue/gonk/device/samsung/galaxys2/ && \
d2cd070 Makefile hackery for Galaxy S II, and fix broken -jN
Chris Jones authored
312 echo Extracting binary blobs from device, which should be plugged in! ... && \
313 ./extract-files.sh && \
314 echo OK
0f51ea4 Initial "build system"
Chris Jones authored
315
582a730 @michaelwu Add galaxy-s2 ics support (gonk only)
michaelwu authored
316 .PHONY: config-galaxy-s2-ics
f4f3cba @qdot Updated Makefile to build adb dependency for sgs2-ics
qdot authored
317 config-galaxy-s2-ics: gonk-ics-sync adb-check-version
582a730 @michaelwu Add galaxy-s2 ics support (gonk only)
michaelwu authored
318 @echo "KERNEL = galaxy-s2-ics" > .config.mk && \
319 echo "KERNEL_PATH = ./boot/kernel-android-galaxy-s2-ics" >> .config.mk && \
320 echo "GONK = galaxys2" >> .config.mk && \
321 echo "GONK_BASE = glue/gonk-ics" >> .config.mk && \
322 export PATH=$$PATH:$$(dirname $(ADB)) && \
323 cd glue/gonk-ics/device/samsung/galaxys2/ && \
324 echo Extracting binary blobs from device, which should be plugged in! ... && \
325 ./extract-files.sh && \
326 echo OK
327
ff130fe Throttle down cpu/gpu on maguro.
Chris Jones authored
328 # Hack! Upstream boot/msm is RO at the moment and forking isn't
329 # a nice alternative at the moment...
330 .patches.applied:
331 cd boot/msm && \
332 $(GIT) apply $(abspath glue/patch)/yaffs_vfs.patch && \
333 $(GIT) apply $(abspath glue/patch)/downscale_gpu.patch
334 touch $@
335
a9a073e @andreasgal add maguro config and build targets
authored
336 .PHONY: config-maguro
2895c6b @dougt Stop symlinking mozconfig into the gecko src dir. Instead, just export M...
dougt authored
337 config-maguro: .patches.applied adb-check-version $(APNS_CONF)
a9a073e @andreasgal add maguro config and build targets
authored
338 @echo "KERNEL = msm" > .config.mk && \
339 echo "KERNEL_PATH = ./boot/msm" >> .config.mk && \
340 echo "GONK = maguro" >> .config.mk && \
81a4d74 @michaelwu Use our own adb for config-maguro
michaelwu authored
341 export PATH=$$PATH:$$(dirname $(ADB)) && \
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
342 cd glue/gonk/device/toro/maguro && \
a9a073e @andreasgal add maguro config and build targets
authored
343 echo Extracting binary blobs from device, which should be plugged in! ... && \
344 ./extract-files.sh && \
345 echo OK
346
6f1857f Add support for akami (followup: add modifications to existing files)
Chris Jones authored
347 .PHONY: config-akami
2895c6b @dougt Stop symlinking mozconfig into the gecko src dir. Instead, just export M...
dougt authored
348 config-akami: .patches.applied adb-check-version $(APNS_CONF)
6f1857f Add support for akami (followup: add modifications to existing files)
Chris Jones authored
349 @echo "KERNEL = msm" > .config.mk && \
350 echo "KERNEL_PATH = ./boot/msm" >> .config.mk && \
351 echo "GONK = akami" >> .config.mk && \
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
352 cd glue/gonk/device/toro/akami && \
6f1857f Add support for akami (followup: add modifications to existing files)
Chris Jones authored
353 echo Extracting binary blobs from device, which should be plugged in! ... && \
354 ./extract-files.sh && \
355 echo OK
356
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
357 define INSTALL_BLOBS
358 mkdir -p download-$1 && \
359 mkdir -p $3 && \
360 cd download-$1 && \
361 for BLOB in $2 ; do \
362 wget -N https://dl.google.com/dl/android/aosp/$$BLOB && \
363 tar xvfz $$BLOB ; \
364 done && \
365 for BLOB_SH in extract-*.sh ; do \
763ec94 @qdot Makefile directory existence check caused nexus s samsung proprietary bl...
qdot authored
366 PATH=$(FAKE_JDK_PATH):$$PATH && \
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
367 BLOB_SH_PATH="$$PWD/$$BLOB_SH" && \
673085d @michaelwu Improve blob downloader and gecko build rule
michaelwu authored
368 VENDOR=`echo $$BLOB_SH | sed -e "s/extract-\([a-zA-Z]*\).*$$/\1/"` && \
763ec94 @qdot Makefile directory existence check caused nexus s samsung proprietary bl...
qdot authored
369 ( cd $3 && \
370 yes I ACCEPT | $$BLOB_SH_PATH ) ;\
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
371 done
372 endef
20cd27a makefile fixes for crespo
Andreas Gal authored
373
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
374 NEXUSS4G_BLOBS := akm-crespo4g-grj90-1bec498a.tgz \
375 broadcom-crespo4g-grj90-c4ec9a38.tgz \
376 imgtec-crespo4g-grj90-a8e2ce86.tgz \
377 nxp-crespo4g-grj90-9abcae18.tgz \
378 samsung-crespo4g-grj90-9474e48f.tgz
c0d9fe5 @michaelwu Initial support for nexus s (non-4g)
michaelwu authored
379
465b3fd Use real dependencies for nexuss4g blobs so that they don't need to be r...
Chris Jones authored
380 .PHONY: blobs-nexuss4g
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
381 blobs-nexuss4g:
382 $(call INSTALL_BLOBS,nexuss4g,$(NEXUSS4G_BLOBS),$(abspath glue/gonk))
66f6627 Add missing blob for nexuss4g and include build fix
Chris Jones authored
383 mkdir -p $(GONK_PATH)/packages/wallpapers/LivePicker
384 touch $(GONK_PATH)/packages/wallpapers/LivePicker/android.software.live_wallpaper.xml
92e391b More fixes, and configure vendor blobs
Chris Jones authored
385
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
386 NEXUSS_ICS_BLOBS := akm-crespo-iml74k-48d943ee.tgz \
387 broadcom-crespo-iml74k-4b0a7e2a.tgz \
388 imgtec-crespo-iml74k-33420a2f.tgz \
389 nxp-crespo-iml74k-9f2a89d1.tgz \
390 samsung-crespo-iml74k-0dbf413c.tgz
391
392 .PHONY: blobs-nexuss-ics
393 blobs-nexuss-ics:
394 $(call INSTALL_BLOBS,nexuss-ics,$(NEXUSS_ICS_BLOBS),$(abspath glue/gonk-ics))
c0d9fe5 @michaelwu Initial support for nexus s (non-4g)
michaelwu authored
395
9abc07e @michaelwu Add support for Galaxy Nexus, Remove support for Nexus S GB
michaelwu authored
396 GALAXY_NEXUS_BLOBS := broadcom-maguro-imm76d-4ee51a8d.tgz \
397 imgtec-maguro-imm76d-0f59ea74.tgz \
398 samsung-maguro-imm76d-d16591cf.tgz
399 .PHONY: blobs-galaxy-nexus
400 blobs-galaxy-nexus:
401 $(call INSTALL_BLOBS,galaxy-nexus,$(GALAXY_NEXUS_BLOBS),$(abspath glue/gonk-ics))
402
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
403 .PHONY: config-nexuss4g
2895c6b @dougt Stop symlinking mozconfig into the gecko src dir. Instead, just export M...
dougt authored
404 config-nexuss4g: blobs-nexuss4g $(APNS_CONF)
3d78dce Touch up makefile a bit
Chris Jones authored
405 @echo "KERNEL = samsung" > .config.mk && \
a9a073e @andreasgal add maguro config and build targets
authored
406 echo "KERNEL_PATH = ./boot/kernel-android-samsung" >> .config.mk && \
3d78dce Touch up makefile a bit
Chris Jones authored
407 echo "GONK = crespo4g" >> .config.mk && \
408 cp -p config/kernel-nexuss4g boot/kernel-android-samsung/.config && \
665ca04 fix make config-nexuss
Andreas Gal authored
409 echo OK
3d78dce Touch up makefile a bit
Chris Jones authored
410
9abc07e @michaelwu Add support for Galaxy Nexus, Remove support for Nexus S GB
michaelwu authored
411 .PHONY: config-nexuss-ics
412 config-nexuss-ics: blobs-nexuss-ics gonk-ics-sync
c0d9fe5 @michaelwu Initial support for nexus s (non-4g)
michaelwu authored
413 @echo "KERNEL = samsung" > .config.mk && \
414 echo "KERNEL_PATH = ./boot/kernel-android-samsung" >> .config.mk && \
415 echo "GONK = crespo" >> .config.mk && \
9abc07e @michaelwu Add support for Galaxy Nexus, Remove support for Nexus S GB
michaelwu authored
416 echo "GONK_BASE = glue/gonk-ics" >> .config.mk && \
417 echo "TOOLCHAIN_PATH = ./toolchains/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-" >> .config.mk && \
418 echo "EXTRA_INCLUDE = -include $(abspath Unicode.h)" >> .config.mk && \
665ca04 fix make config-nexuss
Andreas Gal authored
419 echo OK
c0d9fe5 @michaelwu Initial support for nexus s (non-4g)
michaelwu authored
420
9abc07e @michaelwu Add support for Galaxy Nexus, Remove support for Nexus S GB
michaelwu authored
421 .PHONY: config-galaxy-nexus
422 config-galaxy-nexus: blobs-galaxy-nexus gonk-ics-sync
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
423 @echo "KERNEL = samsung" > .config.mk && \
424 echo "KERNEL_PATH = ./boot/kernel-android-samsung" >> .config.mk && \
9abc07e @michaelwu Add support for Galaxy Nexus, Remove support for Nexus S GB
michaelwu authored
425 echo "GONK = maguro" >> .config.mk && \
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
426 echo "GONK_BASE = glue/gonk-ics" >> .config.mk && \
c8c2990 @michaelwu Update Nexus S ICS toolchain
michaelwu authored
427 echo "TOOLCHAIN_PATH = ./toolchains/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-" >> .config.mk && \
cbabf35 @michaelwu Remove unnecessary quotes
michaelwu authored
428 echo "EXTRA_INCLUDE = -include $(abspath Unicode.h)" >> .config.mk && \
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
429 echo OK
430
263d23c @ThinkerYzu Add config-qemu make target for Android emulator
ThinkerYzu authored
431 .PHONY: config-qemu
2895c6b @dougt Stop symlinking mozconfig into the gecko src dir. Instead, just export M...
dougt authored
432 config-qemu:
263d23c @ThinkerYzu Add config-qemu make target for Android emulator
ThinkerYzu authored
433 @echo "KERNEL = qemu" > .config.mk && \
a9a073e @andreasgal add maguro config and build targets
authored
434 echo "KERNEL_PATH = ./boot/kernel-android-qemu" >> .config.mk && \
5b7b0e8 @ThinkerYzu Build Gecko for ARMv7 instead of ARMv5
ThinkerYzu authored
435 echo "GONK = generic" >> .config.mk && \
436 echo "GONK_TARGET = generic-eng" >> .config.mk && \
4077da2 @ThinkerYzu Build gonk with ARMv7 for QEmu
ThinkerYzu authored
437 echo "GONK_MAKE_FLAGS = TARGET_ARCH_VARIANT=armv7-a" >> .config.mk && \
7ff7843 Use $(MAKE) and flash userdata.
Chris Jones authored
438 $(MAKE) -C boot/kernel-android-qemu ARCH=arm goldfish_armv7_defconfig && \
572039c @ThinkerYzu Config kernel for Android emulator with goldfish_armv7_defconfig.
ThinkerYzu authored
439 ( [ -e $(GONK_PATH)/device/qemu ] || \
440 mkdir $(GONK_PATH)/device/qemu ) && \
263d23c @ThinkerYzu Add config-qemu make target for Android emulator
ThinkerYzu authored
441 echo OK
442
a16e15b @michaelwu Add support for ICS emulator
michaelwu authored
443 .PHONY: config-qemu-ics
444 config-qemu-ics: gonk-ics-sync
445 @echo "KERNEL = qemu-ics" > .config.mk && \
446 echo "KERNEL_PATH = ./boot/kernel-android-qemu" >> .config.mk && \
447 echo "GONK = generic" >> .config.mk && \
448 echo "GONK_BASE = glue/gonk-ics" >> .config.mk && \
449 echo "TOOLCHAIN_PATH = ./toolchains/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-" >> .config.mk && \
450 echo "EXTRA_INCLUDE = -include $(abspath Unicode.h)" >> .config.mk && \
451 echo "GONK_TARGET = generic-eng" >> .config.mk && \
452 echo "GONK_MAKE_FLAGS = TARGET_ARCH_VARIANT=armv7-a" >> .config.mk && \
453 echo OK
454
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
455 .PHONY: flash
d2cd070 Makefile hackery for Galaxy S II, and fix broken -jN
Chris Jones authored
456 # XXX Using target-specific targets for the time being. fastboot is
457 # great, but the sgs2 doesn't support it. Eventually we should find a
458 # lowest-common-denominator solution.
a6d26a4 don't build gaia when building gonk, do it for the build target and upda...
Andreas Gal authored
459 flash: flash-$(GONK) update-time
d2cd070 Makefile hackery for Galaxy S II, and fix broken -jN
Chris Jones authored
460
fe9f75a @jlebar Adding auto-chmod 755 to make flash with gonk backend.
jlebar authored
461 # flash-only targets are the same as flash targets, except that they don't
462 # depend on building the image.
463
464 .PHONY: flash-only
5a31840 @fabricedesre Update timezone after flashing to prevent overwriting
fabricedesre authored
465 flash-only: flash-only-$(GONK) update-time
fe9f75a @jlebar Adding auto-chmod 755 to make flash with gonk backend.
jlebar authored
466
dc29cb9 add flash-crespo target
Andreas Gal authored
467 .PHONY: flash-crespo
468 flash-crespo: flash-crespo4g
469
c56155d add target flash-only-crespo and update device/samsung/crespo for latest...
Andreas Gal authored
470 .PHONY: flash-only-crespo
471 flash-only-crespo: flash-only-crespo4g
472
d2cd070 Makefile hackery for Galaxy S II, and fix broken -jN
Chris Jones authored
473 .PHONY: flash-crespo4g
948fd80 Install gaia along with system image, and remove host xpcshell building ...
Chris Jones authored
474 flash-crespo4g: image adb-check-version flash-only-fastboot
0f51ea4 Initial "build system"
Chris Jones authored
475
fe9f75a @jlebar Adding auto-chmod 755 to make flash with gonk backend.
jlebar authored
476 .PHONY: flash-only-crespo4g
948fd80 Install gaia along with system image, and remove host xpcshell building ...
Chris Jones authored
477 flash-only-crespo4g: adb-check-version flash-only-fastboot
fe9f75a @jlebar Adding auto-chmod 755 to make flash with gonk backend.
jlebar authored
478
479 define FLASH_GALAXYS2_CMD
7e03d15 @jlebar When flashing SGSII, don't error out if the device is already in downloa...
jlebar authored
480 @echo "Rebooting into download mode..." && $(ADB) reboot download && sleep 20 || \
481 echo "Perhaps the device is already in download mode?"
fe9f75a @jlebar Adding auto-chmod 755 to make flash with gonk backend.
jlebar authored
482 $(HEIMDALL) flash --factoryfs $(GONK_PATH)/out/target/product/galaxys2/system.img
483 $(FLASH_GALAXYS2_CMD_CHMOD_HACK)
484 endef
485
d2cd070 Makefile hackery for Galaxy S II, and fix broken -jN
Chris Jones authored
486 .PHONY: flash-galaxys2
f296b71 Check version of adb server before using it
Sinker Li authored
487 flash-galaxys2: image adb-check-version
fe9f75a @jlebar Adding auto-chmod 755 to make flash with gonk backend.
jlebar authored
488 $(FLASH_GALAXYS2_CMD)
489
490 .PHONY: flash-only-galaxys2
f296b71 Check version of adb server before using it
Sinker Li authored
491 flash-only-galaxys2: adb-check-version
fe9f75a @jlebar Adding auto-chmod 755 to make flash with gonk backend.
jlebar authored
492 $(FLASH_GALAXYS2_CMD)
d2cd070 Makefile hackery for Galaxy S II, and fix broken -jN
Chris Jones authored
493
509c71a Have maguro use TARGET_PROVIDES_RILD and add commands to flash it.
Chris Jones authored
494 .PHONY: flash-maguro
7ff7843 Use $(MAKE) and flash userdata.
Chris Jones authored
495 flash-maguro: image flash-only-maguro
509c71a Have maguro use TARGET_PROVIDES_RILD and add commands to flash it.
Chris Jones authored
496
497 .PHONY: flash-only-maguro
948fd80 Install gaia along with system image, and remove host xpcshell building ...
Chris Jones authored
498 flash-only-maguro: flash-only-fastboot
6f1857f Add support for akami (followup: add modifications to existing files)
Chris Jones authored
499
500 .PHONY: flash-akami
501 flash-akami: image flash-only-akami
502
503 .PHONY: flash-only-akami
948fd80 Install gaia along with system image, and remove host xpcshell building ...
Chris Jones authored
504 flash-only-akami: flash-only-fastboot
6f1857f Add support for akami (followup: add modifications to existing files)
Chris Jones authored
505
948fd80 Install gaia along with system image, and remove host xpcshell building ...
Chris Jones authored
506 # Flash devices that use the fastboot protocol.
507 .PHONY: flash-only-fastboot
508 flash-only-fastboot:
7ff7843 Use $(MAKE) and flash userdata.
Chris Jones authored
509 @$(call GONK_CMD, \
dc014f6 Fix some incorrect uses of |adb|, instead of |$(ADB)|.
Chris Jones authored
510 $(ADB) reboot bootloader && \
7ff7843 Use $(MAKE) and flash userdata.
Chris Jones authored
511 $(FASTBOOT) devices && \
948fd80 Install gaia along with system image, and remove host xpcshell building ...
Chris Jones authored
512 $(FASTBOOT) erase cache && \
7ff7843 Use $(MAKE) and flash userdata.
Chris Jones authored
513 $(FASTBOOT) erase userdata && \
6f1857f Add support for akami (followup: add modifications to existing files)
Chris Jones authored
514 $(FASTBOOT) flash userdata ./out/target/product/$(GONK)/userdata.img && \
7ff7843 Use $(MAKE) and flash userdata.
Chris Jones authored
515 $(FASTBOOT) flashall)
509c71a Have maguro use TARGET_PROVIDES_RILD and add commands to flash it.
Chris Jones authored
516
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
517 .PHONY: bootimg-hack
572039c @ThinkerYzu Config kernel for Android emulator with goldfish_armv7_defconfig.
ThinkerYzu authored
518 bootimg-hack: kernel-$(KERNEL)
519
8e7bcf9 Build B2G.apk into system.img
Michael Wu authored
520 OUT_DIR := $(GONK_PATH)/out/target/product/$(GONK)/system
6f1857f Add support for akami (followup: add modifications to existing files)
Chris Jones authored
521 DATA_OUT_DIR := $(GONK_PATH)/out/target/product/$(GONK)/data
8e7bcf9 Build B2G.apk into system.img
Michael Wu authored
522 APP_OUT_DIR := $(OUT_DIR)/app
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
523 GECKO_OUT_DIR := $(GECKO_OBJDIR)/dist/b2g
949b8ec Add temporary target to manually install gecko. Installing it as a syst...
Chris Jones authored
524
525 $(APP_OUT_DIR):
526 mkdir -p $(APP_OUT_DIR)
527
12c67df Remove mentions of b2g-android. r=tkim
Chris Jones authored
528 .PHONY: gecko-install-hack
529 gecko-install-hack: gecko
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
530 ifeq ($(GONK_BASE),glue/gonk)
2e3838e @michaelwu Fix install-gecko on gb
michaelwu authored
531 rm -rf $(OUT_DIR)/b2g
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
532 mkdir -p $(OUT_DIR)
6569210 @jlebar During gecko-gonk-hack make target, if there are multiple tarballs in th...
jlebar authored
533 # Extract the newest tarball in the gecko objdir.
3d12fe0 Add support for B2G widget backend
Michael Wu authored
534 ( cd $(OUT_DIR) && \
eb1c917 @ThinkerYzu Fix install-gaia
ThinkerYzu authored
535 tar xvfz $$(ls -t $(GECKO_OBJDIR)/dist/b2g-*.tar.gz | head -n1) )
b2720fe @allstarschh revise gecko-install-hack
allstarschh authored
536 find $(GONK_PATH)/out -name "system.img" | xargs rm -f
d1ebcbe @michaelwu Fix up toplevel Makefile
michaelwu authored
537 @$(call GONK_CMD,$(MAKE) $(MAKE_FLAGS) $(GONK_MAKE_FLAGS) systemimage-nodeps)
c06baa9 @michaelwu Integrate gecko into gonk build for ics
michaelwu authored
538 endif
3d12fe0 Add support for B2G widget backend
Michael Wu authored
539
948fd80 Install gaia along with system image, and remove host xpcshell building ...
Chris Jones authored
540 .PHONY: gaia
541 gaia:
ea90c2c @mneubrand Changed make gaia to make profile call in target gaia
mneubrand authored
542 $(MAKE) -C $(GAIA_PATH) profile
109ca0b Followup: nuke the old appcache before recreating it.
Chris Jones authored
543 rm -rf $(DATA_OUT_DIR)/local
611331e don't install gaia on system, we are out of disk space on akami
Andreas Gal authored
544 mkdir -p $(DATA_OUT_DIR)/local
099da83 @fabricedesre Copy gaia/profile/* to /data/local
fabricedesre authored
545 cp -r $(GAIA_PATH)/profile/* $(DATA_OUT_DIR)/local
c5694fa Build gaia into system image
Michael Wu authored
546
949b8ec Add temporary target to manually install gecko. Installing it as a syst...
Chris Jones authored
547 .PHONY: install-gecko
f296b71 Check version of adb server before using it
Sinker Li authored
548 install-gecko: gecko-install-hack adb-check-version
d1ebcbe @michaelwu Fix up toplevel Makefile
michaelwu authored
549 $(ADB) remount
5b51f3e Basic support for building an update package for Gecko.
Chris Jones authored
550 $(ADB) push $(GECKO_OUT_DIR) /system/b2g
d1ebcbe @michaelwu Fix up toplevel Makefile
michaelwu authored
551
552 .PHONY: install-gecko-only
553 install-gecko-only:
554 $(ADB) remount
5b51f3e Basic support for building an update package for Gecko.
Chris Jones authored
555 $(ADB) push $(GECKO_OUT_DIR) /system/b2g
9217fee Implement the install-gecko target for gonk
Chris Jones authored
556
249f515 Add |make install-gaia| target and INSTALL instructions for it
Chris Jones authored
557 # The sad hacks keep piling up... We can't set this up to be
558 # installed as part of the data partition because we can't flash that
559 # on the sgs2.
560 .PHONY: install-gaia
948fd80 Install gaia along with system image, and remove host xpcshell building ...
Chris Jones authored
561 install-gaia: adb-check-version
562 $(MAKE) -C $(GAIA_PATH) install-gaia
de0e536 @davidflanagan add copy-manifests target to make mozApps work
davidflanagan authored
563
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
564 .PHONY: image
0f51ea4 Initial "build system"
Chris Jones authored
565 image: build
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
566 @echo XXX stop overwriting the prebuilt nexuss4g kernel
0f51ea4 Initial "build system"
Chris Jones authored
567
d6de929 Add install guide and unlock-bootloader target.
Chris Jones authored
568 .PHONY: unlock-bootloader
f296b71 Check version of adb server before using it
Sinker Li authored
569 unlock-bootloader: adb-check-version
3e87939 @ThinkerYzu Use adb in gonk
ThinkerYzu authored
570 @$(call GONK_CMD,$(ADB) reboot bootloader && fastboot oem unlock)
d6de929 Add install guide and unlock-bootloader target.
Chris Jones authored
571
f44bf47 @jlebar Adding |make kill-b2g| target.
jlebar authored
572 # Kill the b2g process on the device.
573 .PHONY: kill-b2g
9f77e3f akami doesn't have killall, find the b2g process pid instead
Andreas Gal authored
574 .SECONDEXPANSION:
f296b71 Check version of adb server before using it
Sinker Li authored
575 kill-b2g: adb-check-version
9f77e3f akami doesn't have killall, find the b2g process pid instead
Andreas Gal authored
576 $(ADB) shell kill $(B2G_PID)
f44bf47 @jlebar Adding |make kill-b2g| target.
jlebar authored
577
75d0e6e |make sync && make flash| gets code, builds, and flashes attached nexus ...
Chris Jones authored
578 .PHONY: sync
0f51ea4 Initial "build system"
Chris Jones authored
579 sync:
156ac02 @jhford make git a makefile variable to allow alternate paths to git program
jhford authored
580 $(GIT) pull origin master
581 $(GIT) submodule sync
582 $(GIT) submodule update --init
0a25087 @jonallengriffin Add 'make package' target to bundle up the emulator
jonallengriffin authored
583
584 PKG_DIR := package
585
586 .PHONY: package
587 package:
588 rm -rf $(PKG_DIR)
589 mkdir -p $(PKG_DIR)/qemu/bin
23564a7 @jonallengriffin Unbreak 'make package'
jonallengriffin authored
590 mkdir -p $(PKG_DIR)/gaia
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
591 cp $(GONK_PATH)/out/host/linux-x86/bin/emulator $(PKG_DIR)/qemu/bin
592 cp $(GONK_PATH)/out/host/linux-x86/bin/emulator-arm $(PKG_DIR)/qemu/bin
593 cp $(GONK_PATH)/out/host/linux-x86/bin/adb $(PKG_DIR)/qemu/bin
0a25087 @jonallengriffin Add 'make package' target to bundle up the emulator
jonallengriffin authored
594 cp boot/kernel-android-qemu/arch/arm/boot/zImage $(PKG_DIR)/qemu
895b6ef @ThinkerYzu Merge from master
ThinkerYzu authored
595 cp -R $(GONK_PATH)/out/target/product/generic $(PKG_DIR)/qemu
23564a7 @jonallengriffin Unbreak 'make package'
jonallengriffin authored
596 cp -R $(GAIA_PATH)/tests $(PKG_DIR)/gaia
597 cd $(PKG_DIR) && tar -czvf qemu_package.tar.gz qemu gaia
0a25087 @jonallengriffin Add 'make package' target to bundle up the emulator
jonallengriffin authored
598
5b51f3e Basic support for building an update package for Gecko.
Chris Jones authored
599 UPDATE_PACKAGE_TARGET ?= b2g-gecko-update.mar
600 MAR ?= $(GECKO_OBJDIR)/dist/host/bin/mar
601 MAKE_FULL_UPDATE ?= $(GECKO_PATH)/tools/update-packaging/make_full_update.sh
602 .PHONY: gecko-full-update
603 gecko-update-full: gecko
604 MAR=$(MAR) $(MAKE_FULL_UPDATE) $(UPDATE_PACKAGE_TARGET) $(GECKO_OUT_DIR)
605 sha512sum $(UPDATE_PACKAGE_TARGET)
606 ls -l $(UPDATE_PACKAGE_TARGET)
607
fe8d968 Add a make package-toolchain target, which bundles up everything needed ...
Chris Jones authored
608 #
609 # Package up everything needed to build mozilla-central with
610 # --enable-application=b2g outside of a b2g git clone.
611 #
612
613 # A linux host is needed (well, it's easiest) to build *Gonk* and
614 # hence the libraries needed by the toolchain, but once built, the
615 # toolchain itself can be packaged for multiple targets.
616 TOOLCHAIN_TARGET ?= linux-x86
617
618 # List of all dirs that gecko depends on. These are relative to
619 # GONK_PATH.
620 #
621 # NB: keep this in sync with gecko/configure.in.
622 #
623 # XXX: why do we -Ibionic? There's some dep in there that's not
624 # exposed through a more specific -I. Not loading all of bionic
625 # results in a build error :|.
626 TOOLCHAIN_DIRS = \
627 bionic \
628 external/stlport/stlport \
800f76f @qdot Updated toolchain building rules to include dbus
qdot authored
629 external/dbus \
fe8d968 Add a make package-toolchain target, which bundles up everything needed ...
Chris Jones authored
630 frameworks/base/include \
631 frameworks/base/native/include \
632 frameworks/base/opengl/include \
633 frameworks/base/services/sensorservice \
634 hardware/libhardware/include \
635 hardware/libhardware_legacy/include \
2b3af23 @tterribe Bug 748448: Add cpufeatures to the toolchain dist
tterribe authored
636 ndk/sources/android/cpufeatures \
fe8d968 Add a make package-toolchain target, which bundles up everything needed ...
Chris Jones authored
637 ndk/sources/cxx-stl/system/include \
638 ndk/sources/cxx-stl/stlport/stlport \
639 out/target/product/$(GONK)/obj/lib \
640 prebuilt/ndk/android-ndk-r4/platforms/android-8/arch-arm \
641 prebuilt/$(TOOLCHAIN_TARGET)/toolchain/arm-eabi-4.4.3 \
642 system/core/include
643
800f76f @qdot Updated toolchain building rules to include dbus
qdot authored
644 # Toolchain versions are numbered consecutively. Toolchain version
645 # should be bumped whenever a new toolchain is generated
646 TOOLCHAIN_VERSION := 1
fe8d968 Add a make package-toolchain target, which bundles up everything needed ...
Chris Jones authored
647 TOOLCHAIN_PKG_DIR := gonk-toolchain-$(TOOLCHAIN_VERSION)
648 .PHONY: package-toolchain
649 package-toolchain: gonk
650 @rm -rf $(TOOLCHAIN_PKG_DIR); \
651 mkdir $(TOOLCHAIN_PKG_DIR); \
156ac02 @jhford make git a makefile variable to allow alternate paths to git program
jhford authored
652 $(GIT) rev-parse HEAD > $(TOOLCHAIN_PKG_DIR)/b2g-commit-sha1.txt; \
fe8d968 Add a make package-toolchain target, which bundles up everything needed ...
Chris Jones authored
653 $(foreach d,$(TOOLCHAIN_DIRS),\
654 mkdir -p $(TOOLCHAIN_PKG_DIR)/$(d); \
655 cp -r $(GONK_PATH)/$(d)/* $(TOOLCHAIN_PKG_DIR)/$(d); \
656 ) \
657 tar -cjvf $(TOOLCHAIN_PKG_DIR).tar.bz2 $(TOOLCHAIN_PKG_DIR); \
658 rm -rf $(TOOLCHAIN_PKG_DIR)
659
6b335d7 @ThinkerYzu Build adb when it is needed.
ThinkerYzu authored
660 $(ADB):
d1ebcbe @michaelwu Fix up toplevel Makefile
michaelwu authored
661 @$(call GONK_CMD,$(MAKE) adb)
6bfd699 @ThinkerYzu Add adb target to build adb
ThinkerYzu authored
662
663 .PHONY: adb
664 adb: $(ADB)
95b8e23 Make sure running right version of adb server
Sinker Li authored
665
f296b71 Check version of adb server before using it
Sinker Li authored
666 # Make sure running right version of adb server.
95b8e23 Make sure running right version of adb server
Sinker Li authored
667 #
668 # Adb will write some noise to stdout while running server of
669 # different version. It make rules that depend on output of adb going
f296b71 Check version of adb server before using it
Sinker Li authored
670 # wrong. adb start-server before doing anything can prevent it. adb
671 # start-server will kill current adb server and start a new instance
672 # if version numbers are not matched.
673 .PHONY: adb-check-version
674 adb-check-version: $(ADB)
675 $(ADB) start-server
83f48b4 @malini enable make test
malini authored
676
677 .PHONY: test
678 test:
fcf04f7 @malini split into two lines, and type=b2g not b2g-qemu
malini authored
679 cd marionette/marionette && \
680 sh venv_test.sh `which python` --emulator --homedir=$(abspath .) --type=b2g $(TEST_DIRS)
181e7a0 Add attach-gdb target to Makefile
Andreas Gal authored
681
682 GDB_PORT=22576
fa7c652 @michaelwu Improve gdb rules
michaelwu authored
683 GDBINIT=/tmp/b2g.gdbinit.$(shell whoami)
0b1d99b @michaelwu Add the necessary bits to build gecko on ICS
michaelwu authored
684 GDB=$(abspath toolchains/arm-linux-androideabi-4.6.3/linux-x86/bin/arm-linux-androideabi-gdb)
d78c10f add run-gdb target to Makefile
Andreas Gal authored
685 B2G_BIN=/system/b2g/b2g
181e7a0 Add attach-gdb target to Makefile
Andreas Gal authored
686
687 .PHONY: forward-gdb-port
688 forward-gdb-port: adb-check-version
689 $(ADB) forward tcp:$(GDB_PORT) tcp:$(GDB_PORT)
690
691 .PHONY: kill-gdb-server
692 kill-gdb-server:
693 if [ -n "$(GDBSERVER_PID)" ]; then $(ADB) shell kill $(GDBSERVER_PID); fi
694
695 .PHONY: attach-gdb-server
696 attach-gdb-server: adb-check-version forward-gdb-port kill-gdb-server
697 $(ADB) shell gdbserver :$(GDB_PORT) --attach $(B2G_PID) &
698 sleep 1
699
700 .PHONY: gdb-init-file
701 SYMDIR=$(GONK_OBJDIR)/symbols
702 gdb-init-file:
703 echo "set solib-absolute-prefix $(SYMDIR)" > $(GDBINIT)
fa7c652 @michaelwu Improve gdb rules
michaelwu authored
704 echo "set solib-search-path $(GECKO_OBJDIR)/dist/bin:$(GECKO_OBJDIR)/dist/lib:$(SYMDIR)/system/lib:$(SYMDIR)/system/lib/hw:$(SYMDIR)/system/lib/egl:$(and $(ANDROIDFS_DIR),$(ANDROIDFS_DIR)/symbols/system/lib:$(ANDROIDFS_DIR)/symbols/system/lib/hw:$(ANDROIDFS_DIR)/symbols/system/lib/egl)" >> $(GDBINIT)
87b58d1 @CervantesYu Update run-gdb target.
CervantesYu authored
705 echo "target extended-remote :$(GDB_PORT)" >> $(GDBINIT)
181e7a0 Add attach-gdb target to Makefile
Andreas Gal authored
706
707 .PHONY: attach-gdb
708 attach-gdb: attach-gdb-server gdb-init-file
709 $(GDB) -x $(GDBINIT) $(GECKO_OBJDIR)/dist/bin/b2g
d78c10f add run-gdb target to Makefile
Andreas Gal authored
710
711 .PHONY: disable-auto-restart
712 disable-auto-restart: adb-check-version kill-b2g
87b58d1 @CervantesYu Update run-gdb target.
CervantesYu authored
713 $(ADB) shell stop b2g
d78c10f add run-gdb target to Makefile
Andreas Gal authored
714
715 .PHONY: restore-auto-restart
716 restore-auto-restart: adb-check-version
87b58d1 @CervantesYu Update run-gdb target.
CervantesYu authored
717 $(ADB) shell start b2g
d78c10f add run-gdb target to Makefile
Andreas Gal authored
718
719 .PHONY: run-gdb-server
720 run-gdb-server: adb-check-version forward-gdb-port kill-gdb-server disable-auto-restart
87b58d1 @CervantesYu Update run-gdb target.
CervantesYu authored
721 $(ADB) shell LD_LIBRARY_PATH=/system/b2g gdbserver --multi :$(GDB_PORT) $(B2G_BIN) &
d78c10f add run-gdb target to Makefile
Andreas Gal authored
722 sleep 1
723
724 .PHONY: run-gdb
725 run-gdb: run-gdb-server gdb-init-file
726 $(GDB) -x $(GDBINIT) $(GECKO_OBJDIR)/dist/bin/b2g
0088a80 @shianyow Add makefile helpers for perf
shianyow authored
727
728 PERF_B2G_SYMFS = /tmp/b2g_symfs_$(GONK)
729 RECORD_DURATION ?= 10
730
731 define PERF_REPORT # $(call PERF_REPORT,flags)
732 $(ADB) shell perf record $(1) -o /data/local/perf.data sleep $(RECORD_DURATION)
733 $(ADB) pull /data/local/perf.data .
734 if [ "$(GONK)" == "galaxys2" ]; then \
735 perf report --symfs=$(PERF_B2G_SYMFS) --vmlinux=/vmlinux ; \
736 else \
737 perf report --symfs=$(PERF_B2G_SYMFS) --kallsyms=$(PERF_B2G_SYMFS)/kallsyms ; \
738 fi
739 endef
740
741 .PHONY: perf-create-symfs
742 perf-create-symfs:
743 @if [ ! -d $(PERF_B2G_SYMFS) ]; then \
744 echo "Creating direcotry $(PERF_B2G_SYMFS) for symbols..." ; \
745 mkdir $(PERF_B2G_SYMFS) ; \
746 cp -pr $(GONK_OBJDIR)/system $(PERF_B2G_SYMFS)/system ; \
747 cp -pr $(GONK_OBJDIR)/symbols/system/. $(PERF_B2G_SYMFS)/system/. ; \
748 if [ "$(GONK)" == "galaxys2" ]; then \
749 cp -pr $(KERNEL_DIR)/vmlinux $(PERF_B2G_SYMFS)/. ; \
750 else \
751 $(ADB) pull /proc/kallsyms $(PERF_B2G_SYMFS)/. ; \
752 fi ; \
753 cp -p $(GECKO_OBJDIR)/dist/lib/*.so $(PERF_B2G_SYMFS)/system/b2g/. ; \
754 cp -p $(GECKO_OBJDIR)/dist/bin/b2g $(PERF_B2G_SYMFS)/system/b2g/. ; \
755 fi
756
757 .PHONY: perf-clean-symfs
758 perf-clean-symfs:
759 @echo "Removing directory for symbols..."
760 @rm -rf $(PERF_B2G_SYMFS)
761
762 .PHONY: perf-top
763 perf-top:
764 $(ADB) shell perf top
765
766 .PHONY: perf-top-b2g
767 perf-top-b2g:
768 $(ADB) shell perf top -p $(B2G_PID)
769
770 .PHONY: perf-report
771 perf-report: perf-create-symfs
772 $(call PERF_REPORT,-a)
611331e don't install gaia on system, we are out of disk space on akami
Andreas Gal authored
773
0088a80 @shianyow Add makefile helpers for perf
shianyow authored
774 .PHONY: perf-report-b2g
775 perf-report-b2g: perf-create-symfs
776 $(call PERF_REPORT,-p $(B2G_PID))
777
778 .PHONY: perf-report-callgraph
779 perf-report-callgraph: perf-create-symfs
780 $(call PERF_REPORT,-a -g)
781
782 .PHONY: perf-report-callgraph-b2g
783 perf-report-callgraph-b2g: perf-create-symfs
784 $(call PERF_REPORT,-p $(B2G_PID) -g)
e4107a1 @kanru Add |update-time| make target
kanru authored
785
39c67cd @changyihsin Modify Makefile to simplify oprofile usage. You can use below commands t...
changyihsin authored
786
787 SYMBOLS_DIR := $(GONK_PATH)/out/target/product/$(GONK)/symbols
788 KERNEL_OBJ := $(GONK_PATH)/out/target/product/$(GONK)/obj/KERNEL_OBJ
789 .PHONY: op_setup op_start op_stop op_status op_shutdown op_pull op_show
790 op_setup:
c974d26 @changyihsin Don't touch target device's file system when doing oprofile.
changyihsin authored
791 @$(ADB) wait-for-device
39c67cd @changyihsin Modify Makefile to simplify oprofile usage. You can use below commands t...
changyihsin authored
792 @if [ "$(GONK)" == "galaxys2" ]; then \
c974d26 @changyihsin Don't touch target device's file system when doing oprofile.
changyihsin authored
793 $(ADB) shell opcontrol --setup; \
794 $(ADB) shell opcontrol --vmlinux=$(PWD)/$(KERNEL_DIR)/vmlinux; \
795 $(ADB) shell opcontrol --kernel-range=0x`$(ADB) shell cat /proc/kallsyms | grep ' _text' | cut -c 1-8`,0x`$(ADB) shell cat /proc/kallsyms | grep ' _etext' | cut -c 1-8`; \
ff130fe Throttle down cpu/gpu on maguro.
Chris Jones authored
796 $(ADB) shell opcontrol --event=CPU_CYCLES & \
39c67cd @changyihsin Modify Makefile to simplify oprofile usage. You can use below commands t...
changyihsin authored
797 else \
c974d26 @changyihsin Don't touch target device's file system when doing oprofile.
changyihsin authored
798 $(ADB) shell opcontrol --vmlinux=$(PWD)/$(KERNEL_DIR)/vmlinux; \
799 $(ADB) shell opcontrol --kernel-range=0x`$(ADB) shell cat /proc/kallsyms | grep ' _text' | cut -c 1-8`,0x`$(ADB) shell cat /proc/kallsyms | grep ' _etext' | cut -c 1-8`;\
800 $(ADB) shell opcontrol --timer &\
801 fi ;
39c67cd @changyihsin Modify Makefile to simplify oprofile usage. You can use below commands t...
changyihsin authored
802 op_start:
803 @echo "Start Profiling ..."
804 @echo -e "You can use \033[31m\"make op_status\"\033[0m to check profiling status, \033[31m\"make op_stop\"\033[0m to stop profiling"
805 @$(ADB) shell opcontrol --start
806 op_stop:
807 @echo "Stop Profiling ..."
808 @echo -e "You can use \033[31m\"make op_pull\"\033[0m to pull oprofile samples"
809 @$(ADB) shell opcontrol --stop
810 op_status:
811 @$(ADB) shell opcontrol --status
812 op_shutdown:
813 @$(ADB) shell opcontrol --shutdown
814 op_pull:
815 @echo "Pulling profiling log ..."
816 @echo -e "You can use \033[31m\"make op_show\"\033[0m to list profiling result"
c974d26 @changyihsin Don't touch target device's file system when doing oprofile.
changyihsin authored
817 @rm -rf oprofile
818 @mkdir oprofile
819 @$(ADB) pull /data/oprofile $(PWD)/oprofile/
820 @cp -pr $(SYMBOLS_DIR) $(PWD)/oprofile/symbols
821 @cp -pr $(GECKO_OBJDIR)/dist/b2g $(PWD)/oprofile/symbols
822 @cp -p $(GECKO_OBJDIR)/dist/bin/b2g $(PWD)/oprofile/symbols/b2g/
823 @cp -p $(GECKO_OBJDIR)/dist/lib/*.so $(PWD)/oprofile/symbols/b2g/
39c67cd @changyihsin Modify Makefile to simplify oprofile usage. You can use below commands t...
changyihsin authored
824 op_show:
825 @echo "Processing profiling samples ..."
826 @echo -e "The profiling result is saved in your \033[31moprofile/oprofile.log\033[0m"
c974d26 @changyihsin Don't touch target device's file system when doing oprofile.
changyihsin authored
827 @touch $(PWD)/oprofile/oprofile.log
828 @opreport --session-dir=oprofile -p $(PWD)/oprofile/symbols -l
829 @opreport --session-dir=oprofile -p $(PWD)/oprofile/symbols -l -o $(PWD)/oprofile/oprofile.log 2>/dev/null
a0e0238 @changyihsin Merge branch 'master' into oprofile
changyihsin authored
830
796fcf5 @kanru Use local timezone and set automatically at flash time.
kanru authored
831 TIMEZONE ?= $(shell date +%Z%:::z|tr +- -+)
e4107a1 @kanru Add |update-time| make target
kanru authored
832
833 .PHONY: update-time
834 update-time: adb
835 @echo "|make update-time TIMEZONE=<zone>| to set timezone"
836 $(ADB) wait-for-device
837 $(ADB) shell toolbox date `date +%s`
838 $(ADB) shell setprop persist.sys.timezone $(TIMEZONE)
3164db1 @shianyow Add makefile helpers for valgrind
shianyow authored
839
77e8fa4 @michaelwu Add support for ICS on Nexus S
michaelwu authored
840 VALGRIND_DIR=$(abspath $(GONK_BASE)/prebuilt/android-arm/valgrind)
3164db1 @shianyow Add makefile helpers for valgrind
shianyow authored
841 .PHONY: install-valgrind
842 install-valgrind: disable-auto-restart
843 $(ADB) remount
844 $(ADB) push $(VALGRIND_DIR) /data/local/valgrind
845 $(ADB) push $(GONK_OBJDIR)/symbols/system/bin/linker /system/bin/.
846 $(ADB) push $(GONK_OBJDIR)/symbols/system/lib/libc.so /system/lib/.
847 $(ADB) push $(GECKO_OBJDIR)/dist/lib/libxul.so /data/local/.
848 $(ADB) shell rm /system/b2g/libxul.so
3b40b69 @mikeaich Fix a symlink bug in the install-valgrind rule. ln needs the full filen...
mikeaich authored
849 $(ADB) shell ln -s /data/local/libxul.so /system/b2g/libxul.so
3164db1 @shianyow Add makefile helpers for valgrind
shianyow authored
850
851 .PHONY: uninstall-valgrind
852 uninstall-valgrind: restore-auto-restart
853 $(ADB) remount
854 $(ADB) push $(GONK_OBJDIR)/system/bin/linker /system/bin/.
855 $(ADB) push $(GONK_OBJDIR)/system/lib/libc.so /system/lib/.
856 $(ADB) push $(GECKO_OBJDIR)/dist/b2g/libxul.so /system/b2g/.
857 $(ADB) shell rm /data/local/libxul.so
858 $(ADB) shell rm -rf /data/local/valgrind
Something went wrong with that request. Please try again.