godfryd
godfryd

Reputation: 559

tool for building software

I need something like make i.e. dependencies + executing shell commands where failing command stops make execution. But more deeply integrated with shell i.e. now in make each line is executed in separate context so it is not easy to set variable in one line and use it in following line (I do not want escape char at end of line because it is not readable). I want simple syntax (no XML) with control flow and functions (what is missing in make). It does not have to have support for compilation. I have to just bind together several components built using autotools, package them, trigger test and publish results.

I looked at: make, ant, maven, scons, waf, nant, rake, cons, cmake, jam and they do not fit my needs.

Upvotes: 2

Views: 397

Answers (6)

Shawn Chin
Shawn Chin

Reputation: 86974

Have a look at fabricate.

If that does not fulfill your needs or if you would rather not write your build script in Python, you could also use a combination of shell scripting and fabricate. Write the script as you would to build your project manually, but prepend build calls with "fabricate.py" so build dependencies are managed automatically.

Simple example:

#!/bin/bash
EXE="myapp"
CC="fabricate.py gcc" # let fabricate handle dependencies
FILES="file1.c file2.c file3.c"
OBJS=""

# build link
for F in $FILES; do
    echo $CC -c $F
    if [ $? -ne 0 ]; then
        echo "Build failed while compiling $F" >2
        exit $?
    fi
    OBJS="$OBJS ${F/.c/.o}"
done

# link
$CC -o $EXE $OBJS

Upvotes: 2

High Performance Mark
High Performance Mark

Reputation: 78364

You might want to look at SCons; it's a Make-replacement written in Python.

Upvotes: 0

schettino72
schettino72

Reputation: 3170

take a look at doit

  • you can use shell commands or python functions to define tasks (builds).
  • very easy to use. write scripts in python. "no api" (you dont need to import anything in your script)
  • it has good support to track dependencies and targets

Upvotes: 3

neuro
neuro

Reputation: 15210

I have had the same needs. My current solution is to use makefiles to accurately represent the graph dependency (you have to read "Recursive make considered harmful"). Those makefiles trigger bash scripts that take makefiles variables as parameters. This way you have not to deal with the problem of shell context and you get a clear separation between the dependencies and the actions.

I'm currently considering waf as it seems well designed and fast enough.

Upvotes: 0

Emmanuel Caradec
Emmanuel Caradec

Reputation: 2287

A mix of makefile and a scripting language to choose which makefile to run at a time could do it.

Upvotes: 0

Brian Agnew
Brian Agnew

Reputation: 272417

Given that you want control flow, functions, everything operating in the same environment and no XML, it sounds like you want to use the available shell script languages (sh/bash/ksh/zsh), or Perl (insert your own favourite scripting language here!).

I note you've not looked at a-a-p. I'm not familiar with this, other than it's a make system from the people who brought us vim. So you may want to look over that.

Upvotes: 1

Related Questions