Summary

  • automation tool
  • tool used to run (any shell)commands to read files, process these files and write to the processed files. e.g.: executable programs from source code
  • build tool: it builds data files, plots, papers, programs or libraries.
  • although popular for compiling and building, it can be used for running any arbitrary commands.
  • mostly used for C or C++ compilation

Makefile

ref

``` target: source command ```

``` target1: target2 target1_command

target2: target2_command ```

example ``` blah: blah.o cc blah.o -o blah # Runs third

blah.o: blah.c cc -c blah.c -o blah.o # Runs second

blah.c: echo “int main() return 0; " > blah.c # Runs first ```

Definitions

  • target: user specified name
  • source: references to files or other targets
  • command: any shell commands, any number of them