Skip to content

Commit

Permalink
build: temporary files now stored in separate folder
Browse files Browse the repository at this point in the history
This changes the location of temporary files (objects, executables,
library, etc) from within the source tree (potentially named after the
corresponding config if not default), to a dedicated folder per config.
The config file for each config now also resides in that folder, so that
the folder name is the config name. Unless a named config is requested
in ./configure, by default this folder will be called 'default'.  This
now means that executables will now reside in default/bin/ rather than
bin/.

The reason for these changes is simplify management of co-existing
configs - each one now resides in its own folder, making it trivial to
clean it out if needed. It also makes it easier to request building of
specific target, since the config can now easily be parsed from the
folder location, e.g.:

    $ ./build debug/bin/mrconvert
  • Loading branch information
jdtournier committed Jul 6, 2015
1 parent 3ef33e6 commit f3589e1
Show file tree
Hide file tree
Showing 57 changed files with 145 additions and 104 deletions.
224 changes: 128 additions & 96 deletions build

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 17 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,21 @@ In most cases, a simple invocation should work:
$ ./configure
If a name is provided, the configuration will be written to a different file,
which can then be used by the build script. For example:
By default, this creates a target folder named 'main', and a 'config' file
within that folder. If a name is provided, the configuration will be written to
a different folder, which can then be used by the build script. For example:
$ ./configure testing -debug
will generate the file 'config.testing', which can be used with the build
script as follows:
will generate the folder 'testing' and a config file with debugging symbols
enabled, which can be used with the build script as follows:
$ ./build testing
Note that all intermediate files will be named according to the name of the
configuration to avoid conflict with any other configuration.
By default, the build script will compile the 'main' folder.
All intermediate files will be placed within the target folder to avoid
conflict with any other configurations.
OPTIONS:
Expand Down Expand Up @@ -144,6 +147,13 @@ if not profile_name:
profile_name = 'default'


try:
os.makedirs (profile_name)
except OSError:
if not os.path.isdir (profile_name):
raise


global logfile, config_report
logfile = open (os.path.join (os.path.dirname(sys.argv[0]), 'configure.log'), 'wb')
config_report = ''
Expand Down Expand Up @@ -1114,8 +1124,7 @@ if sh_basis_def is not None:


# write out configuration:

cache_filename = os.path.join (os.path.dirname(sys.argv[0]), 'config.' + profile_name)
cache_filename = os.path.join (os.path.dirname(sys.argv[0]), profile_name, 'config')

sys.stdout.write ('\nwriting configuration to file \'' + cache_filename + '\': ')

Expand Down

0 comments on commit f3589e1

Please sign in to comment.