Makefile
https://github.com/zwts/gaia/blob/v2.2/Makefile
Makefile 基础语法入门:
http://www.ruanyifeng.com/blog/2015/02/make.html
注释内容
Global configrations
- GAIA_DOMAIN
- SYSTEM
- ADB
- DEBUG
- REPORTER
- MOZPREFOUT: File path to output mozperf data. Empty mean stdout.
- MARIONETTE_RUNNER_HOST
- COVERAGE
- GAIA_APP_CONFIG
Lint code
- make hint
- make gjslint
- make lint
B2G Desktop
- USE_LOCAL_XULRUNNER_SDK
- XULRUNNER_DIRECTORY
正文
- MAKEFLAGS=-r
- -r禁止使用build-in规则
- https://www.gnu.org/software/make/manual/make.html#Implicit-Rules
- REBUILD
- GAIA_DISTRIBUTION_DIR
- LOCALE_BASEDIR
- LOCALES_FILE
- 上述参数定义/改变的情况下,需要rebuild(具体rebuild操作
gaia/build/rebuild.js)
- WGET_OPTS?=-c -nv wget参数
- DEVICE_DEBUG?=0 是否默认打开设备可调试
- NO_LOCK_SCREEN?=0 是否默认打开锁屏
- SCREEN_TIMEOUT?=-1 是否打开屏幕超时
- PRODUCTION?=0 区别编译user/userdebug/eng版本,PRODUCTION is also set for user and userdebug B2G builds(PRODUCTION=1)
- GAIA_OPTIMIZE?=0
webpp-optimize will do below things:- Inline embeded html from into html and commented(<!–CONTENT–>).
- Concat l10n resource to json files and put them as link and attach to html.
- Aggregate and uglify all JS files used in html to one JS file.
- Optimize inline JS/CSS content.
- GAIA_DEV_PIXELS_PER_PX?=1
- P?=1 Parallel build for multicores CPU
- GAIA_DPPX Alias of GAIA_DEV_PIXELS_PER_PX
- DOGFOOD?=0dogfood测试,零时版本?会影响:
- PRODUCTION
- GAIA_APP_TARGET=dogfood
- BUILD_CONFIG
- NODE_MODULES_SRC
- git-gaia-node-modules
- modules.tar
NODE_MODULES_CACHEDIR=modules_tar_cachedir
GAIA_DEVICE_TYPE?=phone device type customization
- phone - default
- tablet
- tv
TEST_AGENT_PORT?=8789 use for:
- .PHONY: test-agent-server(.PHONY 声明伪目标,每次都执行,而不去监测是否存在目标文件)
- .PHONY: test-agent-test
- GAIA_APP_TARGET?=engineering
use for build app list:- 路径为gaia/build/config/phone/app-engineer.list
- GAIA_APP_CONFIG=$(GAIA_DIR)$(SEP)build$(SEP)config$(SEP)$(GAIA_DEVICE_TYPE)$(SEP)apps-$(GAIA_APP_TARGET).list (Makefile line:350)
- DESKTOP?=$(DEBUG) Enable compatibility to run in Firefox Desktop
- NOFTU?=0 Disable first time experience screen 去掉开机设置向导相关内容
- NOFTUPING?=0 Disable first time ping
- FTU_PING_URL?=https://fxos.telemetry.mozilla.org/submit/telemetry if NOFTUPING = 0
- REMOTE_DEBUGGER?=0 Automatically enable remote debugger
- BUILD_DEBUG?=0 Debug mode for build process
- RAPTOR?=0 Are we building for RAPTOR?
Raptor是一种可视化的程序设计环境,为程序和算法设计的基础课程的教学提供实验环境。使用RAPTOR设计的程序和算法可以直接转换成为C++、C#、Java等高级程序语言 - SHARE_PERF_USAGE?=1 Share performance and usage data
- PROFILE_FOLDER
- profile(default)
- profile-debug(firefox Desktop/debug mode)
- profile-test(test-integration)
- STAGE_DIR gaia/build_stage
- LOCAL_DOMAINS
- ADB?=adb 定义adb工具
- SCHEME [skim] app://
- SYSTEM system application url: app://system.gaiamobile.org
- BUILD_APP_NAME
正在编译的APP名字,可以在编译的时候在参数中用APP=ftu来指定 BUILDAPP?=desktop BUILDAPP variable defines the target b2g platform (eg desktop, device)
and exports it for the gaia-marionette script
https://www.blackglory.me/experience-firefox-os/npm_config_loglevel=warn Ensure that NPM only logs warnings and errors
- REPORTER
- mocha-tbpl-reporter
- spec
- MARIONETTE_RUNNER_HOST
- marionette-socket-host
- marionette-b2gdesktop-host
MAKECMDGOALS make 在执行时会设置一个特殊变量 – “MAKECMDGOALS” ,该变量记录了命令行参数指定的终极目标列表,没有通过参数指定终极目标时此变量为空。该变量仅限于用在特殊场合(比如判断),在 Makefile 中最好不要对它进行重新定义。
- demo
- dogfood
- production
- test-integration
GAIA_PORT?=:8080 In debug mode the offline cache is not used (even if it is generated) and
Gaia is loaded by a built-in web server via port GAIA_PORT.SHELL := /bin/bash Force bash for all shell commands since we depend on bash-specific syntax
- GAIA_DIR := $(CURDIR) CURDIR是make的内嵌变量,自动设置为当前目录
- SYS=$(shell uname -s)
- ARCH?=$(shell uname -m) what OS are we on?
Configuration for pre-built or already downloaded b2g (or alternative)
- USE_LOCAL_XULRUNNER_SDK
- XULRUNNER_DIRECTORY
- XPCSHELL_GUESS Some guesswork to figure out where the xpcshell binary really is
|
|
XPCSHELLSDK
XPCSHELL_GUESS => xpcshellXULRUNNERSDK
XPCSHELLSDK/run-mozilla.sh
Configuration for a downloaded b2g desktop
- B2G_SDK_VERSION
- B2G_SDK_DATE
- XULRUNNER_BASE_DIR b2g_sdk
- XULRUNNER_DIRECTORY
- GAIA_DISTRIBUTION_DIR
|
|
- SETTINGS_PATH build/config/custom-settings.json
- KEYBOARD_LAYOUTS_PATH build/config/keyboard-layouts.json
- CONTACTS_IMPORT_SERVICES_PATH build/config/communications_services.json
EMAIL_SERVICES_PATH
GAIA_APP_SRCDIRS
- GAIA_LOCALES_PATH locales
- LOCALES_FILE shared/resources/languages.json
- GAIA_LOCALE_SRCDIRS $(GAIA_DIR)$(SEP)shared $(GAIA_APPDIRS)
- GAIA_DEFAULT_LOCALE en-US
- GAIA_PRETRANSLATE
- GAIA_CONCAT_LOCALES
- MD5SUM md5sum -b
- SED_INPLACE_NO_SUFFIX sed -i
- DOWNLOAD_CMD wget $(WGET_OPTS)
- TAR_WILDCARDS tar –wildcards
Test agent
- TEST_AGENT_CONFIG
- TEST_AGENT_COVERAGE
- TEST_COMMON
- NODEJS
- NPM
Marionette testing variables
- make sure we’re python 2.7.x
- MARIONETTE_HOST ?= localhost
- MARIONETTE_PORT ?= 2828
BUILD_CONFIG
Generate profile
- target: PROFILE_FOLDER
- need:
- profile-dir: @test -d $(PROFILE_FOLDER) || mkdir -p $(PROFILE_FOLDER)
- build-app @$(call run-js-command,update-webapps-json)
- test-agent-config
- contacts
- extensions
- b2g_sdk
- .git/hooks/pre-commit