All Projects → vedavamadathil → smake

vedavamadathil / smake

Licence: MIT License
A simple and convenient build-and-run system for C and C++.

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to smake

bramble
Purely functional build system and package manager
Stars: ✭ 173 (+861.11%)
Mutual labels:  build-system
cpp-compiler-options
Compilation options for different versions of Clang, GCC and MSVC. Provided a generator and different file formats (cmake, xmake, meson, premake5, bjam/b2, ...)
Stars: ✭ 19 (+5.56%)
Mutual labels:  build-system
alfred
(v0.2) Even Batman needs a little help. Task runner. Automator. Build system.
Stars: ✭ 62 (+244.44%)
Mutual labels:  build-system
assemble-core
The core assemble application with no presets or defaults. All configuration is left to the implementor.
Stars: ✭ 17 (-5.56%)
Mutual labels:  build-system
rote
Automate everything.
Stars: ✭ 66 (+266.67%)
Mutual labels:  build-system
cmany
Easily batch-build cmake projects!
Stars: ✭ 15 (-16.67%)
Mutual labels:  build-system
sw
Software Manager. Build System, Build System Generator and Package Manager. C/C++ and other languages. Tools and libraries for Software Management.
Stars: ✭ 93 (+416.67%)
Mutual labels:  build-system
jagen
A software engineer's workspace manager and build systems wrapper
Stars: ✭ 32 (+77.78%)
Mutual labels:  build-system
ixm
Make CMake less painful when trying to write Modern Flexible CMake
Stars: ✭ 99 (+450%)
Mutual labels:  build-system
automeka
Implicit and module-aware build system for future C++
Stars: ✭ 20 (+11.11%)
Mutual labels:  build-system
tweego-setup
A blank Tweego project with all the trimmings. Uses node and gulp.
Stars: ✭ 40 (+122.22%)
Mutual labels:  build-system
brujeria
Black Magic to hook into setuptools and distutils for Extensions
Stars: ✭ 17 (-5.56%)
Mutual labels:  build-system
blight
A framework for instrumenting build tools
Stars: ✭ 57 (+216.67%)
Mutual labels:  build-system
cppan
Project evolved into Software Network: https://github.com/SoftwareNetwork/sw
Stars: ✭ 108 (+500%)
Mutual labels:  build-system
l3build
A testing and building system for LaTeX
Stars: ✭ 63 (+250%)
Mutual labels:  build-system
make
The Ultimate Makefile to compile all your C, C++, Assembly and Fortran projects
Stars: ✭ 41 (+127.78%)
Mutual labels:  build-system
gn
Standalone version of Chromium's GN
Stars: ✭ 81 (+350%)
Mutual labels:  build-system
themekit
Build system of design-tokens for any platforms
Stars: ✭ 60 (+233.33%)
Mutual labels:  build-system
create-bazel-workspace
Generate a new polyglot Bazel workspace with minimal configuration
Stars: ✭ 16 (-11.11%)
Mutual labels:  build-system
kconfig
Kconfig for ARM based MCUs
Stars: ✭ 15 (-16.67%)
Mutual labels:  build-system

smake

Smake is a simple and convenient build-and-run system for C and C++ projects.

Why make another build system?

CMake and GNU Make are great build systems. However, as the project gets larger, and as there are increasingly many types of builds (e.g. a builds for debugging), it becomes tedious to add duplicate code.

Smake solves this problem with its target-mode-build hierarchy. In this system, every project has a set of targets, and each target has a set of build modes. When smake is run on a target with a specific build mode, it will run the build corresponding to that mode.

pictures/smake.png

Each mode also has a post-build script that can be run. For most builds, this will simply be executing the target object file, but in some cases, the user may want to run a different command (i.e. gdb or valgrind) with the object file.

Install

Smake can be installed easily with pip install smake.

One can also simply clone the source and link the smake executable.

How does it work?

Smake searches for a smake.yaml file in the current directory and creates configurations for each target, including all modes and their corresponding builds and post-build scripts, etc.

The structure of an smake configuration file is as follows (in no strict order):

# Variables that can be referenced in builds
definitions:
  - gsourceA: fileA.c, fileB.c

# List of builds that will be used by the targets
builds:
  - buildA:
    - sources: gsourceA     # Reference a group of sources defined
                            # in the sources section
  - buildB:
    - sources: main.c       # Sources can be specified in the build as well
    - flags: -Wall, -Wextra # Flags are specified here, can be comma
                            # separated or specified as a list  
  - buildC:
    - sources: main.c
    - flags:  -Wall, -Wextra, -g

# List of all targets
targets:
 - targetA:
  - modes: default          # Specifiy modes here (default mode does
                            # not really need to be specified)
  - builds:
    - default: buildA       # Must specify builds as a pair of `mode: build`
  
  # Note that post-build scripts do not need to be specified:
  #   if nothing is specified, then there is no post-build script
  - targetB:
    - modes: default, debug # Comma separated modes
    - builds:               # Modes are selected using the -m option of smake
      - default: buildB     #   for example: smake targetB -m debug
      - debug: buildC       # the default mode is used if no mode is specified
    - postbuild:            # Post-build scripts, specified per mode (optional)
      - debug: 'gdb {}'     # The {} is replaced by the target object file

This configuration allows for the following commands:

$ smake targetA
$ smake targetB
$ smake targetB -m debug

As one can imagine, this build system is quite simple, yet powerful.

Another example of smake file can be found inside the example directory. Clone this repository and run smake to get started (available targets are smake basic and smake multisource).

Future features

  • Pre-build scripts, for cases where source code needs to be auto-generated
  • Add options for parallelizing builds
  • Easier way to define macro arguments for the compilers
  • Detect changes in included headers, and the config in general
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].