How to call Makefile located in other directory?

Rookie :

I am trying to do this:

I want to call a make (Makefile exists in some other directory, abc path can be used) from a shell script located in a different directory. How do I do this?

Since shell scripting does not allow me to cd into the Makefile directory and execute make, how can I write the shell command (by giving path to the Makefile to be executed) to execute make?

Basile Starynkevitch :

GNU make accepts many options, notably -C to change directory before running, and -f for giving the Makefile to follow.

Combine them appropriately.

Consider using remake to ease debugging (notably with -x) of Makefile related issues. With GNU make version 4 or better, also use make --trace...

You could have your own executable shell script (e.g. in your $HOME/bin/ which would be in your $PATH) which uses both cd and make).

You could consider other build automation tools (ninja perhaps)

Read also P.Miller's paper Recursive Make considered harmful

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to call latex located in docker?

From Dev

Makefile, add headers located in parent directory (Not allowed to move inside!)

From Dev

How is stdout piped in to a file located in a different directory?

From Dev

Makefile change directory and call git function

From Dev

How to call an API located on the same server?

From Dev

Docker : Can a container A call an executable located on an other container B?

From Dev

How to import the file in other project/directory by configuring the Makefile or _Coqproject in current project

From Dev

How to enter a parent directory in Makefile?

From Dev

How to tar a directory with using makefile

From Dev

How to replace parent directory in Makefile

From Dev

UWP: how to start an exe file that is located in specific directory?

From Python

How to plot different subplots in terms of different files located in one directory?

From Dev

How to run a shell script with a file argument located in the same directory at the script?

From Dev

How to display a image in jsp, which is located in root directory of server

From Dev

How to use eslint plugin modules located in parent directory?

From Dev

How do we find a file that is located some where in directory tree

From Dev

call python script function from other directory

From Dev

How to get data from TextBox, which located on the other page?

From Java

AspectJ: How to get pointcuts to advise classes located in other projects

From Java

How to click a button that is located in other class than method

From Dev

How to call a function located in an executable from a loaded DLL?

From Dev

How to I get the results of a call to a method that is located in a Mongoose model?

From Dev

How to call code located at second two sectors with NASM?

From Dev

How to call a function that is located in a different file to set $_SESSION variables

From Dev

How to handle spaces in directory names inside makefile

From

How to get current relative directory of your Makefile?

From Dev

makefile how to output to separate build directory

From Dev

How to delete all except a directory in Makefile?

From Dev

How to save Makefile output in a child directory

Related Related

  1. 1

    How to call latex located in docker?

  2. 2

    Makefile, add headers located in parent directory (Not allowed to move inside!)

  3. 3

    How is stdout piped in to a file located in a different directory?

  4. 4

    Makefile change directory and call git function

  5. 5

    How to call an API located on the same server?

  6. 6

    Docker : Can a container A call an executable located on an other container B?

  7. 7

    How to import the file in other project/directory by configuring the Makefile or _Coqproject in current project

  8. 8

    How to enter a parent directory in Makefile?

  9. 9

    How to tar a directory with using makefile

  10. 10

    How to replace parent directory in Makefile

  11. 11

    UWP: how to start an exe file that is located in specific directory?

  12. 12

    How to plot different subplots in terms of different files located in one directory?

  13. 13

    How to run a shell script with a file argument located in the same directory at the script?

  14. 14

    How to display a image in jsp, which is located in root directory of server

  15. 15

    How to use eslint plugin modules located in parent directory?

  16. 16

    How do we find a file that is located some where in directory tree

  17. 17

    call python script function from other directory

  18. 18

    How to get data from TextBox, which located on the other page?

  19. 19

    AspectJ: How to get pointcuts to advise classes located in other projects

  20. 20

    How to click a button that is located in other class than method

  21. 21

    How to call a function located in an executable from a loaded DLL?

  22. 22

    How to I get the results of a call to a method that is located in a Mongoose model?

  23. 23

    How to call code located at second two sectors with NASM?

  24. 24

    How to call a function that is located in a different file to set $_SESSION variables

  25. 25

    How to handle spaces in directory names inside makefile

  26. 26

    How to get current relative directory of your Makefile?

  27. 27

    makefile how to output to separate build directory

  28. 28

    How to delete all except a directory in Makefile?

  29. 29

    How to save Makefile output in a child directory

HotTag

Archive