Package: maek
PurposeTo replace makefiles with something easier to use and with faster compile times.  In today's PC market, we have routine access to machines with multiple threads.  This package will check the number of threads that your machine will support and will create that many threads for the compile stage.This package is opinionated and slanted towards C/C++ workflow using gcc-like commands.InstallationIf you are already using python and are familiar with a python workflow, then you can simplypip install meakand maek will be added to your python installation.If you would rather just try it out, then you can download a windows binary from the releases directory and execute it directly.  The package is portable and may be executed on the command line.  Should work as well as the python package!UsageAll uses will assume that there is a file calledmaekfilewithin the directory being executed.  This file consists of a YML dictionary containing a default configuration along with other potential configurations which are variantes on the default.  You may specify a differentmaekfileon the command line using the--fileor-foptions.The/exampledirectory contains a gcc-oriented example, but I have been successfully using this package to cross-compile an ARM Cortex-M3 package for months.YML filesThe YML file is best presented as an example.  Below is an example that will compile an generic 'hello-world' type of application that may be found in theexamplesdirectory.Each file must contain adefaultconfiguration.  All other configurations will inherit from the default configuration.default:
  clean: false
  compile: true
  link: true

  sources:
    - gcc/src/main.c
    - gcc/src/example.c

  includes:
    - gcc/inc

debug:
  out: exe
  flags:
    - -O0
    - -g

release:
  clean: true
  flags:
    - -O1Information and HelpThemaekcommand generally expects to find amaekfilein the current directory.  If not found, then the file may be specified using the-for--fileoptions on the command line.$> maek --version
maek, version 0.1.2
$> maek --help
Usage: maek.exe [OPTIONS] [CONFIGURATION]

Options:
  --version           Show the version and exit.
  -c, --clean
  -f, --file TEXT     specifies the maekfile
  -v, --verbose       turn on verbose mode
  -q, --quiet         quiet output, only displays warnings and errors
  -l, --list_configs  shows the available configurations
  --help              Show this message and exit.Building a ProjectAssuming that a configuration calledreleaseis available within the yml file, a suitable build command would be$> maek releaseCleaning a ProjectNeed to clean up a project directory in order to do a re-build?  Simply call up the configuration name with the--cleanparameter.$> maek release --cleanIt is also possible to use thecleanoption shown inconfiguration optionsin order to execute a clean on every build.Configuration OptionsEverymaekfilefile must contain adefaultconfiguration.  Each configuration is a level 1 within the YAML-basedmaekfile.  Each configuration may contain the following options:Configuration OptionscleanBooleantrueorfalse.  Will trigger a clean as part of every execution of this configuration.  Default:false.compileBoolean.  Will trigger a compile as part of every execution of this configuration.  Default:true.linkBoolean.  Will trigger a link as part of every execution of this configuration.  Default:true.outList of strings.  Specifies the extension of the output.  Default:out.  Other desired extensions might beexeorelf.default:
  out:
    - hex
    - binexportsList of strings.  Will trigger a copy operation of the output file into different formats.  Valid strings arehexandbin.scriptsList ofpreandpostscripts, which are themselves lists of strings.  These commands will be executed verbatim before and/or after the build operation.  Defaults tonull.default:
  scripts:
    pre:
      - rm -rf /path/to/somefile
    post:
      - /path/to/custom/script --script_paramtoolchain_pathString.  Specifies the path to the directory containg the toolchain.  Defaults tonull.compilerString.  Defaults togcc.linkerString.  Defaults togcc.objcopyString.  Defaults toobjcopy.sizeString.  Defaults tosize.flagsA list of strings, each containing flags that will be forwarded to, both, thecompilerand thelinker.default:
  flags:
    - -O1
    - -fdata-sections
    - -ffunction-sectionscflagsA list of strings, each containing flags that will be forwarded to the compiler only.  Very similar toflagsabove.lflagsA list of strings, each containing flags that will be forwarded to the linker only.  Very similar toflagsabove.sourcesA list of strings, each of which is a source.  This is usually a list of your c files.default:
  sources:
    - src/main.c
    - src/included_source.cincludesA list of strings, similar in format tosources, each element of which is an include file that will be passed to, both, the compiler and linker.lscriptsA list of strings, similar in format tosources, each element of which will be passed as a linker script into the linker.Special StringsSome special strings will be automatically replaced wherever encountered in themaekfile.{{ BUILD_PATH }}will be replaced by the configuration name.  This is useful in some places, particularly in pre and post-build scripts which apply to multiple configurations or for options that require a path (such as generating a map file below).default:
  lflags:
    - -Xlinker -Map={{ BUILD_PATH }}/map