私は、次のディレクトリ構造を持つプロジェクトを持っています。私はソースファイルが$tests/*/*.e
で、宛先ファイルが$doc/tests/*.rst
であることを指定してmakefileに問題があります。のMakefileは
私はいくつかの同様の質問を見たことがありますが、正しいmakefileの構文を練習することができませんでした。
このメイクファイルは、オブジェクトの完全なリストを使用しているとき、私はトラブルを抱えている単一のファイル例えば
SOURCES = $(wildcard $(tests)/*/*.e)
OBJECTS = $(addprefix $(doc)/tests/,$(notdir $(SOURCES:.e=.rst)))
# single file trial
SRC = $(tests)/test1/test1.e
OBJ = $(doc)/tests/test1.rst
$(OBJ): $(SRC)
debugvars:
@echo SOURCES=$(SOURCES)
@echo OBJECTS=$(OBJECTS)
# define how to create any RST file from a testcase
%.rst:
$(scripts)/wr_rst.py --infile $<
# define how to create an RST file from a testcase
%.rst: %.e
$(scripts)/wr_rst.py --infile $<
.e.rst:
$(scripts)/wr_rst.py --infile $<
.SUFFIXES: .e .rst
を働き、すなわち
all: $(OBJECTS)
$(OBJECTS): $(SOURCES)
$(scripts)/wr_rst.py --infile $<
test1.rst
3回発生するとtest2,3.rst
は無視されます。 $(SOURCES)
と$(OBJECTS)
は正しいです。私は$<
ここ
(SOURCES)
上を反復しないと思われることは(この質問は非常にfamiliar--に見える私は基本的に同じものが求められていることはほぼ誓うだろう
make -d
No implicit rule found for `$tests/test3/test3.e'.
Finished prerequisites of target file `$tests/test3/test3.e'.
No need to remake target `$tests/test3/test3.e'.
Considering target file `tests/test3.rst'.
File `tests/test3.rst' does not exist.
Pruning file `$tests/test1/test1.e'.
Pruning file `$tests/test2/test2.e'.
Pruning file `$tests/test3/test3.e'.
Finished prerequisites of target file `tests/test3.rst'.
Must remake target `tests/test3.rst'.
$scripts/wr_rst.py --inile $tests/test1/test1.e
Putting child 0x00ee6420 (tests/test3.rst) PID 11720 on the chain.
Live child 0x00ee6420 (tests/test3.rst) PID 11720
Writing RST file $doc/tests/test1.rst
Reaping winning child 0x00ee6420 PID 11720
Removing child 0x00ee6420 PID 11720 from chain.
Successfully remade target file `tests/test3.rst'.
実際、['$ <'は最初の前提条件に展開されます(https://www.gnu.org/software/make/manual/make.html#Automatic-Variables)、この場合は '$(テスト).test1.test1.e'。 – Beta