37
38
39 comma := ,
40
41 CWD := $(CURDIR)
42 ifneq (1,$(words $(CWD)))
43 $(error The mozilla directory cannot be located in a path with spaces.)
44 endif
45
46 ifeq "$(CWD)" "/"
47 CWD := /.
48 endif
49
$(info hoge topdir=$(TOPSRCDIR)) <=空
$(info hoge objdir=$(OBJDIR)) <=空
$(info hoge mozobjdir=$(MOZ_OBJDIR)) <=空
50 ifndef TOPSRCDIR
51 ifeq (,$(wildcard client.mk))
52 TOPSRCDIR := $(patsubst %/,%,$(dir $(MAKEFILE_LIST)))
53 MOZ_OBJDIR = .
54 else
55 TOPSRCDIR := $(CWD)
56 endif
57 endif
$(info hoge mozobjdir=$(MOZ_OBJDIR)) <=空
58
59
60
61 AUTOCONF ?= $(shell which autoconf-2.13 autoconf2.13 autoconf213 2>/dev/null | grep -v '^no autoconf' | head -1)
62
63
64 ifeq (,$(strip $(AUTOCONF)))
65 AUTOCONF = $(shell which fink >/dev/null 2>&1 && echo `which fink`/../../lib/autoconf2.13/bin/autoconf)
66 endif
67
68 ifeq (,$(strip $(AUTOCONF)))
69 AUTOCONF=$(error Could not find autoconf 2.13)
70 endif
71
72 SH := /bin/sh
73 PERL ?= perl
74 PYTHON ?= python
75
76 CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
77 ifdef CONFIG_GUESS_SCRIPT
78 CONFIG_GUESS := $(shell $(CONFIG_GUESS_SCRIPT))
79 endif
80
81
82
83
84
85 ifneq (,$(findstring mingw,$(CONFIG_GUESS)))
86
87 ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk))
88 $(error This source tree appears to have Windows-style line endings. To \
89 convert it to Unix-style line endings, run \
90 "python mozilla/build/win32/mozilla-dos2unix.py")
91 endif
92 endif
93
94
95
96
97
98
99 MOZCONFIG_LOADER := build/autoconf/mozconfig2client-mk
100
101 define CR
102
103
104 endef
105
106
107
108
109 $(eval $(subst ||,$(CR),$(shell _PYMAKE=$(.PYMAKE) $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) 2> $(TOPSRCDIR)/.mozconfig.out | sed 's/$$/||/')))
110
111
112
113 ifeq (,$(findstring -j,$(MOZ_MAKE_FLAGS)))
114 cores=$(shell $(PYTHON) -c 'import multiprocessing; print(multiprocessing.cpu_count())')
115 MOZ_MAKE_FLAGS += -j$(cores)
116 endif
117
118
119 ifndef MOZ_OBJDIR
120 MOZ_OBJDIR = obj-$(CONFIG_GUESS)
121 else
122
123 ifneq (,$(findstring mingw,$(CONFIG_GUESS)))
124 ifeq (1_a,$(.PYMAKE)_$(firstword a$(subst /, ,$(MOZ_OBJDIR))))
125 $(error For Windows Pymake builds, MOZ_OBJDIR must be a Windows [and not MSYS] style path.)
126 endif
127 endif
128 endif
$(info hoge topdir =$(TOPSRCDIR))
$(info hoge objdir =$(OBJDIR))
$(info hoge mozobjdir=$(MOZ_OBJDIR))
$(info hoge config =$(CONFIG_GUESS))
gecko/makeの実行結果
hoge topdir =/home/user01/B2G_nexus/B2G/gecko
hoge objdir =
hoge mozobjdir =obj-x86_64-unknown-linux-gnu<= こっちがおかしい。
hoge config =x86_64-unknown-linux-gnu <= これがおかしい?<=こういうものみたい。
./build.sh geckoの場合の結果
hoge topdir =/home/user01/B2G_nexus/B2G/gecko
hoge objdir =
hoge mozobjdir =/home/user01/B2G_nexus/B2G/gecko/objdir-gonk-debug <=ここが違うのがおかしい。
hoge config =x86_64-unknown-linux-gnu
129
130 ifdef MOZ_BUILD_PROJECTS
131
132 ifdef MOZ_CURRENT_PROJECT
133 OBJDIR = $(MOZ_OBJDIR)/$(MOZ_CURRENT_PROJECT)
134 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
135 BUILD_PROJECT_ARG = MOZ_BUILD_APP=$(MOZ_CURRENT_PROJECT)
136 else
137 OBJDIR = $(error Cannot find the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
138 MOZ_MAKE = $(error Cannot build in the OBJDIR when MOZ_CURRENT_PROJECT is not set.)
139 endif
140
141 else
142
143 OBJDIR = $(MOZ_OBJDIR)
144 MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
145
146 endif
147
148
149 CONFIGURES := $(TOPSRCDIR)/configure
150 CONFIGURES += $(TOPSRCDIR)/js/src/configure
151
152
153 OBJDIR_TARGETS = install export libs clean realclean distclean alldep maybe_clobber_profiledbuild upload sdk installer package fast-package package-compare stage-package source-package l10n-check