1# 2# This file is part of Bakefile (http://www.bakefile.org) 3# 4# Copyright (C) 2003-2007 Vaclav Slavik 5# 6# Permission is hereby granted, free of charge, to any person obtaining a copy 7# of this software and associated documentation files (the "Software"), to 8# deal in the Software without restriction, including without limitation the 9# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10# sell copies of the Software, and to permit persons to whom the Software is 11# furnished to do so, subject to the following conditions: 12# 13# The above copyright notice and this permission notice shall be included in 14# all copies or substantial portions of the Software. 15# 16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22# IN THE SOFTWARE. 23# 24# $Id: config.py 1086 2007-10-24 08:30:02Z vaclavslavik $ 25# 26# Configuration holder 27# 28 29import os, os.path, sys 30 31# Be verbose: 32verbose = 0 33quiet = 0 34debug = 0 35 36# Directories where makefiles are looked for: 37# 1. BAKEFILE_PATHS environment variable 38# 2. if the executable is in $(foo)/lib/bakefile, then in 39# $(foo)/share/bakefile/{rules,output} if it exists, otherwise in 40# ../{rules,output} relative to executable location 41# 42searchPath = os.getenv('BAKEFILE_PATHS', '').split(os.pathsep) 43if searchPath == ['']: searchPath = [] 44 45progdir = os.path.dirname(os.path.realpath(sys.argv[0])) 46datadir = os.path.join(progdir, '..', '..', 'share', 'bakefile') 47if not os.path.isfile(os.path.join(datadir, 'rules', 'FORMATS.bkmanifest')): 48 datadir = os.path.join(progdir, '..') 49searchPath.append(os.path.normpath(os.path.join(datadir, 'rules'))) 50searchPath.append(os.path.normpath(os.path.join(datadir, 'rules', 'modules'))) 51searchPath.append(os.path.normpath(os.path.join(datadir, 'output'))) 52searchPath.append(os.path.normpath(datadir)) 53 54 55# The way target makefiles quote variables: 56variableSyntax = '$(%s)' # FIXME 57 58# Output format: 59format = None 60 61# List of parsed output directives ((file,writer) tuples): 62to_output = [] 63 64# Track dependencies (generated and used files)?: 65track_deps = 0 66 67# File to store dependencies into: 68deps_file = None 69 70# File to store list of modified output files: 71changes_file = None 72 73# If set to True, no output is written, bakefile just pretends to do it 74dry_run = False 75 76# If set to True, output files are always touched (written), even if their 77# content didn't change 78always_touch_output = False 79 80# Wrap output lines at given width. If "None", no wrapping is done 81wrap_lines_at = 75 82