Fix example build
[senf.git] / SConstruct
index b7484c1..5ab04af 100644 (file)
@@ -57,11 +57,11 @@ env.Append(
                               '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB', '$BOOSTFSLIB' ], 
    TEST_EXTRA_LIBS        = [  ],
 
-   PREFIX                 = '/usr/local',
-   LIBINSTALLDIR          = '$PREFIX',
-   BININSTALLDIR          = '$PREFIX',
-   INCLUDEINSTALLDIR      = '$PREFIX',
-   OBJINSTALLDIR          = '$LIBINSTALLDIR',
+   PREFIX                 = '#/dist',
+   LIBINSTALLDIR          = '$PREFIX${syslayout and "/lib" or ""}',
+   BININSTALLDIR          = '$PREFIX${syslayout and "/bin" or ""',
+   INCLUDEINSTALLDIR      = '$PREFIX${syslayout and "/include" or ""}',
+   OBJINSTALLDIR          = '$LIBINSTALLDIR${syslayout and "/$LIBINSTALLDIR/senf" or ""',
    DOCINSTALLDIR          = '$PREFIX/docs',
    CPP_INCLUDE_EXTENSIONS = [ '.h', '.hh', '.ih', '.mpp', '.cci', '.ct', '.cti' ],
    CPP_EXCLUDE_EXTENSIONS = [ '.test.hh' ],
@@ -96,9 +96,10 @@ env.Append(
 )
 
 env.SetDefault(
-    LIBSENF = "senf",
-    final   = 0,
-    debug   = 0,
+    LIBSENF   = "senf",
+    final     = 0,
+    debug     = 0,
+    syslayout = 0
 )
 
 # Set variables from command line
@@ -117,7 +118,9 @@ if not env.GetOption('clean') and not os.path.exists(".prepare-stamp") \
 
 # Load SConscripts
 
+SConscriptChdir(0)
 SConscript("debian/SConscript")
+SConscriptChdir(1)
 if os.path.exists('SConscript.local') : SConscript('SConscript.local')
 SConscript("senf/SConscript")
 SConscript("Examples/SConscript")
@@ -140,7 +143,7 @@ env.Install('$LIBINSTALLDIR', libsenf)
 env.Alias('install_all', env.FindInstalledFiles())
 env.Alias('default', DEFAULT_TARGETS)
 env.Alias('all_tests', env.FindAllBoostUnitTests())
-env.Alias('all', [ 'default', 'all_tests', 'all_docs' ])
+env.Alias('all', [ 'default', 'all_tests', 'examples', 'all_docs' ])
 
 #### prepare
 env.PhonyTarget('prepare', [], [])
@@ -168,7 +171,6 @@ if env.GetOption('clean'):
                        for path, subdirs, files in os.walk('.')
                        for pattern in env['CLEAN_PATTERNS']
                        for f in fnmatch.filter(files,pattern) ])
-    env.Clean('all', '.')
 
 if not env.GetOption('clean') and not os.path.exists(".prepare-stamp"):
     Execute(Touch(".prepare-stamp"))