Skip to content

Commit 39885ba

Browse files
shr-projectSusan Montooth
authored andcommitted
mcf: change layout of build directories (v5.1.0)
:Release Notes: BSP layers are meant to be usable even when building for other MACHINEs and BBLAYERS is supposed to be "global" for build. Changes visible to developers: 1) use only one BUILDDIR for all machines, no need to build/store native sysroot for each machine in separate BUILD-MACHINE even when sstate-cache is reused 2) rename bitbake.rc to oe-init-build-env and allow users to source them and then call bitbake directly e.g. "bitbake -k webos-image" instead of using Makefile 3) merge functionality of toplevel Makefile and BUILD-MACHINE/Makefile to single Makefile and reuse oe-init-build-env to have all settings in only one place 4) use TOPDIR instead of PALMDIR [OWEBOS-2487] 5) conf/local.conf and bblayers.conf are now in toplevel directory and also shared by all MACHINES (weboslayers.py is also global) 6) use MACHINE/DISTRO from shell environment, allows easy iteration over MACHINEs e.g. for MACHINE in qemuarm qemux86 qemux86-64; do bitbake -k webos-image; done 7) this layout is similar to layouts used by other distributions and default layout 8) install and installnew target doing rsync of .ipk files was renamed to deploy and deploynew because it was conflicting with install* targets for bitbake :Detailed Notes: This layout is more efficient because it doesn't duplicate native sysroot. It doesn't cause more conflicts between MACHINEs, because each machine has (and always had) separate directory in sysroot. It's already included in official Yocto manual. https://bugzilla.yoctoproject.org/show_bug.cgi?id=5037 https://bugzilla.yoctoproject.org/show_bug.cgi?id=5400 :Testing Performed: I'm using this for all my builds for very long time. :QA Notes: No change to image. :Issues Addressed: [ES-346] Use the same BUILD directory for all MACHINEs [ES-1138] CCC: build.sh, mcf changes for shared BUILD directory Open-webOS-DCO-1.0-Signed-off-by: Martin Jansa <martin.jansa@lge.com> Change-Id: Iaff8ed15969afa51c748e32502cccd3f912810eb Reviewed-on: https://g2g.palm.com/4470 Reviewed-by: DCO Verification Reviewed-by: Susan Montooth <susan.montooth@lge.com> Tested-by: Susan Montooth <susan.montooth@lge.com>
1 parent 7c919b6 commit 39885ba

File tree

9 files changed

+231
-311
lines changed

9 files changed

+231
-311
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919
/cache
2020

2121
# Other build products
22-
BUILD-*/
22+
/BUILD/
23+
/BUILD-ARTIFACTS/
2324
/Makefile
2425
TAGS
2526
/bitbake.lock
2627
/mcf.status
28+
/oe-init-build-env
29+
/conf/
2730
__pycache__/
2831
tmp/
2932
patches/

Makefile.in

Lines changed: 0 additions & 137 deletions
This file was deleted.

build-templates/Makefile.in

Lines changed: 129 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# DO NOT MODIFY! This script is generated by mcf. Changes made
2-
# here will be lost. The source for this file is in ../Makefile.in.
2+
# here will be lost. The source for this file is in build-templates/Makefile.in.
33
#
44
# Copyright (c) 2008-2014 LG Electronics, Inc.
55
#
@@ -15,41 +15,147 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18+
srcdir := @srcdir@
1819
vpath := $(srcdir)
20+
machines := @machines@
1921

20-
srcdir := @abs_srcdir@
21-
abs_builddir := @abs_builddir@
22+
TIME := time
23+
SSH := /usr/bin/ssh
2224

23-
oecdir := $(srcdir)/oe-core
24-
oecscripts := $(oecdir)/scripts
25+
CONTINUOUS_BUILD_MARK :=
2526

26-
# should be set on the command line before using "make install"
27-
INSTALLDIR = /dev/null
27+
webos-image:
28+
all: webos-image
29+
30+
force:;:
2831

29-
# PALMDIR is an absolute version of $(srcdir).
30-
export PALMDIR := $(shell cd $(srcdir) && pwd)
32+
.PHONY: tags
33+
tags TAGS: force
34+
$(srcdir)/scripts/tag_oe.sh
35+
(cd $(srcdir)/bitbake && ../scripts/tag_bitbake.sh)
3136

