【问题标题】:A.Compile cpp2html.c to produce cpp2html.oA.编译cpp2html.c生成cpp2html.o
【发布时间】:2015-12-03 01:12:13
【问题描述】:
Your makefile does too much work when only cpp2html.c has been changed:
gcc -g -c cpp2html.c
gcc -g cpp2html.o lex.yy.o
gcc -g -DDEBUG cpp2html.o lex.yy.o -o cpp2html

不起作用,我几乎尝试了每个序列。我的代码如下:

cpp2html: cpp2html.o lex.yy.o
        gcc {g cpp2html.o lex.yy.o
        gcc -g -DDEBUG cpp2html.o lex.yy.o -o cpp2html
cpp2html.o: cpp2html.c
        gcc -g  -c cpp2html.c
lex.yy.c: cppscanner.l
        flex cppscanner.l
lex.yy.o: lex.yy.c
        gcc -g -c lex.yy.c

【问题讨论】:

  • gcc -g cpp2html.o lex.yy.o 到底应该做什么?
  • 取出第一个 gcc 工作。非常感谢@WillBriggs

标签: unix gcc makefile


【解决方案1】:

the comments 中所述,取出第一个gcc 即可解决问题。

【讨论】:

    猜你喜欢
    • 2011-08-02
    • 2013-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-30
    • 2012-04-14
    • 2013-07-23
    相关资源
    最近更新 更多