include $(TOPLEVEL)/make.vars
-CLEAN_FILES = *~ *.lc *.o *.so lua-version-map.lua e2-su-2.2
+CLEAN_FILES = *~ *.lc *.o *.so lua-version-map.lua
.PHONY: all install uninstall local install-local clean
-all: e2generic_global.lc luafile_ll_global.so e2util_global.so e2-su-2.2 sha1.so
+all:
install: all
- install -m 644 e2generic_global.lc $(DESTDIR)$(LIBDIR)
- install -m 755 sha1.so $(DESTDIR)$(LIBDIR)
- install -m 755 luafile_ll_global.so $(DESTDIR)$(LIBDIR)
- install -m 755 e2util_global.so $(DESTDIR)$(LIBDIR)
- install -m 4754 -o root -g $(E2_GROUP) e2-su-2.2 $(DESTDIR)$(BINDIR)/
uninstall:
- rm -f $(DESTDIR)$(BINDIR)/e2-su-2.2
- rm -f $(DESTDIR)$(LIBDIR)/e2generic_global.lc
- rm -f $(DESTDIR)$(LIBDIR)/luafile_ll_global.so
- rm -f $(DESTDIR)$(LIBDIR)/e2util_global.so
-local: e2generic_local.lc luafile_ll_local.so e2util_local.so sha1.so
+local:
install-local: local
- mkdir -p $(LOCALLIBDIR) $(LOCALMAKDIR)
- install -m 755 -d $(LOCALPLUGINDIR)
- install -m 644 e2generic_local.lc $(LOCALLIBDIR)
- install -m 755 sha1.so $(LOCALLIBDIR)
- install -m 755 luafile_ll_local.so $(LOCALLIBDIR)
- install -m 755 e2util_local.so $(LOCALLIBDIR)
- install -m 644 e2-su-2.2.c $(LOCALMAKDIR)
doc:
for s in $(SUBDIRS) ; do \
clean:
rm -f $(CLEAN_FILES)
-e2generic_global.lc: strict.lua collection.lua e2lib_global_prefix.lua \
- plugin.lua \
- e2lib.lua e2option.lua hash.lua tools.lua \
- transport.lua cache.lua url.lua scm.git.lua \
- luafile.lua lua-version-map.lua \
- error.lua lock.lua
- $(BUILD_LUAC) -o $@ $^
-
-e2generic_local.lc: strict.lua collection.lua e2lib_local_prefix.lua \
- e2lib.lua e2option.lua hash.lua tools.lua \
- transport.lua cache.lua url.lua scm.git.lua \
- luafile.lua lua-version-map.lua
- $(LUAC) -o $@ $^
-
%: %.in
$(TOPLEVEL)/scripts/genscript.sh $< $@
-e2-su-2.2: e2-su-2.2.c
- $(CC) $(CFLAGS) $(E2_SU_CFLAGS) $(LDFLAGS) $< -o $@
-
-luafile_ll_global.so: luafile_ll.c
- $(CC) $(CFLAGS) $(BUILD_LUA_CPPFLAGS) $(LDFLAGS) -shared -fPIC $< -o $@
-
-e2util_global.so: e2util.c
- $(CC) $(CFLAGS) $(BUILD_LUA_CPPFLAGS) $(LDFLAGS) -shared -fPIC $< -o $@
-
-luafile_ll_local.so: luafile_ll.c
- $(CC) -DLOCAL $(CFLAGS) $(LUA_CPPFLAGS) $(LDFLAGS) -shared -fPIC $< -o $@
-
-e2util_local.so: e2util.c
- $(CC) -DLOCAL $(CFLAGS) $(LUA_CPPFLAGS) $(LDFLAGS) -shared -fPIC $< -o $@
-
%.o: %.c
$(CC) $(CFLAGS) $(LUA_CPPFLAGS) $(LDFLAGS) -fPIC -o $@ -c $<
-
-sha1.so: sha1.o lsha1.o
- $(CC) -o $@ -shared sha1.o lsha1.o
#include <lauxlib.h>
-#ifndef LOCAL
-# define ENTRY_POINT luaopen_e2util_global
-#else
-# define ENTRY_POINT luaopen_e2util_local
-#endif
-
-
static char buffer[ PATH_MAX + 1 ];
};
-int ENTRY_POINT(lua_State *lua)
+int luaopen_e2util(lua_State *lua)
{
luaL_register(lua, "e2util", lib);
globalL = lua;
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/>.
]]
-- loads required libraries
-require("e2util_local")
-require("luafile_ll_local")
+require("e2util")
+require("luafile_ll")
#include <lualib.h>
#include <lauxlib.h>
-#ifndef LOCAL
-# define ENTRY_POINT luaopen_luafile_ll_global
-#else
-# define ENTRY_POINT luaopen_luafile_ll_local
-#endif
-
static int
lua_fopen(lua_State *lua)
{
{ NULL, NULL }
};
-int ENTRY_POINT(lua_State *lua)
+int luaopen_luafile_ll(lua_State *lua)
{
luaL_register(lua, "luafile_ll", lib);
return 1;
include $(TOPLEVEL)/make.vars
+VPATH = .:$(TOPLEVEL)/generic
+
SCRIPTS =
GLOBALLUATOOLS = e2-create-project e2-fetch-project e2-install-e2 e2-root
GLOBALSHTOOLS = e2-locate-project-root e2ssh
.PHONY: all install uninstall clean
all: e2 e2-root $(SCRIPTS) e2-su $(GLOBALLUATOOLS:=.lc) \
- $(GLOBALSHTOOLS:=.sh) e2.conf
+ $(GLOBALSHTOOLS:=.sh) e2.conf e2generic.lc sha1.so e2-su-2.2 \
+ luafile_ll.so e2util.so
install: all
for i in $(GLOBALLUATOOLS) ; do \
fi
install -m 644 e2.conf $(DESTDIR)$(SYSCONFDIR)/e2.conf.sample
install -d -m 2775 -g $(E2_GROUP) $(DESTDIR)$(LOCALSTATEDIR)
+ install -m 644 e2generic.lc $(DESTDIR)$(LIBDIR)
+ install -m 755 sha1.so $(DESTDIR)$(LIBDIR)
+ install -m 755 luafile_ll.so $(DESTDIR)$(LIBDIR)
+ install -m 755 e2util.so $(DESTDIR)$(LIBDIR)
+ install -m 4754 -o root -g $(E2_GROUP) e2-su-2.2 $(DESTDIR)$(BINDIR)/
uninstall:
for i in $(GLOBALLUATOOLS) ; do \
for i in $(GLOBALSHTOOLS) ; do \
rm -f $(DESTDIR)$(BINDIR)/$$i ; \
done
+ rm -f $(DESTDIR)$(BINDIR)/e2-su-2.2
+ rm -f $(DESTDIR)$(LIBDIR)/e2generic.lc
+ rm -f $(DESTDIR)$(LIBDIR)/luafile_ll.so
+ rm -f $(DESTDIR)$(LIBDIR)/e2util.so
rm -f $(DESTDIR)$(TOOLDIR)/e2-root
rm -f $(DESTDIR)$(BINDIR)/e2-su
rm -f $(DESTDIR)$(BINDIR)/e2
e2.conf: e2.conf.in
$(TOPLEVEL)/scripts/genscript.sh $< $@
+e2generic.lc: strict.lua collection.lua loader.lua \
+ plugin.lua \
+ e2lib.lua e2option.lua hash.lua tools.lua \
+ transport.lua cache.lua url.lua scm.git.lua \
+ luafile.lua lua-version-map.lua \
+ error.lua lock.lua
+ $(BUILD_LUAC) -o $@ $^
+
+sha1.so: sha1.o lsha1.o
+
+luafile_ll.so: luafile_ll.o
+
+e2util.so: e2util.o
+
+%.so:
+ $(CC) -shared -o $@ $^ $(LDFLAGS)
+
+CLEAN_FILES += *.o
+%.o: %.c
+ $(CC) $(CFLAGS) $(BUILD_LUA_CPPFLAGS) -fPIC -c -o $@ $<
+
+CLEAN_FILES += e2-su-2.2
+e2-su-2.2: e2-su-2.2.c
+ $(CC) $(CFLAGS) $(E2_SU_CFLAGS) $(LDFLAGS) $< -o $@
+
]]
require("buildconfig")
-require("e2generic_global")
+require("e2generic")
e2lib.init()
]]
require("buildconfig")
-require("e2generic_global")
+require("e2generic")
e2lib.init()
local e = new_error("fetching project failed")
]]
require("buildconfig")
-require("e2generic_global")
+require("e2generic")
install_prefix = buildconfig.PREFIX
package.cpath = "@LIBDIR@/?.so"
require("buildconfig")
-require("e2generic_global")
+require("e2generic")
e2lib.init()
e2option.documentation = [[
include $(TOPLEVEL)/make.vars
+VPATH = .:$(TOPLEVEL)/generic
+
CLEAN_FILES = *~ *.so linux32 *.lc *.o
CFLAGS += -I. -I$(DESTDIR)$(INCDIR) -I$(DESTDIR)$(INCDIR)/lua-$(LUA_VERSION) \
-I../lua/lua-$(LUA_VERSION)/src -fPIC
.PHONY: all install uninstall install install-local doc install-doc
-all: linux32 e2local.lc $(LOCALLUATOOLS:=.lc)
+all: linux32 e2local.lc $(LOCALLUATOOLS:=.lc) sha1.so luafile_ll.so e2util.so
install:
# install symlinks for e2-2.1 compatibility
ln -sf e2 $(DESTDIR)$(BINDIR)/e2-$$i ; \
done
-install-local: all
+install-local: all install_sourcefiles
test -n "$(PROJECTDIR)"
mkdir -p $(LOCALBINDIR) $(LOCALMAKDIR) $(LOCALLIBDIR)
+ install -m 755 -d $(LOCALPLUGINDIR)
install -m644 e2local.lc $(LOCALLIBDIR)/
for i in $(LOCALLUATOOLS); do \
install -m 755 $$i.lc $(LOCALBINDIR)/e2-$$i; \
install -m644 linux32.c $(LOCALMAKDIR)/
ln -sf $(LIBEXECDIR)/e2-lua-$(LUA_VERSION) $(LOCALBINDIR)/e2-lua
$(MAKE) -C make install-local
+ install -m 755 sha1.so $(LOCALLIBDIR)
+ install -m 755 luafile_ll.so $(LOCALLIBDIR)
+ install -m 755 e2util.so $(LOCALLIBDIR)
+
+.PHONY: install_sourcefiles
+install_sourcefiles: e2-su-2.2.c
+ install -m 644 $^ $(LOCALMAKDIR)
doc:
for s in $(SUBDIRS) ; do \
$(LUAC) -o $@ $^
linux32: linux32.c
+
+sha1.so: sha1.o lsha1.o
+
+luafile_ll.so: luafile_ll.o
+
+e2util.so: e2util.o
+
+%.so:
+ $(CC) -shared -o $@ $^ $(LDFLAGS)