- Reorganize makefile to install files in a reorganized directory

hierarchy: 
	- make room for future plugins
	- separate real plugins from their satellite helper
	data


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@484 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-03-03 21:04:42 +00:00
parent 0a6b34d6ab
commit 17678ebbe4
3 changed files with 25 additions and 31 deletions

View File

@ -27,32 +27,21 @@ SUBDIRS = po
# directories definition
sharedir = $(pkgdatadir)
pycdir = $(sharedir)/policies
moddir = $(sharedir)/modules
policiesdir = $(sharedir)/policies
plugindir = $(sharedir)/plugins
moduledir = $(plugindir)/extras
localedir = @datadir@/locale
testsdir = $(pkgdatadir)/tests
#define empty global variables
bin_PROGRAMS =
mod_LTLIBRARIES =
mod_PYTHON =
plugin_LTLIBRARIES =
noinst_HEADERS =
pkglib_LTLIBRARIES =
EXTRA_DIST =
MAINTAINERCLEANFILES =
MOSTLYCLEANFILES =
# ############################################################
#
# additional rules
#
# ############################################################
# swig implementation wrapper files generation for Python:
%_wrap.cc : %.i
test -d "$(@D)" || mkdir -p -- "$(@D)"
$(SWIG) $(SWIG_PYTHON_OPT) -o $@ $<
# ############################################################
#
# extra dist, cleanup and automake/aclocal flags
@ -127,8 +116,9 @@ pkglib_LTLIBRARIES += src/backend/libbackend.la
src_backend_libbackend_la_CPPFLAGS = \
-I@top_srcdir@ \
-DPYCDIR="\"$(pycdir)\"" \
-DMODDIR="\"$(moddir)\"" \
-DPOLDIR="\"$(policiesdir)\"" \
-DPLUGDIR="\"$(plugindir)\"" \
-DMODDIR="\"$(moduledir)\"" \
-DLOCALEDIR="\"$(localedir)\"" \
$(PYTHON_CPPFLAGS) \
$(GLIBMM_CFLAGS)
@ -184,8 +174,8 @@ bin_PROGRAMS += sgpemv2
sgpemv2_CPPFLAGS = \
-I@top_srcdir@ \
-DPYCDIR="\"$(pycdir)\"" \
-DMODDIR="\"$(moddir)\"" \
-DPLUGDIR="\"$(plugindir)\"" \
-DMODDIR="\"$(moduledir)\"" \
-DLOCALEDIR="\"$(localedir)\"" \
$(CAIRO_CFLAGS) \
$(GTKMM_CFLAGS) \
@ -230,12 +220,14 @@ noinst_HEADERS += \
#
# ############################################################
mod_LTLIBRARIES += src/backend/pyloader/libpyloader.la
pyloaderdir = $(moduledir)/pyloader
plugin_LTLIBRARIES += src/backend/pyloader/libpyloader.la
src_backend_pyloader_libpyloader_la_CPPFLAGS = \
-I@top_srcdir@ \
-DPYCDIR="\"$(pycdir)\"" \
-DMODDIR="\"$(moddir)\"" \
-DPOLDIR="\"$(policiesdir)\"" \
-DMODDIR="\"$(pyloaderdir)\"" \
-DLOCALEDIR="\"$(localedir)\"" \
$(PYTHON_CPPFLAGS) \
$(GLIBMM_CFLAGS)
@ -262,7 +254,7 @@ noinst_HEADERS += \
src/backend/pyloader/python_policy.hh \
src/backend/pyloader/python_policy_manager.hh
mod_PYTHON += \
pyloader_PYTHON = \
src/backend/pyloader/Abstract.py \
src/backend/pyloader/Policy.py \
src/backend/pyloader/ScriptAdapter.py
@ -276,11 +268,13 @@ mod_PYTHON += \
proxies = src/backend/pyloader/sgpem.py
wrappers = src/backend/pyloader/sgpem_wrap.cc
mod_LTLIBRARIES += _sgpem.la
mod_PYTHON += $(proxies)
pyloader_LTLIBRARIES = _sgpem.la
pyloader_PYTHON += $(proxies)
# static pattern rule
$(proxies): %.py : %.i
$(proxies) $(wrappers) : src/backend/pyloader/sgpem.i
test -d "$(@D)" || mkdir -p -- "$(@D)"
$(SWIG) $(SWIG_PYTHON_OPT) -o $@ $<
_sgpem_la_INTERFACES = src/backend/pyloader/sgpem.i
@ -318,7 +312,7 @@ noinst_HEADERS += \
# ############################################################
# built-in policies
pyc_PYTHON = \
policies_PYTHON = \
src/builtin-policies/fcfs.py \
src/builtin-policies/sjf.py
@ -334,8 +328,8 @@ tests_PROGRAMS = src/testsuite/test-python_loader
src_testsuite_test_python_loader_CPPFLAGS = \
-I@top_srcdir@/src \
-DPYCDIR="\"$(pycdir)\"" \
-DMODDIR="\"$(moddir)\"" \
-DPOLDIR="\"$(policiesdir)\"" \
-DMODDIR="\"$(pyloaderdir)\"" \
$(PYTHON_CPPFLAGS) \
$(GLIBMM_CFLAGS) \
$(GTHREAD_CFLAGS)

View File

@ -71,7 +71,7 @@ PythonPolicyManager::init()
// FIXME: find better way to achieve this.
PyRun_SimpleString("import sys\n"
"sys.path[:0] = [ '" MODDIR "', '" PYCDIR "' ]\n");
"sys.path[:0] = [ '" MODDIR "', '" POLDIR "' ]\n");
// Okay, here we go.
// Black magic at work.

View File

@ -64,7 +64,7 @@ main(int argc, char* argv[])
// appropriate PluginManager class in the backend,
// and the Makefile fixed accordingly
using Glib::Module;
std::string pyloader_path = Module::build_path(MODDIR, "pyloader");
std::string pyloader_path = Module::build_path(PLUGDIR, "pyloader");
Module pyloader(pyloader_path);
std::cerr << Module::get_last_error() << std::endl;
assert(pyloader);