# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-SUBDIRS = lua generic global doc templates
+SUBDIRS = lua generic global doc templates extensions
LOCALSUBDIRS = lua generic global local doc
TOPLEVEL = .
$(MAKE) -C global
$(MAKE) -C doc/man
$(MAKE) -C templates all
+ $(MAKE) -C extensions all
# this target creates a file E2_COMMIT, holding the current E2_COMMIT
# string, and cleans the tree in case E2_COMMIT changed since the last
$(MAKE) -C local install
$(MAKE) -C doc/man install
$(MAKE) -C templates install
+ $(MAKE) -C extensions install
uninstall:
$(MAKE) -C lua uninstall
$(MAKE) -C generic local
$(MAKE) -C local
$(MAKE) -C templates local
+ $(MAKE) -C extensions local
install-local:
scripts/e2-locate-project-root
$(MAKE) -C generic install-local
$(MAKE) -C local install-local
$(MAKE) -C templates install-local
+ $(MAKE) -C extensions install-local
install -m 644 buildconfig.lua $(LOCALLIBDIR)
doc:
--- /dev/null
+#
+# e2factory, the emlix embedded build system
+#
+# Copyright (C) 2007-2009 Gordon Hecker <gh@emlix.com>, emlix GmbH
+# Copyright (C) 2007-2009 Oskar Schirmer <os@emlix.com>, emlix GmbH
+# Copyright (C) 2007-2008 Felix Winkelmann, emlix GmbH
+#
+# For more information have a look at http://www.e2factory.org
+#
+# e2factory is a registered trademark by emlix GmbH.
+#
+# This file is part of e2factory, the emlix embedded build system.
+#
+# e2factory is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# 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, see <http://www.gnu.org/licenses/>.
+#
+
+SUBDIRS = $(shell ls | grep -v Makefile)
+TOPLEVEL = ..
+
+include $(TOPLEVEL)/make.vars
+
+CLEAN_FILES = *~
+
+all:
+ @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+install:
+ @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+local:
+ @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+install-local:
+ @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+doc:
+ @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+install-doc:
+ @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+clean:
+ @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+ rm -f $(CLEAN_FILES)
+
+.PHONY: all install local install-local doc install-doc clean
-- @return the extension configuration table
-- @return an error object on failure
function e2lib.read_extension_config()
- if e2util.exists(".e2/e2version") then
- return false, new_error(
- "Deprecated configuration file .e2/e2version exists.\n"..
- "Move configuration to .e2/extensions")
- end
local e = new_error("reading extension config file: %s",
e2lib.extension_config)
-
local rc = e2util.exists(e2lib.extension_config)
if not rc then
return false, e:append("config file does not exist")
e2lib.abort(e:cat(re))
end
else
- -- parse .e2/e2version for compatibility to e2factory versions without
- -- extension support (e2factory-2.3.0)
- local s = e2lib.read_line(".e2/e2version")
- local branch, tag = s:match("(%S+) (%S+)")
- if not branch or not tag then
- e2lib.abort(e:append("cannot parse e2 version"))
- end
- local ref
- if tag == "^" then
- e2lib.warnf("WOTHER", "using e2 version by branch")
- ref = string.format("refs/heads/%s", branch)
- else
- ref = string.format("refs/tags/%s", tag)
- end
- -- build an extension table pointing to e2factory core only
- extensions = {
- {
- name = "e2factory",
- ref=ref,
- }
- }
+ e2lib.warnf("WOTHER", "extension configuration not available")
+ extensions = {} -- empty list
+end
+
+local s = e2lib.read_line(".e2/e2version")
+local branch, tag = s:match("(%S+) (%S+)")
+if not branch or not tag then
+ e2lib.abort(e:append("cannot parse e2 version"))
+end
+local ref
+if tag == "^" then
+ e2lib.warnf("WOTHER", "using e2 version by branch")
+ ref = string.format("refs/heads/%s", branch)
+else
+ ref = string.format("refs/tags/%s", tag)
end
rc, re = e2lib.chdir(".e2")
e2lib.abort(e:cat(re))
end
+-- checkout e2factory itself
+local server = config.site.e2_server
+local location = config.site.e2_location
+local destdir = "e2"
+local skip_checkout = false
+e2lib.logf(2, "fetching e2factory (ref %s)", ref)
+rc, re = generic_git.git_clone_from_server(scache, server, location,
+ destdir, skip_checkout)
+if not rc then
+ e2lib.abort(e:cat(re))
+end
+e2lib.chdir(destdir)
+
+-- checkout ref
+local args = string.format("--track -b tmp '%s'", ref)
+rc, re = e2lib.git(nil, "checkout", args)
+if not rc then
+ e2lib.abort(e:cat(re))
+end
+
for _,ex in ipairs(extensions) do
- -- change to the project root directory
- rc, re = e2lib.chdir(root .. "/.e2")
+ -- change to the e2factory extensions directory
+ rc, re = e2lib.chdir(root .. "/.e2/e2/extensions")
if not rc then
e2lib.abort(e:cat(re))
end
- print(string.format("installing extension: %s (tag %s)", ex.name, ex.ref))
+ e2lib.logf(2, "fetching extension: %s (tag %s)", ex.name, ex.ref)
local server = config.site.e2_server
local location = string.format("%s/%s.git", config.site.e2_base, ex.name)
local destdir = ex.name
if not rc then
e2lib.abort(e:cat(re))
end
+end
- -- build and install
- local cmd = string.format("make PREFIX='%s' local install-local",
+-- build and install
+e2lib.logf(2, "building e2factory")
+rc, re = e2lib.chdir(root .. "/.e2/e2")
+if not rc then
+ e2lib.abort(e:cat(re))
+end
+local cmd = string.format("make PREFIX='%s' local install-local",
install_prefix)
- rc, re = e2lib.callcmd_capture(cmd)
- if not rc then
- e2lib.abort(e:cat(re))
- end
+rc, re = e2lib.callcmd_capture(cmd)
+if not rc then
+ e2lib.abort(e:cat(re))
end
e2lib.finish()
site = {
e2_server = "projects",
e2_location = "e2factory.git",
- e2_base = "."
+ e2_base = ".",
e2_branch = "e2factory-2.3",
e2_tag = "e2factory-2.3.0",
default_extensions = {
- { name = "e2factory", ref = "refs/heads/master", },
},
},
tools = {