标签: makefile

如何设置 ccache?

我想使用ccache来加速编译。

我遇到了如何启用 ccache?.

这是我到目前为止所做的:

$ sudo apt-get install -y ccache
$ dpkg -l ccache
ii  ccache  3.1.6-1   Compiler cache for fast recompilation of C/C++ code
$ whereis ccache
ccache: /usr/bin/ccache /usr/lib/ccache /usr/bin/X11/ccache /usr/share/man/man1/ccache.1.gz
Run Code Online (Sandbox Code Playgroud)

ccache通过将它添加到我的~/.bashrc文件来附加到路径:

$ export PATH="/usr/lib/ccache:$PATH"
$ source ~/.bashrc
$ echo $PATH
/usr/lib/ccache:/usr/local/cuda-5.5/bin/:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Run Code Online (Sandbox Code Playgroud)

符号链接看起来不错:

$ ll /usr/lib/ccache/
total 76
drwxr-xr-x   2 root root  4096 mai   22 10:48 ./
drwxr-xr-x 253 root root 69632 mai   22 10:48 ../
lrwxrwxrwx   1 root root …
Run Code Online (Sandbox Code Playgroud)

compiling makefile 12.04

45
推荐指数
1
解决办法
7万
查看次数

安装 Makefile 时出错:“make: *** 未指定目标且未找到 makefile。停止。”

简而言之,当我运行make命令时,它说:

nir@nir:~/Downloads/xf86-video-intel-2.17.0$ make
make: *** No targets specified and no makefile found.  Stop.
Run Code Online (Sandbox Code Playgroud)

我查看了文件夹-xf86-video-intel-2.17.0 里面有一个名为“Makefile.in”的文件,它应该是一个 in 文件,对吧?

makefile

28
推荐指数
2
解决办法
36万
查看次数

"./configure; make; make install" 有什么作用?

有什么作用./configure?为什么make那么make install?它怎么知道在哪里libs?(它们都在那里并已加载,但无法找到它们。)libs如果编译器应该编译,为什么需要?

installation makefile make

27
推荐指数
1
解决办法
4万
查看次数

给定上游源存档,如何让 Debian 打包生成两个包?

我正在为我的 PPA 打包一些东西。上游源是一个.tar.gz基于 Makefile的存档。

由于此包具有大量与体系结构无关的数据,因此让构建脚本生成两个包是明智的:

  • 包裹
  • 包-数据

我该如何设置?我已经编辑了我的 Debiancontrol文件以生成两个包,但我不知道如何将正确的文件放到正确的包中。

由于数据文件目前都是通过 Makefile 安装的,我在这里有点迷茫。

packaging ppa debian makefile

15
推荐指数
1
解决办法
5581
查看次数

在 Makefile 中检测它的 Ubuntu Linux 操作系统

我想创建一个 makefile 来编译我的对象并根据 Linux 发行版(例如 Suse、RedHat 或 Ubuntu)命名它们。如何检测操作系统是否为 Ubuntu?

makefile

14
推荐指数
1
解决办法
5641
查看次数

缺少编译 glib-compile-schemas 的依赖项

我下载了 empathy-3.0.1.tar.bz2 以安装在Ubuntu 10.04 LTS 中
我运行了makefile,但出现错误:

配置:错误:未找到 glib-compile-schemas。

我该如何解决这个问题?请帮我。

gnome makefile make

12
推荐指数
2
解决办法
3万
查看次数

如何让 Six(一个旧的 KDE 游戏程序)在 Kubuntu 20.04 中运行

六号曾多次在电脑游戏奥林匹克竞赛中获得金牌。源代码位于 GitHub https://github.com/melisgl/six/tree/master/six上。它已经被钉了几十年了,但我想把它提出来,但我不熟悉 KDE、Qt 甚至 C++ 编程。我主要是汇编、C 和 Python 程序员,并且已经从事这行大约 50 年了(真的!)。

尽管如此,当我为此目的构建了 Kubuntu 20.04.3、克隆存储库并开始启动时,还是有点令人惊讶。通常的启动是 .configure,但即使这样也不起作用。可能是因为代码太旧了,但我需要帮助。它并没有走得太远,最终询问我是否配置正确,显然是因为它找不到 kde-config。搜索该名称时的一次点击表明它是或在一个名为 kdelibs5-dev 的包中,但我在突触中看不到它。它在我应该安装的其他软件包中吗?我可以做一些简单的事情来进一步了解 .configure 吗?

这是尝试的样子

kevin@kackles:~/Six/six/six$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for -p flag to install... yes
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific …
Run Code Online (Sandbox Code Playgroud)

configuration kde kubuntu makefile

12
推荐指数
1
解决办法
835
查看次数

生成文件中缺少分隔符

我在 Makefile 中有下一个代码:

CFLAGS=-Wall -g

clean:
    rm -f ex1
Run Code Online (Sandbox Code Playgroud)

当我运行“make clean”时,我收到下一个错误:Makefile:4: * missing separator。停止。

为什么?我该如何解决?

makefile make

10
推荐指数
1
解决办法
8万
查看次数

使用 Eclipse 为内核 2.6 编写“Hello World”设备驱动程序

目标

我正在尝试在 Ubuntu 上编写一个简单的设备驱动程序。我想使用 Eclipse(或适合驱动程序编程的更好的 IDE)来做到这一点。这是代码:

#include <linux/module.h>

static int __init hello_world( void )
{
  printk( "hello world!\n" );
  return 0;
}

static void __exit goodbye_world( void )
{
  printk( "goodbye world!\n" );
}

module_init( hello_world );
module_exit( goodbye_world );
Run Code Online (Sandbox Code Playgroud)

我的努力

经过一番研究,我决定使用Eclipse CTD来开发驱动程序(虽然我仍然不确定它是否支持多线程调试工具)。所以我:

  1. 在 VMWare 虚拟机上安装Ubuntu 11.04 桌面 x86
  2. 使用 Synaptic Package Manager安装eclipse-cdtlinux-headers-2.6.38-8
  3. 创建了一个C Project命名TestDriver1并复制粘贴到上面的代码,
  4. 将默认构建命令 , 更改为make以下自定义构建命令:

make -C /lib/modules/2.6.38-8-generic/build M=/home/isaac/workspace/TestDriver1

问题

当我尝试使用 eclipse 构建此项目时出现错误。这是构建的日志: …

build makefile eclipse-cdt drivers

9
推荐指数
1
解决办法
2万
查看次数

我的 makefile 结果:没有规则可以制作目标`arch/x86/tools/relocs.c',需要

我正在使用 Ubuntu 12.04。我写了一个简单的 hello world 内核模块 ( hello.c)。我为它编写了以下makefile:

obj-m+=hello.o
KDIR:= /usr/src/linux-headers-3.2.0-24-generic-pae
all:
     $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
     rm -rf *.o *.ko *.mod.* *.symvers *.order 
Run Code Online (Sandbox Code Playgroud)

但是当我从内核制作时出现了这个错误:

make[1]: Entering directory `/usr/src/linux-headers-3.2.0-24-generic-pae'
make[2]: *** No rule to make target `arch/x86/tools/relocs.c', needed
by `arch/x86/tools/relocs'.  Stop.
Run Code Online (Sandbox Code Playgroud)

hello.c并且makefile/Documents/module_prog. 我make从那个目录跑了。

是什么导致了这个错误,我该如何解决?

makefile

9
推荐指数
1
解决办法
2万
查看次数