Makefile: Run other makefile from makefile

Sebastian Karlsson

So this is what I have:

SUBDIRS = src/lib/ResourceManager

all: $(SUBDIRS)

$(SUBDIRS):
    make install -C $@

I am trying to execute the Makefile in src/lib/ResourceManager when I run make

but it does not execute.

What am I doing wrong?

user2672165

You must declare SUBDIRS as a .PHONY target as the sub-directory obviously always exists; otherwise it won’t be built.

SUBDIRS = src/lib/ResourceManager
.PHONY: all $(SUBDIRS)
all: $(SUBDIRS)

$(SUBDIRS):
    make install -C $@

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 include a makefile into an other makefile?

From Dev

makefile to link each other

From Dev

Run partially build of Makefile

From Dev

Run makefile with command in order

From Dev

Removing dependencies from a Makefile

From Dev

Overwrite variable from makefile

From Dev

Control output from makefile

From Dev

From Makefile to Cmake

From Dev

Makefile: automatic target in other directories

From Dev

Makefile with commands depending on each other

From Dev

Makefile target references Makefile

From Dev

run a program several times with a makefile

From Dev

To run Makefile.tpl in OSX

From Dev

Unexpected EOF while looking for matching '`', but only when run from makefile?

From Dev

How to set eclipse to run a makefile that resides seperatly from the code

From Dev

Run JUnit from makefile (java.lang.NoClassDefFoundError)

From Dev

How to run all input test files from a Makefile?

From Dev

GCC ignoring a library when run from my makefile

From Dev

Include files in Makefile at the start of a makefile or at the end of the makefile

From Dev

How to execute a makefile from R

From Dev

Target dependencies from variable in Makefile

From Dev

Track branch changes from a Makefile

From Dev

pass multiple arguments from makefile

From Dev

Generic rule from makefile to CMake

From Dev

Passing parameters from Python to a makefile

From Dev

Defining macro function from makefile

From Dev

Passing variables from terminal to makefile

From Dev

Build RPM directly from Makefile

From Dev

make output is different from Makefile