Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unix A.编译cpp2html.c以生成cpp2html.o_Unix_Gcc_Makefile - Fatal编程技术网

Unix A.编译cpp2html.c以生成cpp2html.o

Unix A.编译cpp2html.c以生成cpp2html.o,unix,gcc,makefile,Unix,Gcc,Makefile,不起作用,我几乎尝试了每一个序列。我的代码如下: 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 如中所述,取出第一个gcc解决了问题。gcc-g cpp2html.o lex.yy.o应该做什么?取出第一个gc

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

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

如中所述,取出第一个
gcc
解决了问题。

gcc-g cpp2html.o lex.yy.o应该做什么?取出第一个gcc是可行的。非常感谢@WillBriggs
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