diff options
author | Fred Wright <fw@fwright.net> | 2016-03-06 20:33:35 -0800 |
---|---|---|
committer | Jon Schlueter <jon.schlueter@gmail.com> | 2016-03-07 06:25:25 -0500 |
commit | f66a6a5d7ce94471b85d320f7c678c30375f6768 (patch) | |
tree | 346c55426b85ca25de5ef8df932bcbe0b77591b6 /SConstruct | |
parent | 4eaab70905b9bd4a5df474f591f27ffdfcd26c43 (diff) | |
download | gpsd-f66a6a5d7ce94471b85d320f7c678c30375f6768.tar.gz |
Reworks "clean" to be more "sconsy".
This causes much of the cleaning to be handled automatically by making
the default target more comprehensive in clean mode. It adds a dummy
'clean-misc' target just for cleaning, where all the files needing
cleaning that aren't automatically tracked by scons are attached.
TESTED:
Built 'build-all' and 'check', with and without coveraging, followed
by a default '-c', and verified that no unexpected files were left
around. Also tried the individual clean targets as a sanity check.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 41 |
1 files changed, 19 insertions, 22 deletions
@@ -1355,6 +1355,7 @@ if env['xgps']: "xgpsspeed.1": "gps.xml", "xgps.1": "gps.xml", }) +all_manpages = base_manpages.keys() + python_manpages.keys() manpage_targets = [] if manbuilder: @@ -1367,7 +1368,6 @@ build = env.Alias('build', [libraries, binaries, python_targets, "gpsd.php", manpage_targets, "libgps.pc", "gpsd.rules"]) -env.Default(*build) if qt_env: build_qt = qt_env.Alias('build', [compiled_qgpsmmlib]) @@ -1783,7 +1783,7 @@ env.Alias('test-noclean', test_noclean) check = env.Alias('check', test_noclean) env.Alias('testregress', check) env.Alias('build-tests', testprogs) -env.Alias('build-all', build + testprogs) +build_all = env.Alias('build-all', build + testprogs) # Remove all shared-memory segments. Normally only needs to be run # when a segment size changes. @@ -1969,30 +1969,27 @@ Utility('udev-test', '', [ # Cleanup -# Ordinary cleanup -clean = env.Clean( - build, - ( - map( - glob.glob, - ( - "*.[oa]", "*.[1358]", "*.os", "*.os.*", - "*.gcno", "*.pyc", "gps/*.pyc", "TAGS", - "config.log", "lib*.so*", "lib*.a", - "gps-*egg-info", "contrib/ppscheck", "*.gcda" - ) - ) + - testprogs + - generated_sources + - base_manpages.keys() + - webpages + - map(lambda f: f[:-3], templated) - ) -) +# Dummy target for cleaning misc files +clean_misc = env.Alias('clean-misc') +# Since manpage targets are disabled in clean mode, we cover them here +env.Clean(clean_misc, all_manpages) +# Clean compiled Python +env.Clean(clean_misc, glob.glob('*.pyc') + glob.glob('gps/*.pyc')) +# Clean coverage and profiling files +env.Clean(clean_misc, glob.glob('*.gcno') + glob.glob('*.gcda')) +# Other misc items +env.Clean(clean_misc, ['config.log', 'contrib/ppscheck', 'TAGS']) # Nuke scons state files sconsclean = Utility("sconsclean", '', ["rm -fr .sconf_temp .scons-option-cache config.log"]) +# Default targets + +if env.GetOption('clean'): + env.Default(build_all, audit, clean_misc) +else: + env.Default(build) + # Tags for Emacs and vi misc_sources = ['cgps.c', 'gpsctl.c', 'gpsdctl.c', 'gpspipe.c', 'gps2udp.c', 'gpsdecode.c', 'gpxlogger.c', 'ntpshmmon.c'] |