Makefile:没有规则来制作目标' *。',需要' *'。停止

时间:2015-10-24 06:20:25

标签: c makefile gnu-make

我收到以下错误

make: *** No rule to make target `stretchy_buffer.o', needed by `tsh'.  Stop

尝试制作此makefile

SRCS = stretchy_buffer.c def.c tsh_builtin_commands.c tsh_jobs.c tsh_main.c tsh_routines.c tsh_signals.c
OBJS = $(SRCS:.c=.o)

tsh: $(OBJS)
    gcc -Wall -g -o tsh $(OBJS)

1 个答案:

答案 0 :(得分:6)

您需要在makefile中添加以下规则:

    $ddline = $_POST['deadline_sem'];
    $ex=explode('T', $ddline);
    $date="$ex[0] $ex[1]";
    $deadline=date("Y-m-d H:i:s",strtotime($date));
    echo $deadline;
    $qry1="UPDATE admin SET RegDeadline='$deadline' where username='root'";
    if(mysql_affected_rows()>=0)
        echo "Success";
    else
        echo "Unsuccesull";

在现有的makefile中,没有指定从* .c文件中获取* .o的规则,因此会报告错误。