- 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 # directories definition
sharedir = $(pkgdatadir) sharedir = $(pkgdatadir)
pycdir = $(sharedir)/policies policiesdir = $(sharedir)/policies
moddir = $(sharedir)/modules plugindir = $(sharedir)/plugins
moduledir = $(plugindir)/extras
localedir = @datadir@/locale localedir = @datadir@/locale
testsdir = $(pkgdatadir)/tests testsdir = $(pkgdatadir)/tests
#define empty global variables #define empty global variables
bin_PROGRAMS = bin_PROGRAMS =
mod_LTLIBRARIES = plugin_LTLIBRARIES =
mod_PYTHON =
noinst_HEADERS = noinst_HEADERS =
pkglib_LTLIBRARIES = pkglib_LTLIBRARIES =
EXTRA_DIST = EXTRA_DIST =
MAINTAINERCLEANFILES = MAINTAINERCLEANFILES =
MOSTLYCLEANFILES = 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 # extra dist, cleanup and automake/aclocal flags
@ -127,8 +116,9 @@ pkglib_LTLIBRARIES += src/backend/libbackend.la
src_backend_libbackend_la_CPPFLAGS = \ src_backend_libbackend_la_CPPFLAGS = \
-I@top_srcdir@ \ -I@top_srcdir@ \
-DPYCDIR="\"$(pycdir)\"" \ -DPOLDIR="\"$(policiesdir)\"" \
-DMODDIR="\"$(moddir)\"" \ -DPLUGDIR="\"$(plugindir)\"" \
-DMODDIR="\"$(moduledir)\"" \
-DLOCALEDIR="\"$(localedir)\"" \ -DLOCALEDIR="\"$(localedir)\"" \
$(PYTHON_CPPFLAGS) \ $(PYTHON_CPPFLAGS) \
$(GLIBMM_CFLAGS) $(GLIBMM_CFLAGS)
@ -184,8 +174,8 @@ bin_PROGRAMS += sgpemv2
sgpemv2_CPPFLAGS = \ sgpemv2_CPPFLAGS = \
-I@top_srcdir@ \ -I@top_srcdir@ \
-DPYCDIR="\"$(pycdir)\"" \ -DPLUGDIR="\"$(plugindir)\"" \
-DMODDIR="\"$(moddir)\"" \ -DMODDIR="\"$(moduledir)\"" \
-DLOCALEDIR="\"$(localedir)\"" \ -DLOCALEDIR="\"$(localedir)\"" \
$(CAIRO_CFLAGS) \ $(CAIRO_CFLAGS) \
$(GTKMM_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 = \ src_backend_pyloader_libpyloader_la_CPPFLAGS = \
-I@top_srcdir@ \ -I@top_srcdir@ \
-DPYCDIR="\"$(pycdir)\"" \ -DPOLDIR="\"$(policiesdir)\"" \
-DMODDIR="\"$(moddir)\"" \ -DMODDIR="\"$(pyloaderdir)\"" \
-DLOCALEDIR="\"$(localedir)\"" \ -DLOCALEDIR="\"$(localedir)\"" \
$(PYTHON_CPPFLAGS) \ $(PYTHON_CPPFLAGS) \
$(GLIBMM_CFLAGS) $(GLIBMM_CFLAGS)
@ -262,7 +254,7 @@ noinst_HEADERS += \
src/backend/pyloader/python_policy.hh \ src/backend/pyloader/python_policy.hh \
src/backend/pyloader/python_policy_manager.hh src/backend/pyloader/python_policy_manager.hh
mod_PYTHON += \ pyloader_PYTHON = \
src/backend/pyloader/Abstract.py \ src/backend/pyloader/Abstract.py \
src/backend/pyloader/Policy.py \ src/backend/pyloader/Policy.py \
src/backend/pyloader/ScriptAdapter.py src/backend/pyloader/ScriptAdapter.py
@ -276,11 +268,13 @@ mod_PYTHON += \
proxies = src/backend/pyloader/sgpem.py proxies = src/backend/pyloader/sgpem.py
wrappers = src/backend/pyloader/sgpem_wrap.cc wrappers = src/backend/pyloader/sgpem_wrap.cc
mod_LTLIBRARIES += _sgpem.la pyloader_LTLIBRARIES = _sgpem.la
mod_PYTHON += $(proxies) pyloader_PYTHON += $(proxies)
# static pattern rule # 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 _sgpem_la_INTERFACES = src/backend/pyloader/sgpem.i
@ -318,7 +312,7 @@ noinst_HEADERS += \
# ############################################################ # ############################################################
# built-in policies # built-in policies
pyc_PYTHON = \ policies_PYTHON = \
src/builtin-policies/fcfs.py \ src/builtin-policies/fcfs.py \
src/builtin-policies/sjf.py src/builtin-policies/sjf.py
@ -334,8 +328,8 @@ tests_PROGRAMS = src/testsuite/test-python_loader
src_testsuite_test_python_loader_CPPFLAGS = \ src_testsuite_test_python_loader_CPPFLAGS = \
-I@top_srcdir@/src \ -I@top_srcdir@/src \
-DPYCDIR="\"$(pycdir)\"" \ -DPOLDIR="\"$(policiesdir)\"" \
-DMODDIR="\"$(moddir)\"" \ -DMODDIR="\"$(pyloaderdir)\"" \
$(PYTHON_CPPFLAGS) \ $(PYTHON_CPPFLAGS) \
$(GLIBMM_CFLAGS) \ $(GLIBMM_CFLAGS) \
$(GTHREAD_CFLAGS) $(GTHREAD_CFLAGS)

View File

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

View File

@ -64,7 +64,7 @@ main(int argc, char* argv[])
// appropriate PluginManager class in the backend, // appropriate PluginManager class in the backend,
// and the Makefile fixed accordingly // and the Makefile fixed accordingly
using Glib::Module; 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); Module pyloader(pyloader_path);
std::cerr << Module::get_last_error() << std::endl; std::cerr << Module::get_last_error() << std::endl;
assert(pyloader); assert(pyloader);