Skip to main content

Purpose

To 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.

Installation

If you are already using python and are familiar with a python workflow, then you can simply pip install meak and 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!

Usage

All uses will assume that there is a file called maekfile within 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 different maekfile on the command line using the --file or -f options.

The /example directory contains a gcc-oriented example, but I have been successfully using this package to cross-compile an ARM Cortex-M3 package for months.

YML files

The 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 the examples directory.

Each file must contain a default configuration. 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:
    - -O1

Information and Help

The maek command generally expects to find a maekfile in the current directory. If not found, then the file may be specified using the -f or --file options 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 Project

Assuming that a configuration called release is available within the yml file, a suitable build command would be

$> maek release

Cleaning a Project

Need to clean up a project directory in order to do a re-build? Simply call up the configuration name with the --clean parameter.

$> maek release --clean

It is also possible to use the clean option shown in configuration options in order to execute a clean on every build.

Configuration Options

Every maekfile file must contain a default configuration. Each configuration is a level 1 within the YAML-based maekfile. Each configuration may contain the following options:

Configuration Options

clean

Boolean true or false. Will trigger a clean as part of every execution of this configuration. Default: false.

compile

Boolean. Will trigger a compile as part of every execution of this configuration. Default: true.

link

Boolean. Will trigger a link as part of every execution of this configuration. Default: true.

out

List of strings. Specifies the extension of the output. Default: out. Other desired extensions might be exe or elf.

default:
  out:
    - hex
    - bin

exports

List of strings. Will trigger a copy operation of the output file into different formats. Valid strings are hex and bin.

scripts

List of pre and post scripts, which are themselves lists of strings. These commands will be executed verbatim before and/or after the build operation. Defaults to null.

default:
  scripts:
    pre:
      - rm -rf /path/to/somefile
    post:
      - /path/to/custom/script --script_param

toolchain_path

String. Specifies the path to the directory containg the toolchain. Defaults to null.

compiler

String. Defaults to gcc.

linker

String. Defaults to gcc.

objcopy

String. Defaults to objcopy.

size

String. Defaults to size.

flags

A list of strings, each containing flags that will be forwarded to, both, the compiler and the linker.

default:
  flags:
    - -O1
    - -fdata-sections
    - -ffunction-sections

cflags

A list of strings, each containing flags that will be forwarded to the compiler only. Very similar to flags above.

lflags

A list of strings, each containing flags that will be forwarded to the linker only. Very similar to flags above.

sources

A 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.c

includes

A list of strings, similar in format to sources, each element of which is an include file that will be passed to, both, the compiler and linker.

lscripts

A list of strings, similar in format to sources, each element of which will be passed as a linker script into the linker.

Special Strings

Some special strings will be automatically replaced wherever encountered in the maekfile.

{{ 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

Metadata

Release files for maek 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for maek 0.1.3
File Interpreter ABI Platform
maek-0.1.3-py3-none-any.whl Python 3 none any Details

Release files / maek-0.1.3-py3-none-any.whl

Download URL maek-0.1.3-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbc0e304e2d36a0128ac0124ab77ab7d4b8aac786049bb07388d2a1ef1cd4b52
BLAKE2b-256 checksum
How to use checksums
69ae9b94e880ab90cb3a4a0a37a4c5bc59afc84df9a0759f72ebf08374faa176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.3 This release

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.19

1 release file

0.0.18

1 release file

0.0.17

2 release files

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.12

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page