Using make and writing Makefile ( in C++ or C )

In this Video we will see How to use make command and make file and How to make SIMPLE C++ Makefile. A makefile is a specially formatted text file that a UNIX program called ‘make’ can interpret. Basically, the makefile contains a list of requirements for a program to be ‘up to date.’ The make program looks at these requirements, checks the timestamps on all the source-files listed in the makefile, and re-compiles any files which have an out-of-date timestamp. generally GCC and Make is used to to compile, link and build your c or C++ program. This is A Simple Makefile Tutorial in which you will learn how to write a makefiles with good makefile example. I will explainn What is a makefile ? Makefile with sub-directories, Makefile steps, Make File Tutorial, makefile c++ tutorial, make file tutorial, how to make software in c++, makefile tutorial g++, makefile template c++.

My Website –
My Blog –
My Facebook Page –
Google+ –
Twitter –
Pinterest –
Text Case Converter –
Epoch Timestamp Converter –
Decimal – Binary – Hexadecimal Converter –
8-bit Checksum Calculator –
————————-Stuff I use to make videos ——————-
Stuff I use to make videos
Windows notebook –
Apple MacBook Pro –
Desktop –
Microphone –
notebook mouse –


Christopher Thomas says:

I know it’s an old video, but is is possible to not have to list out each function independently? Such as instead of doing main.o: main.cpp function1.o: function.cpp… we can use some type of wildcard such as *.o : *.cpp?

hadi says:

Printf(“Thanks a lot , Perfect”);

TropicalPriest says:

Thanks, great tutorial. Makefiles were pretty confusing. But, now that I’ve watched you build one, I have a much better understanding of their functionality. Thank you. Loved the video. Favorited your website, as well.

Akash R says:

Wonderful simple and best… -_-

Raghuram Krishnaswami says:

Very nice video.

gujeff says:

Hello Sir, what does | at below command mean? Thanks
$(C_OBJS) $(A_OBJS): | $(OBJ_DIR) kernel_cfg.c

Fatih Güven says:

the sound is too noisy.

Giacomo Mellone says:

Thanks, you made my day.

Peterolen says:

You should also make the included files dependencies, otherwise it might not work correctly if you update one of the header files.

main.o: main.cpp *functions.h*
g++ -c main.cpp

רון גימפלביץ says:

good for a clean start. thanks

Ajay G says:

superb explanation…!keep it up Bro..!

Waseem Ali says:

Very informative lectures. My question is why did not you add the $(CFLAGS) with hello target in second line:
hell: main.o function1.o function2.o
$(CC) main.o function1.o function2.o -o hello

Blau Blue says:

Thank you very much my hero! 🙂

Pickle Pee says:


Ovi Hussain says:

Good explanation dude

Mabrin says:

make load
Makefile:2: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.

and Makefile contains
load :os_startup.xsm


@5:15, Makefile was not saved with “compile:”

Prabhakar Jha says:

pro tip 1.5x

Isan Rivkin says:

Very nice, thank you 🙂

abul kasim says:

Thanks . Make file is explained very nicely.

manojkumar subramaniam says:

Great tutorial but it’s too basic, should better if you include more about variables, pattern matching

Moath Momani says:

thank you


rm -rf *o will remove hello as well 🙂

Rickety Cricket says:

thank you, i found this this vid very useful 🙂

Praveen S. H. says:

Thank you

Tawanda Diza says:

This was awesome, Thank you so much for this

Armchair Pundit says:

great video!

jyotirmaya ojha says:

Good work, amazing tutorial.

Sherry Zhang says:

thanks,it helps a lot.

Drew Bosco says:

Just wanted to drop a comment saying that this video really helped me. Last assignment of the quarter and was having a really rough time with Makefile. Your tutorial was way better than my teachers lol. Thanks!

Bilal Mellouki says:


Karlsson600 says:

Pretty nice, but THANKS GOD for 1.5X speed button, 20 mins on this, damn…

מיכאל קפלן says:


Arash Esfandiari says:

omg this guy talks so slow I lost all my brain cells

Leon Duan says:

Thanks you very much!!!

Tukaram Gaikwad says:

Thanks Sir
Great tutorial

Twicken says:

awesome, thank you for this. Its the only good make file tutorial ive seen and been able to understand!

Vivek Panchal says:

Helpful tutorial.

Volo says:

FINALLY! the video I’ve been looking for to explain makefiles and the process of creating them. Thank you so much!

Shivam Sharma says:

If someone wants the code here you go –

Emailos667 says:


Hari Krishna says:

thank you

Gurpreet Singh says:

Sir can you make a video for making operating system by c++

Sara Serrano says:

Mersi sinyó es mereix un like!!

Ak Videos says:

how to make Trident in c++ bro tell me how to do plz

Mani Kanta says:

Dude. Please prepare well before making a video, don’t end up saying the same things again and again or confuse people which makes the viewers unpleasant in viewing it. By the way thanks for the video. It’s very helpful.

Satish Prabhu says:

can you please help me with how to open those .so files like and .elf files in Linux

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!