D
D
Danil Tunev2018-11-02 18:29:12
C++ / C#
Danil Tunev, 2018-11-02 18:29:12

Hello! Problems with make?

Recently, I began to notice the advantages of this tool) I just didn’t fully understand something! path relative to makefile? Next, when the make commands follow, I didn’t understand here!, "gcc -c -o main.o main.c" what does it do? Also, is the entire syntax of an example makefile a subset of the shell?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dedalqq, 2018-11-02
@lada-guy

On the contrary: the Makefile includes the . Roughly speaking, this is a shell wrapper that allows you to break the shell into blocks and specify dependencies on different blocks of shell code.
`gcc -c -o main.o main.c` - This command has nothing to do with the Makefile, what exactly is the question?
And as far as I remember, if you just call make, then the Makefile from the current directory will be executed, along this path and must be written relative to the current directory. But it is possible to call make by specifying where to look for the Makefile, but what exactly the behavior will be here, I can’t say =( I’ve never done this, you have to look.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question