C ++: Compile using Batch

1

I'm using cmd to program, and I want to make a batch file that automates the build process. I want it to compile the files using the

g++ -c ./scr/Nome.cpp -o ./obj/Nome.o -std=c++1z

This should be done for all the .cpp files that have been edited since the last compilation (I thought of doing an input, so Nome would be the text that the user typed, the program would then only continue if the user entered with an empty line), and finally execute

cd obj
g++ Arq1.o Arq2.o -o ../a.exe

Putting all the files in the obj folder instead of Arq1.o Arq2.o

How can I do this?

    
asked by anonymous 07.08.2017 / 05:34

1 answer

1

There is already a tool ready for this and several other compilation automations.

The tool is called make and is widely used in the GNU / Linux world.

I would advise you to follow this tutorial to learn the basics of the tool at HERE < a>.

To get a general idea of what make is about, see HERE .

For more information, see HERE .

    
01.09.2017 / 14:44