Is there a bamboo builder task for make?
Asked by Philip Rittenhouse:

This seems like such a simple and basic feature but I don't see any documention to support builds using makefiles. Have I missed it?

I have tried using the Script task - is that the recommended way of doing it? One problem is that I don't see the script output in the bamboo logs, so if I have a bug in my script it seems I have to debug it blind. Here's an example of a failing case:

|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 14-May-2014 15:18:40 | Starting task 'Build for cware' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'                                                                                                                                                                                    |
| 14-May-2014 15:18:40 | Beginning to execute external process for build 'Magnum Software - V12.X Firmware - Build default #8 (MS-FW-BD-8)' ... running command line: /bin/sh /tmp/MS-FW-BD-8-ScriptBuildTask-3715787108163851510.sh ... in: /home/snalluri/bamboo-agent-home/xml-data/build-dir/MS-FW-BD/fw_comp |
| 14-May-2014 15:18:40 | Failing task since return code of \[/bin/sh /tmp/MS-FW-BD-8-ScriptBuildTask-3715787108163851510.sh\] was -1 while expected 0                                                                                                                                                             |
| 14-May-2014 15:18:40 | Finished task 'Build for cware'                                                                                                                                                                                                                                                          |


Answers:
author: rsperafico
body: Hi Philip,

Unfortunately, Bamboo does not provide makefile. Said that, I would suggest you the following workaround:

/var/toCompile/hello.c

```
// hello.c#include &lt;stdio.h&gt; int main() {    printf("Hello, world!\n");    return 0;}
```

/var/toCompile/makefile

```
all: hello.exe# $@ matches the target; $&lt; matches the first dependenthello.exe: hello.o	gcc -o $@ $&lt;hello.o: hello.c	gcc -c $&lt;     clean:	rm hello.o hello.exe
```

Create a Script task under your plan and type in the following under Script Body\*:

```
// The following will do the compile and // generate an output.txt within the output from the compilingmake -C /var/toCompile/ &gt; /var/toCompile/output.txt
```

Create a Script task after the task above and type in the following:

```
cat /var/toCompile/output.txt
```

Run your build.

Now you should be able to see the output from your compiling.

Kind regards,  
Rafael

comments: author: Philip Rittenhouse
body: Thanks Rafael. I haven't had a chance to try this yet but if the make in the first task fails won't bamboo halt before running the task to cat the output file?

Thanks,

Phil


author: Marcin Gardias
body: You can make the cat task a 'final' task in which case it will be executed regardless of the results of the previous tasks.

You make a task 'final' by moving it below the grey bar in Tasks list. (as described here: [](https://confluence.atlassian.com/display/BAMBOO/Configuring+tasks)<https://confluence.atlassian.com/display/BAMBOO/Configuring+tasks>)


author: Philip Rittenhouse
body: Thanks Marcin, that works.

Best regads,

Phil


author: Felipe Kraemer
body: Hi Phillip,

Yes, Script task seems to be the correct way of executing Make. Basically, anything that can be manually executed in the Terminal can be executed in Bamboo by using Script tasks.

It looks like the script itself is failing, hence the task fails. Using the Terminal, can you go to this directory:

*/home/snalluri/bamboo-agent-home/xml-data/build-dir/MS-FW-BD/fw_comp*

And execute:

*/bin/sh /tmp/MS-FW-BD-8-ScriptBuildTask-3715787108163851510.sh*

Does this work as expected? What's the return code number?

As the script is running in a Remote Agent, its output might not be written in the Bamboo server logs (*\<Bamboo-Home\>/logs/atlassian-bamboo.log* ). Can you also check:

* The logs from the Builds in which this problem happens (located in the *\<Bamboo-Home\>/xml-data/builds/* sub-directories);
* The Remote Agent logs which are generated in the running directory of the Remote Agent. The log file name is usually *atlassian-bamboo-agent.log*.

If you still cannot determine what's causing this issue, please raise a new [Support](https://support.atlassian.com) issue so that we can take a closer look at the logs, and help you troubleshooting this problem.

Kind regards,  
Felipe Kraemer  
Atlassian Support