using MakeFiles for CICD

Published by

on

MakeFile:

Makefiles are used to help decide which parts of a large program need to be recompiled. In the vast majority of cases, C or C++ files are compiled. For Java, there’s Ant, Maven, and Gradle. Other languages like Go, Rust, and TypeScript have their own build tools.

Installation on windows

using chocolately , lets install make in windows

choco install make

Creating and using Makefile

create a file named Makefile

in the makefile, declare the targets. targets are similar to ‘stages’ or items that makefile executes. Targets contains the steps that we want to execute as part of that target.

for example

one:
  touch demo1.txt
two:
  touch demo2.txt
all: one two

In the above block one, two are the targests. we can execute the targets independently, or we can run them togther or we can combine targets and create an another target to run the first two targets, example all target.
so, we will be able to run , make one, & make two.

combine both as one command make one two, or simple run make all to execute both one & two targets in one go.

Makefile is extremely useful in CICD process and it can be used with Github Actions to run the CICD process.

References: Make Docs

Leave a comment

Discover more from dwarak

Subscribe to the newsletter to keep reading and get access to the full archive.

Continue Reading with out subscribing