Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 421250e in mainline


Ignore:
Timestamp:
2010-12-05T10:57:15Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
6ec0acd, f5211ee
Parents:
ba8de9c3
Message:

Make batch configuration really easy.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    rba8de9c3 r421250e  
    4141CONFIG_HEADER = config.h
    4242
    43 .PHONY: all precheck cscope autotool config_default config distclean clean
     43ifeq ($(PROFILE),)
     44        PRESETS_FILE =
     45else
     46        PRESETS_FILE = defaults/$(PROFILE)/Makefile.config
     47endif
     48
     49.PHONY: all precheck cscope autotool config_auto config_default config distclean clean
    4450
    4551all: $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER)
     
    6672
    6773config_default: $(CONFIG_RULES)
    68         $(CONFIG) $< default
     74        $(CONFIG) $< default $(PRESETS_FILE)
    6975
    7076config: $(CONFIG_RULES)
  • tools/config.py

    rba8de9c3 r421250e  
    454454
    455455def main():
     456        cfgfile_in = None
    456457        config = {}
    457458        rules = []
     
    460461        parse_rules(RULES_FILE, rules)
    461462       
    462         # Read configuration from previous run
    463         if os.path.exists(MAKEFILE):
    464                 read_config(MAKEFILE, config)
     463        # Input configuration file can be specified on command line
     464        # otherwise configuration from previous run is used.
     465        if len(sys.argv) >= 4:
     466                cfgfile_in = sys.argv[3]
     467        else:
     468                cfgfile_in = MAKEFILE
     469       
     470        # Read configuration file
     471        if os.path.exists(cfgfile_in):
     472                read_config(cfgfile_in, config)
    465473       
    466474        # Default mode: only check values and regenerate configuration files
Note: See TracChangeset for help on using the changeset viewer.