diff --git a/SConstruct b/SConstruct index e30f6df284eb488fa55e7edb4ed8bcbe666705d5..81bc849b15e11c8df5875d4cfdc39cb8d0757169 100644 --- a/SConstruct +++ b/SConstruct @@ -95,9 +95,15 @@ env["ENV"].update(x for x in os.environ.items() if x[0].startswith("CCC_")) #env.Append(CPPPATH=os.path.join('#', "hammer")) testruns = [] +targets = ["$libpath", + "$incpath", + "$parsersincpath", + "$backendsincpath", + "$pkgconfigpath"] Export('env') Export('testruns') +Export('targets') if not GetOption("in_place"): env['BUILD_BASE'] = 'build/$VARIANT' @@ -108,12 +114,6 @@ else: lib = env.SConscript(["src/SConscript"]) env.Alias(env.SConscript(["examples/SConscript"])) -#env.Command('test', '$BUILD_BASE/src/test_suite', 'env LD_LIBRARY_PATH=$BUILD_BASE/src $SOURCE') - env.Alias("test", testruns) -env.Alias("install", "$libpath") -env.Alias("install", "$incpath") -env.Alias("install", "$parsersincpath") -env.Alias("install", "$backendsincpath") -env.Alias("install", "$pkgconfigpath") +env.Alias("install", targets) diff --git a/src/bindings/python/SConscript b/src/bindings/python/SConscript index dcea2056a726211a91f0aec793b39b4e4bdf9bb2..d91a942300a17def47bf3188c3fe34f82ccdf8d2 100644 --- a/src/bindings/python/SConscript +++ b/src/bindings/python/SConscript @@ -1,22 +1,12 @@ # -*- python -*- import os, os.path -Import('env libhammer_shared testruns') +Import('env libhammer_shared testruns targets') pythonenv = env.Clone(IMPLICIT_COMMAND_DEPENDENCIES = 0) -#pythonenv.Append(CPPPATH = ['../../']) -#pythonenv.Append(CCFLAGS = ['-fpic', '-DSWIG', '-Wno-all', '-Wno-extra', '-Wno-error']) -#pythonenv.ParseConfig("pkg-config --cflags python") -#pythonenv.Append(LIBS = ['hammer']) -#pythonenv.Append(LIBPATH = ['../../']) -#pythonenv.Append(SWIGFLAGS = ['-DHAMMER_INTERNAL__NO_STDARG_H', '-Isrc/', '-python']) - - - swig = pythonenv.Command("hammer.i", "../swig/hammer.i", Copy("$TARGET", "$SOURCE")) setup = ['setup.py'] pydir = os.path.join(env['BUILD_BASE'], 'src/bindings/python') -#libhammer_python = pythonenv.SharedLibrary('hammer', swig, SHLIBPREFIX='_') libhammer_python = pythonenv.Command(['hammer.py', 'hammer_wrap.c'], [swig, setup], 'python ' + os.path.join(pydir, 'setup.py') + ' build_ext --inplace') Default(libhammer_python) @@ -28,4 +18,6 @@ pytest = Alias("testpython", [pytestexec], pytestexec) AlwaysBuild(pytest) testruns.append(pytest) - +pyinstallexec = pythonenv.Command(None, libhammer_python, 'python ' + os.path.join(pydir, 'setup.py ') + ' install') +pyinstall = Alias("installpython", [pyinstallexec], pyinstallexec) +targets.append(pyinstall)