I have several directories representing subparts of a project, each with its own Makefile.
I want to create a master Makefile with targets for each of those subparts, each target satisfying the following:
- depend on a certain target from that subproject s Makefile.
This is the tricky part. - copy some resulting library/executable build by the subproject into a central directory (kind of like "make install"-ing it).
This I can already achieve using simple commands.
I could only find information about the include
directive of GNU make, but that doesn t help me much as it seems not to encapsulate the rules (and execution) of the included makefile in its own directory, but instead just #include
s them C-style (rather that thinking of them as packages with separate scopes).
INSTALLDIR := build
SRCDIR := src
TARGETS := projA projB
.PHONY: $(TARGETS)
TARGETS_PATH := $(addprefix $(SRCDIR)/, $(TARGETS))
MAKEFILES := $(addsuffix /osx.mak, $(TARGETS_PATH))
# include them somehow?
对于上文定义的这种设置,我现在想到的是$>(TARGETS)
to depend<>> on the release
的对应清单指标(如projA:$(SRCDIR)/projA/osx.mak @ release
,用于支持jA,用我自己的语言表示该指标是赞成j A取决于能否成功执行具体清单中的<代码>release指标。
Is there any way to achieve this?
You can suggest other tools apart from GNU make, but the subproject makefiles are already written as makefiles.