32-
BITBAKEDIR := $(PALMDIR)/bitbake/bin
33-
BITBAKE := \
34-
unset LC_ALL; export LC_ALL; \
35-
LANG=en_US.UTF-8 \
36-
PATH=$(oecscripts):$(BITBAKEDIR):$$PATH \
37-
BUILDDIR=$(abs_builddir) \
38-
$(oecscripts)/bitbake
37+
define convenience
38+
$(1)-$(2)-%:
39+
export MACHINE=$(1) && $(TIME) $(MAKE) \
40+
CONTINUOUS_BUILD_MARK=$(CONTINUOUS_BUILD_MARK) \
41+
BBFLAGS='$(BBFLAGS)' \
42+
$(2)-$$* # convenience rule for task $(2) of component $$* for $(1)
43+
44+
remote-$(1)@$(1)-$(2)-%:
45+
$(SSH) $(BUILDER$(1)) "cd ${PWD} && $(MAKE) \
46+
CONTINUOUS_BUILD_MARK=$(CONTINUOUS_BUILD_MARK) \
47+
BBFLAGS='$(BBFLAGS) -S' \
48+
$(1)-$(2)-$$*"
49+
endef
50+
51+
conveniences := \
52+
clean \
53+
cleanall \
54+
cleanreport \
55+
cmp \
56+
cmpall \
57+
compile \
58+
configure \
59+
fetch \
60+
fetchall \
61+
install \
62+
just \
63+
listtasks \
64+
package \
65+
patch \
66+
patchall \
67+
report \
68+
reportall \
69+
sanity \
70+
sanityall \
71+
thin \
72+
thinall \
73+
unpack \
74+
unpackall \
75+
76+
PWD = $(shell pwd)
77+
78+
define subrule
79+
BUILDER$(1) :=
80+
81+
ifneq ($(BUILDER$(1)),)
82+
PREFIX$(1) := remote-$(1)@
83+
else
84+
PREFIX$(1) :=
85+
endif
86+
87+
$(foreach c, $(conveniences),$(eval $(call convenience,$(1),$(c))))
88+
89+
remote-$(1)@$(1)-%:
90+
$(TIME) $(SSH) $(BUILDER$(1)) "cd ${PWD} && $(TIME) $(MAKE) \
91+
CONTINUOUS_BUILD_MARK=$(CONTINUOUS_BUILD_MARK) \
92+
BBFLAGS='$(BBFLAGS) -S' \
93+
$(1)-$$*"
94+
95+
$(1)/%:
96+
export MACHINE=$(1) && $(TIME) $(MAKE) \
97+
CONTINUOUS_BUILD_MARK=$(CONTINUOUS_BUILD_MARK) \
98+
BBFLAGS='$(BBFLAGS)' \
99+
$$* # component $$* for $(1)
100+
101+
install-$(1):
102+
[ -d $(INSTALLDIR)/$(1) ] || mkdir -p $(INSTALLDIR)/$(1)
103+
export MACHINE=$(1) && $(TIME) $(MAKE) \
104+
CONTINUOUS_BUILD_MARK=$(CONTINUOUS_BUILD_MARK) \
105+
BBFLAGS='$(BBFLAGS)' \
106+
install \
107+
INSTALLDIR=$(INSTALLDIR)/$(1) # target install for $(1)
108+
109+
installnew-$(1):
110+
[ -d $(INSTALLDIR)/$(1) ] || mkdir -p $(INSTALLDIR)/$(1)
111+
export MACHINE=$(1) && $(TIME) $(MAKE) \
112+
CONTINUOUS_BUILD_MARK=$(CONTINUOUS_BUILD_MARK) \
113+
BBFLAGS='$(BBFLAGS)' \
114+
INSTALLSINCE=$(INSTALLSINCE) \
115+
installnew \
116+
INSTALLDIR=$(INSTALLDIR)/$(1) # target installnew for $(1)
117+
endef
118+
119+
$(foreach machine,$(machines),$(eval $(call subrule,$(machine))))
120+
121+
%: $(foreach machine,$(machines),$(PREFIX$(machine))$(machine)/%)
122+
: done with $@
123+
124+
install: $(foreach machine,$(machines),install-$(machine))
125+
: done with $@
126+
127+
installnew: $(foreach machine,$(machines),installnew-$(machine))
128+
: done with $@
129+
130+
clobber:
131+
@clobber_dirs@
132+
./mcf.status
133+
134+
oe-init-build-env mcf.status Makefile conf/local.conf conf/bblayers.conf: \
135+
$(srcdir)/build-templates/oe-init-build-env.in \
136+
$(srcdir)/build-templates/mcf-status.in \
137+
$(srcdir)/build-templates/Makefile.in \
138+
$(srcdir)/build-templates/local-conf.in \
139+
$(srcdir)/build-templates/bblayers-conf.in
140+
./mcf.status
141+
142+
# should be set on the command line before using "make install"
143+
INSTALLDIR = /dev/null
39144

