我如何强制make / gcc向我显示命令? [英] How do I force make/gcc to show me the commands?

查看:148
本文介绍了我如何强制make / gcc向我显示命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图调试一个编译问题,但我似乎无法得到GCC(或者也许它是编译)来向我展示它正在执行的实际编译器和链接器命令。这里是我看到的输出:

  CCLD libvirt_parthelper 
libvirt_parthelper-parthelper.o:在函数`main'中:
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:102:对`ped_device_get'的未定义引用
/root/qemu-build/libvirt-0.9.0/ src / storage / parthelper.c:116:对'ped_disk_new'的未定义引用
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:122:对'ped_disk_next_partition'的未定义引用
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:172:对'ped_disk_next_partition'的未定义引用
/root/qemu-build/libvirt-0.9.0/src /storage/parthelper.c:172:对`ped_disk_next_partition'的未定义引用
collect2:ld返回1退出状态
make [3]:*** [libvirt_parthelper]错误1

我想看到的应该与此类似:

  $ make 
gcc -Wall -c -o main.o main.c
gcc -Wall -c -o hello_fn.o hello_fn.c
gcc main.o hello_fn.o -o main

请注意,此示例显示了完整的gcc命令。上面的例子只是显示了诸如CCLD libvirt_parthelper之类的东西。我不知道如何控制这种行为。

要调用空运行

  make -n 

这将显示 make 正在尝试执行的操作。


I'm trying to debug a compilation problem but I cannot seem to get GCC (or maybe it is make??) to show me the actual compiler and linker commands it is executing. Here is the output I am seeing:

  CCLD   libvirt_parthelper
libvirt_parthelper-parthelper.o: In function `main':
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:102: undefined reference to `ped_device_get'
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:116: undefined reference to `ped_disk_new'
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:122: undefined reference to `ped_disk_next_partition'
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:172: undefined reference to `ped_disk_next_partition'
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:172: undefined reference to `ped_disk_next_partition'
collect2: ld returned 1 exit status
make[3]: *** [libvirt_parthelper] Error 1

What I want to see should be similar to this:

$ make
gcc -Wall   -c -o main.o main.c
gcc -Wall   -c -o hello_fn.o hello_fn.c
gcc   main.o hello_fn.o   -o main

Notice how this example has the complete gcc command displayed. The above example merely shows things like "CCLD libvirt_parthelper". I'm not sure how to control this behavior.

解决方案

To invoke a dry run:

make -n

This will show what make is attempting to do.

这篇关于我如何强制make / gcc向我显示命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