运行错误make make in makefile

时间:2015-12-08 00:29:17

标签: bash shell

Makefile:

all: my1 my2 my3 my4
s2: s1
    tr "1" "2" < s1 > s2
    chmod u+x s2
s3: s1
    tr "1" "4" < s1 > s3
    chmod u+x s3

prog.cpp : i1 i2 i3
    cat i1 >  prog.cpp
    cat i1 >> prog.cpp
    cat i3 >> prog.cpp

prog2.cpp: prog1.cpp
    tr "1" "2" < prog1.cpp > prog2.cpp

prog3.cpp: prog1.cpp
    tr "1" "3" < prog1.cpp > prog2.cpp

prog4.cpp: prog1.cpp
    tr "1" "4" < prog1.cpp > temp
    sed 's/READY/NOT READY/' temp > prog4.cpp

prog1.o: prog1.cpp
    g++ -c prog1.cpp
prog2.o: prog2.cpp
    g++ -c prog2.cpp
prog3.o: prog3.cpp
    g++ -c prog3.cpp
prog4.o: prog4.cpp
    g++ -c prog4.cpp

my1: prog.cpp
    s1
my2: prog.cpp
    s2
my3: prog.cpp prog1.o prog2.o prog3.o prog4.o
    g++ -o prog prog.cpp -D_d3 prog1.o prog2.o prog3.o prog4.o

my4: prog.cpp   
    s3

clean: 

enter image description here

当我尝试运行make all命令时,它会给出错误。我已经参加了该计划超过2个小时,无法弄清楚原因!任何帮助/想法? i1 i2 i3是简单的文本文件,s1是bash脚本。

1 个答案:

答案 0 :(得分:0)

可能.不在PATH。您可以将.添加到PATH,或在makefile中调用./s1