From: David Farning <dfarning@gmail.com>
To: OpenEmbedded Development List
<openembedded-devel@lists.openembedded.org>
Subject: Getting Started -Makefile
Date: Mon, 19 Nov 2007 06:08:19 -0600 [thread overview]
Message-ID: <20071119120819.GA17788@lenovo> (raw)
I think that my getting started Makefile is ready for testing.
To setup a development BitBake\OpenEmbedded system:
##Do not run this from an existing bb/oe directory. It will##
##overwrite parts of your local.conf. ##
make a new test directory
change to the test directory
copy Makefile to directory
$make setup
$make build-package-vim
This eliminates many of problems the new users have setting up bb
and oe. There is no need to know any thing about svn of monotone.
I am caching sources in HOME to reduce traffic while testing.
I am still working on the quem testing image setup so I did not
include it.
Thanks
David Farning
# "Makefile" - a Makefile for setting up OpenEmbedded builds
#
# Copyright (c) 2007 David Farning <dfarning@gmail.com>
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA
#
# Thanks to Rod Whitby for the OpenMokoMakefile
# Set BITBAKE_SVN_REV to either HEAD or 1.8
BITBAKE_SVN_REV = HEAD
ifeq ("${BITBAKE_SVN_REV}","HEAD")
BB_SVN_PATH := bitbake/trunk/bitbake
else
BB_SVN_PATH := bitbake/branches/bitbake-1.8
endif
MTN := mtn
#Set OPENEMBEDDED_MTM_REV to either head of a specific revision
OPENEMBEDDED_MTN_REV = HEAD
ifneq ("${OPENEMBEDDED_MTN_REV}","HEAD")
OPENEMBEDDED_REV_FLAGS = -r ${OPENEMBEDDED_MTN_REV}
endif
OE_SNAPSHOT_SITE := http://www.openembedded.org/snapshots
MACHINE := qemux86
DISTRO := angstrom-2007.1
CWD := pwd
###############################################################################
# Setup
###############################################################################
.PHONY: setup
setup: setup-bitbake setup-mtn setup-openembedded setup-config setup-env
.PHONY: setup-bitbake
setup-bitbake stamps/bitbake:
[ -e stamps/bitbake ] || \
( svn co -r ${BITBAKE_SVN_REV} svn://svn.berlios.de/${BB_SVN_PATH} bitbake )
[ -d stamps ] || mkdir stamps
touch stamps/bitbake
OE.mtn:
if [ -z "`${MTN} --version | awk '{ print $$2; }'`" ] ; then \
echo 'Cannot determine version for monotone using "${MTN} --version"' ; \
false ; \
fi
[ -e OE.mtn ] || \
( ( version=`${MTN} --version | awk '{ print $$2; }'` ; \
wget -c -O OE.mtn.bz2 \
${OE_SNAPSHOT_SITE}/OE-this-is-for-mtn-$$version.mtn.bz2 || \
wget -c -O OE.mtn.bz2 \
${OE_SNAPSHOT_SITE}/OE.mtn.bz2 ) && \
bunzip2 -c OE.mtn.bz2 > OE.mtn.partial && \
mv OE.mtn.partial OE.mtn )
.PHONY: setup-mtn
setup-mtn stamps/OE.mtn:
[ -e OE.mtn ] || \
${MAKE} OE.mtn
[ -e stamps/OE.mtn ] || \
( ${MTN} --db=OE.mtn db migrate && \
${MTN} --db=OE.mtn pull monotone.openembedded.org org.openembedded.dev )
[ -d stamps ] || mkdir stamps
touch stamps/OE.mtn
.PHONY: setup-openembedded
setup-openembedded stamps/openembedded: stamps/OE.mtn
[ -e stamps/openembedded ] || \
( ${MTN} --db=OE.mtn checkout --branch=org.openembedded.dev \
${OPENEMBEDDED_REV_FLAGS} openembedded ) || \
( ${MTN} --db=OE.mtn checkout --branch=org.openembedded.dev \
-r `${MTN} --db=OE.mtn automate heads org.openembedded.dev | head -n1` openembedded )
[ -d stamps ] || mkdir stamps
touch stamps/openembedded
.PHONY: setup-config
setup-config build/conf/local.conf:
[ -e build/conf/local.conf ] || \
( mkdir -p build/conf; \
cp openembedded/conf/local.conf.sample build/conf/local.conf; \
sed -i -e 's/^#[[:space:]]*MACHINE[[:space:]]*=[[:space:]]*\".*\"/MACHINE = \"${MACHINE}\"/' build/conf/local.conf; \
sed -i -e 's/^#[[:space:]]*DISTRO[[:space:]]*=[[:space:]]*\".*\"/DISTRO = \"${DISTRO}\"/' build/conf/local.conf; \
sed -i -e 's|BBFILES := "$${@bb.*|BBFILES := "${shell pwd}/openembedded/packages/*/*.bb"|' build/conf/local.conf; \
sed -i -e 's|# EDIT THIS FILE.*||' build/conf/local.conf; \
sed -i -e 's|REMOVE_THIS_LINE.*||' build/conf/local.conf; )
setup-env:
[ -e setup-env ] || \
echo 'export OEDIR="'`pwd`'"' > setup-env
echo \
'export BBPATH="$${OEDIR}/build:$${OEDIR}/openembedded"' >> setup-env
echo \
'export PATH="$${OEDIR}/bitbake/bin:$${PATH}"' >> setup-env
###############################################################################
# Update
###############################################################################
.PHONY: update
update: update-bitbake update-mtn update-openembedded
.PHONY: update-bitbake
update-bitbake: stamps/bitbake
cd bitbake && svn update -r ${BITBAKE_SVN_REV}
.PHONY: update-mtn
update-mtn: stamps/OE.mtn
if [ "${OPENMOKO_MTN_REV}" != "`(cd openembedded && ${MTN} automate get_base_revision_id)`" ] ; then \
${MTN} --db=OE.mtn pull monotone.openembedded.org org.openembedded.dev ; \
fi
.PHONY: update-openembedded
update-openembedded: update-mtn stamps/openembedded
( cd openembedded && ${MTN} update ${MTN_REV_FLAGS} ) || \
( cd openembedded && ${MTN} update \
-r `${MTN} automate heads | head -n1` )
###############################################################################
# Build Tests
###############################################################################
#FIXME build sdk should sdk be what I have been calling the cross compiler + tools?
#FIXME build test package
#FIXME build test distro
#FIXME build test qemu image
###############################################################################
# Build Package
###############################################################################
.PHONY: build-package-%
build-package-%: setup
( . ./setup-env \
&& echo $$PATH \
&& echo $$BBPATH \
&& bitbake -c build $* )
.PHONY: rebuild-package-%
rebuild-package-%: setup
( . ./setup-env && bitbake -c rebuild $* )
.PHONY: clean-package-%
clean-package-%: setup
( . ./setup-env && bitbake -c clean $* )
###############################################################################
# Clean
###############################################################################
.PHONY: clean
clean: clean-openembedded
.PHONY: clean-openembedded
clean-openembedded:
rm -rf tmp
###############################################################################
# Clobber
###############################################################################
.PHONY: clobber
clobber: clobber-bitbake clobber-openembedded clobber-config clobber-env
.PHONY: clobber-bitbake
clobber-bitbake:
rm -rf bitbake stamps/bitbake
.PHONY: clobber-openembedded
clobber-openembedded: clean-openembedded
rm -rf openembedded stamps/openembedded
.PHONY: clobber-config
clobber-config:
rm -rf build/conf/local.conf
.PHONY: clobber-env
clobber-env:
rm -rf setup-env
next reply other threads:[~2007-11-19 13:09 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 12:08 David Farning [this message]
2007-11-19 14:33 ` Getting Started -Makefile Koen Kooi
2007-11-19 23:51 ` Rod Whitby
2007-11-20 9:12 ` pHilipp Zabel
2007-11-20 17:57 ` Tim Bird
2007-11-20 20:00 ` Cliff Brake
2007-11-20 20:38 ` Philip Balister
2007-11-20 23:25 ` Florian Boor
2007-11-21 2:24 ` Paul Sokolovsky
2007-11-21 3:38 ` Rod Whitby
2007-11-21 2:24 ` Paul Sokolovsky
2007-11-21 5:44 ` Rod Whitby
2007-11-21 17:45 ` Paul Sokolovsky
2007-11-22 1:35 ` Michael 'Mickey' Lauer
2007-11-22 4:20 ` Lorn Potter
2007-11-22 8:14 ` Esben Haabendal
2007-11-23 1:05 ` Lorn Potter
2007-11-21 17:58 ` Tim Bird
2007-11-21 18:29 ` Paul Sokolovsky
2007-11-21 23:17 ` Rod Whitby
2007-11-22 0:44 ` Tim Bird
2007-11-22 20:29 ` Paul Sokolovsky
2007-11-21 19:32 ` Philip Balister
2007-11-21 19:32 ` Philip Balister
2007-11-20 21:16 ` Rod Whitby
2007-11-21 6:20 ` Esben Haabendal
2007-11-21 17:57 ` Paul Sokolovsky
2007-11-21 23:04 ` Rod Whitby
2007-11-22 8:40 ` Esben Haabendal
2007-11-20 9:39 ` Richard Purdie
2007-11-20 11:06 ` Rod Whitby
2007-11-20 12:30 ` Koen Kooi
2007-11-20 21:20 ` Rod Whitby
2007-11-20 9:58 ` Koen Kooi
2007-11-20 11:11 ` Rod Whitby
2007-11-20 12:27 ` Koen Kooi
2007-11-20 21:19 ` Rod Whitby
2007-11-20 14:39 ` Paul Sokolovsky
2007-11-20 23:20 ` Florian Boor
2007-11-20 11:44 ` Rod Whitby
2007-11-20 13:10 ` Koen Kooi
2007-11-20 21:11 ` Rod Whitby
2007-11-20 23:06 ` Lorn Potter
2007-11-19 14:41 ` Holger Freyther
2007-11-19 18:32 ` Tobias Pflug
2007-11-19 21:08 ` Lorn Potter
2007-11-20 9:33 ` Richard Purdie
2007-11-20 10:46 ` Marcin Juszkiewicz
2007-11-20 15:32 ` Mike (mwester)
2007-11-20 17:04 ` Marcin Juszkiewicz
2007-11-20 17:29 ` Holger Freyther
2007-11-20 17:29 ` Koen Kooi
2007-11-20 23:12 ` Lorn Potter
2007-11-22 1:32 ` Michael 'Mickey' Lauer
2007-11-22 1:28 ` The truth about OE team being afraid of 'make' (was: Getting Started -Makefile) Michael 'Mickey' Lauer
2007-11-22 3:15 ` Chris Larson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071119120819.GA17788@lenovo \
--to=dfarning@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.