I am trying to understand GNU Make and trying to understand some c code and GNU autotools.

There's a folder let's say lib, with three subfolders and a makefile.


So after looking at this folder structure and the make dep command The program goes into the folder, runs make dep then finishes.

The above make dep command gets called after a configure script is run to detect and setup the env.

What exactly is make dep doing?

  • I would presume only the holder of the Makefile will ever know. cat Makefile | grep "dep" (makes and build the dependencies) – Travis Clarke Dec 17 '17 at 2:37
  • 1
    ... seriously though, open and read the Makefile and you will know. It is an arbitrary target delineated in the Makefile and without showing the file, we will never know. – Travis Clarke Dec 17 '17 at 2:45
  • How's that an answer, why would you think that I didn't look in the Makefiles? There's no deps: that's why I am asking the question... – user1610950 Dec 17 '17 at 2:51
  • 1
    It's not an answer... it's a comment. And it is dep not deps. And no, it wouldn't surprise me if you didn't look. – Travis Clarke Dec 17 '17 at 2:52
  • 1
    GNU make – Travis Clarke Dec 17 '17 at 3:01

dep would be defined in the makefile. Makefiles are a simple way to automate things (such as compiling binaries and installing them). make is basically a scripting language.

The makefile will contain a section like this:

    some command
    maybe an if statement or two
    some other command

That section will define what make dep does. Judging by the name, it probably has something to do with dependencies. The makefile will also contain other sections (such as all, default, install, etc) to take care of compile-time configuration, compiling, and installation.

Most packages have install documentation available somewhere to explain the options in the makefile. Reading that and looking at the corresponding sections in the makefile is a good way to learn about how make works.

  • Thanks for the clarification, I looked through all the makefiles and the dep: sections are all empty. Most likely for some features that haven't been implemented yet. Thanks anyways. – user1610950 Dec 17 '17 at 3:38
  • If I only would have made my comment an answer, I would have been respected ... good to know @user1610950. God speed my friend. – Travis Clarke Dec 17 '17 at 3:41
  • Oh, and thanks for this tidbit: dep: sections are all empty – Travis Clarke Dec 17 '17 at 3:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.