GNU Make & Makefile To Build C/C++ Projects – (LINUX,MAC)

Understand build process internals to write better makefile for C/C++ Projects in Linux & MAC OS.

Understand make tool & write better makefile by understanding what is happening behind the scene(Creation of intermediate files) during building C/C++ programs. We will understand the makefile by using a real time example( “Creation Of Egg Omelet” ).

What you’ll learn

  • Build C/C++ program using Makefile.
  • As a C/C++ developer what we should know about makefile!.
  • Is Makefile difficult? No No No not at all. We will make it simple. We will focus on how easily we can work in Makefile. Doing Project here, so your concept will be cleared..
  • You will feel this course as a practical guide to Makefile.(MAC,Linux).
  • Cross Compilation Support.
  • Tricks To Make it Handy!.

Course Content

  • Introduction & Environment Setup –> 2 lectures • 10min.
  • Behind The Scene –> 2 lectures • 4min.
  • Decide Types Of Outputs & Create Folder Structure –> 2 lectures • 9min.
  • Make & Makefile –> 6 lectures • 30min.
  • PROJECT#01 –> 19 lectures • 1hr 7min.
  • We Must Know! –> 5 lectures • 13min.
  • Makefile Template –> 3 lectures • 21min.
  • PROJ#02(Let’s Start Final Project – Learn How To Use Makefile Template) –> 8 lectures • 34min.
  • Upcoming… –> 1 lecture • 1min.
  • ONE MAKEFILE TO BUILD PROJECT BY CALLING OTHER MAKEFILES –> 4 lectures • 17min.
  • Let’s Optimize Our Makefile(Functions & Patterns) –> 4 lectures • 14min.

GNU Make & Makefile To Build C/C++ Projects - (LINUX,MAC)

Requirements

Understand make tool & write better makefile by understanding what is happening behind the scene(Creation of intermediate files) during building C/C++ programs. We will understand the makefile by using a real time example( “Creation Of Egg Omelet” ).

We are going to do 2 projects during the learning process of makefile.

PROJECT#1: Without knowing/remembering too many things you will be able to write a makefile for generating binary, shared object(.so), static object(.a), and also get a trick to link from anywhere. After completion of this project Idea of makefile will be cleared. We are creating a makefile template after completing this project and which can be easily used in any project.

PROJECT#2: During implementing this project, we’ll improve our makefile and makefile template created in Project#1 by applying patterns, functions.

Every step we will face some problem and then apply the solution.

 

We will begin with the PROJECT FOLDER STRUCTURE creation(THIS CAN BE USED IN REAL TIME PROJECTS) after understanding all the possible output of a C/C++ program. Then we will come across more technical issues in programming and try to solve them one by one during this journey. Our project structure is in such a way that deployment process will become much easier.

 

We’ll start writing simple makefiles and keep on improving as we really need it! We are doing lots of exercises and facing lots of issues and also fixing all on the fly!

We are going to write a makefile for all possible outputs. In this course you will always learn WHY??? and HOW???

I will show you the real requirement of a particular concept and then we will learn and apply that.

 

Highlights:

1. Write makefile by knowing minimal things.

2. One Makefile to call all makefiles

3. Makefile with Cross Compilation feature

4. Makefile considering DEBUG & RELEASE version of binary.

5. Passing MACRO from makefile to other makefile

6. Detect environment variables of terminal and one make pass the same to other make.

7. We will discuss high level design(HLD) of the projects and from that you will feel how easy it is to write a makefile.

8. You will be more comfortable with command line compilation

9. Understand shared object linking issues and how to fix it temporarily as well as permanently.

10. Project will be done in MAC and copied to Linux. We will directly do a single make which will call all the modules makefile and build the executables, shared object, static objects seamlessly. IMPORTANT thing is WITHOUT ANY SINGLE LINE OF CODE CHANGE FOR LINUX!

 

Get Tutorial