开发者社区 问答 正文

makefile执行出错的问题

我在AIX下测试make编译一个小程序:

makefile文件:

    edit: main.o \
            cc -o main.o
    main.o: main.c \
            cc -c main.c
    clean: \
            rm edit main.o
程序cc编译通过,但是在make编译下显示出错,如下:

personal>make
"makefile", line 2: make: 1254-056 Shell command not associated with a dependency: edit: main.o  cc -o .
"makefile", line 4: make: 1254-056 Shell command not associated with a dependency: main.o: main.c  cc -.
"makefile", line 6: make: 1254-056 Shell command not associated with a dependency: clean:  rm edit main.
make: 1254-058 Fatal errors encountered -- cannot continue.

展开
收起
a123456678 2016-06-06 13:48:58 2541 分享 版权
1 条回答
写回答
取消 提交回答
  • 那个行末的‘’好像不对吧?
    而且我觉得两个对应的编译语句分别应该是
    cc main.o -o edit
    cc -c main.c -o main.o

    2019-07-17 19:28:25
    赞同 展开评论
问答分类:
问答地址: