How to make a makefile for my c++ program


#1

So i’m making a c++ program to store information about people(this is to learn c++)
I Have looked and other guides explaining how to create a makefile, but I just cant rap my head around it. I think being able to see it done in my project might help me understand it. So i’m asking if anyone could take a look at my public project its called “person-prossesing”, and give me a quick little makefile.

Thanks for your help :smiley:
Traitortots.


#2

I haven’t coded in C++ in years, but if I am not mistaken you have to compile your C++ files (.cpp and .h files I believe) using a C++ compiler such as G++ (which you can install in your machine).

I believe this will create the appropriate makefiles and executable files.

If I am mistaken please someone correct me!


#3

Right now what i’m using to compile my code is the command line "g++ [FileNames.cpp] -o [ExecutibleName].

but as far as I can tell its standard for c++ to have a file that the “make” command reads to build your program more efficiently.

Like how it is when you first make the c++ work space it has some test files with a makefile so the make command works