Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/skillfulelectro/makefiles

This is code based Tutorial for makefiles
https://github.com/skillfulelectro/makefiles

cmake debian linux makefile

Last synced: about 1 month ago
JSON representation

This is code based Tutorial for makefiles

Awesome Lists containing this project

README

        

# Makefiles
# Learning Makefiles: A Beginner's Guide

Makefiles are essential in the Linux ecosystem for managing program compilation and linking. Let's explore what they are, why they exist, and how to create a basic Makefile.

for running this tutorial in your shell :
```
$ git clone https://github.com/SkillfulElectro/Makefiles.git
$ make
```
the automatated version opens each example for you and then runs it to you see the result .

## What Are Makefiles?

Makefiles guide the `make` utility during compilation and linking. They determine which parts of a program need recompilation, making development more efficient.

## Why Do Makefiles Exist?

Makefiles decide which files require recompilation. When files change, Make ensures only necessary parts get recompiled.

## Alternatives to Make

While Make is widely used, other build systems exist:
- **SCons**, **CMake**, **Bazel**, and **Ninja** for C/C++ projects.
- **Ant**, **Maven**, and **Gradle** for Java.
- **Go**, **Rust**, and **TypeScript** have their own build tools.
- Interpreted languages like **Python**, **Ruby**, and raw **JavaScript** don't need Makefiles.

## Versions and Types of Make

This guide focuses on **GNU Make**, the standard implementation on Linux and macOS.

## Basic Makefile Example

Create a `Makefile` with the following content:

```makefile
hello:
echo "Hello, World"
```

Remember to use TABs for indentation. Run make in the same directory to see the output:

```makefile
$ make
echo "Hello, World"
Hello, World
```

For more resources, explore the Makefile Cookbook for templates and detailed comments.

Happy coding! 🛠️🌟

source :

https://www.gnu.org/software/make/manual/html_node/

https://makefiletutorial.com/