我正在尝试使用自己的隐式规则编译cobol源,但没有成功。
上下文:
这是我的Makefile:
COBFLAGS=-g -qTEST -q"SPILL(32648)" -q64 -q"WSCLEAR(32)" -qNOSEQ -qLIST -qNUMBER -qSSRANGE -q"LINECOUNT(0)"
SRCDIR=../../ai_cobol/src/main/cbl/lib
CPYDIR=../../ai_cobol/src/main/cpy
TMPCBL=/tmp/tmpcbl
vpath %.cbl $(SRCDIR)
SOURCES = $(wildcard $(SRCDIR)/*.cbl)
CIBLES = $(notdir $(SOURCES))
.SUFFIXES: .cbl
% : %.cbl
cob2 $(COBFLAGS) -I$(CPYDIR) $< $(ZZDEBUG)
all: init todo
init:
rm -rf $(TMPCBL) && mkdir -p $(TMPCBL)
todo: $(CIBLES)
echo ""
启动Gmake从未构建过我的cobol源文件。但是,调试输出显示gmake可以找到它们:
....
Considering target file `ZZABEND.cbl'.
Looking for an implicit rule for `ZZABEND.cbl'.
Trying pattern rule with stem `ZZABEND.cbl'.
Trying implicit prerequisite `ZZABEND.cbl,v'.
Trying pattern rule with stem `ZZABEND.cbl'.
Trying implicit prerequisite `RCS/ZZABEND.cbl,v'.
Trying pattern rule with stem `ZZABEND.cbl'.
Trying implicit prerequisite `RCS/ZZABEND.cbl'.
Trying pattern rule with stem `ZZABEND.cbl'.
Trying implicit prerequisite `s.ZZABEND.cbl'.
Trying pattern rule with stem `ZZABEND.cbl'.
Trying implicit prerequisite `SCCS/s.ZZABEND.cbl'.
No implicit rule found for `ZZABEND.cbl'.
Finished prerequisites of target file `ZZABEND.cbl'.
No need to remake target `ZZABEND.cbl'; using VPATH name `../../ai_cobol/src/main/cbl/lib/ZZABEND.cbl'.
Considering target file `ZZASBTPB.cbl'.
Looking for an implicit rule for `ZZASBTPB.cbl'.
Trying pattern rule with stem `ZZASBTPB.cbl'.
Trying implicit prerequisite `ZZASBTPB.cbl,v'.
Trying pattern rule with stem `ZZASBTPB.cbl'.
Trying implicit prerequisite `RCS/ZZASBTPB.cbl,v'.
Trying pattern rule with stem `ZZASBTPB.cbl'.
Trying implicit prerequisite `RCS/ZZASBTPB.cbl'.
Trying pattern rule with stem `ZZASBTPB.cbl'.
Trying implicit prerequisite `s.ZZASBTPB.cbl'.
Trying pattern rule with stem `ZZASBTPB.cbl'.
Trying implicit prerequisite `SCCS/s.ZZASBTPB.cbl'.
No implicit rule found for `ZZASBTPB.cbl'.
Finished prerequisites of target file `ZZASBTPB.cbl'.
No need to remake target `ZZASBTPB.cbl'; using VPATH name `../../ai_cobol/src/main/cbl/lib/ZZASBTPB.cbl'.
......
所以我不明白鲸鱼是问题所在.....
答案 0 :(得分:1)
您的'CIBLES'包含源文件的名称;尝试此更改:
old: CIBLES = $(notdir $(SOURCES))
new: CIBLES = $(basename $(notdir $(SOURCES)))