40145
RSYNC := /usr/bin/rsync
41146
RSYNC_FLAGS := -avxq --delete
42147

43-
# From oe-core, presumably for runqemu
44-
export BB_ENV_EXTRAWHITE = MACHINE DISTRO TCMODE TCLIBC http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS PARALLEL_MAKE GIT_PROXY_COMMAND GIT_PROXY_IGNORE SOCKS5_PASSWD SOCKS5_USER WEBOS_DISTRO_BUILD_ID
148+
# everything else is already set by oe-init-build-env
149+
BITBAKE := . $(srcdir)/oe-init-build-env && bitbake
45150

46151
### intended for command line use
47152
BBFLAGS =
48153

49154
%:; $(BITBAKE) $(BBFLAGS) $*
50155

51156
define convenience
52-
$(1)-$(2)-%:; cd BUILD-$(1) && $(TIME) $(MAKE) $(2)-$$*
157+
$(1)-$(2)-%:; $(TIME) $(MAKE) $(2)-$$*
158+
$(1)-%:; $$(BITBAKE) $(BBFLAGS) -c $(1) $$*
53159
endef
54160

55161
conveniences := \
@@ -78,40 +184,21 @@ conveniences := \
78184
unpack \
79185
unpackall \
80186

81-
define convenience
82-
$(1)-%:; $$(BITBAKE) $(BBFLAGS) -c $(1) $$*
83-
endef
84-
85187
$(foreach c, $(conveniences),$(eval $(call convenience,$(c))))
86188

87-
88189
# In most cases, "install-foo" is a coded request
89190
# for 'bitbake -c install foo'. However, at least one component has a
90191
# name prefixed by "install-". Hence the need for the "just-" target
91192
# which lets us name "just-install-first" in order to request
92193
# "install-first". (Yes, I'm sorry it's complicated.)
93194
just-%:; $(BITBAKE) $(BBFLAGS) $*
94195

95-
core-image-minimal:
96-
all: core-image-minimal
97-
98-
ifeq ($(shell basename $(shell pwd)),BUILD-qemux86)
99-
IMAGES :=
100-
else
101196
IMAGES := images/*$(CONTINUOUS_BUILD_MARK)*.tar
102-
endif
103197

104-
install:
198+
deploy:
105199
[ -d $(INSTALLDIR) ] || mkdir -p $(INSTALLDIR)
106-
cd deploy && $(RSYNC) $(RSYNC_FLAGS) ipk $(IMAGES) $(INSTALLDIR)
200+
cd BUILD/deploy && $(RSYNC) $(RSYNC_FLAGS) ipk $(IMAGES) $(INSTALLDIR)
107201

108-
installnew:
202+
deploynew:
109203
[ -d $(INSTALLDIR) ] || mkdir -p $(INSTALLDIR)
110-
(cd deploy/ipk && tar cf - --newer $(INSTALLSINCE) .) | (cd $(INSTALLDIR) && tar xf -)
111-
112-
bitbake.rc Makefile conf/local.conf conf/bblayers.conf: \
113-
$(srcdir)/build-templates/bitbake-rc.in \
114-
$(srcdir)/build-templates/Makefile.in \
115-
$(srcdir)/build-templates/local-conf.in \
116-
$(srcdir)/build-templates/bblayers-conf.in
117-
./mcf.status
204+
(cd BUILD/deploy/ipk && tar cf - --newer $(INSTALLSINCE) .) | (cd $(INSTALLDIR) && tar xf -)

build-templates/bblayers-conf.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
# changes incompatibly
1818
LCONF_VERSION = "5"
1919

20-
PALMDIR ?= "@abs_srcdir@"
21-
TMPDIR := "@abs_builddir@"
22-
BBPATH = "${PALMDIR}:${TMPDIR}"
20+
TMPDIR := "@abs_srcdir@"
21+
BBPATH = "${TOPDIR}:${TMPDIR}"
2322

2423
# Pull in two optional configuration files to allow the user to override
2524
# component source directories, shared state locations, etc.
@@ -45,5 +44,5 @@ BBPATH = "${PALMDIR}:${TMPDIR}"
4544
# the meta-webos layer.
4645

4746
include ${HOME}/webos-global.conf
48-
include ${PALMDIR}/webos-local.conf
47+
include ${TOPDIR}/webos-local.conf
4948

0 commit comments

Comments
 (0)