在 linux 中,我以为Makefile我运行make menuconfig.
但是当我 diff 时Makefile,我看不出任何区别。
我做后更改了哪个文件make menuconfig?
我有一个用于压缩图片的 makefile:
src=$(wildcard Photos/*.jpg) $(wildcard Photos/*.JPG)
out=$(subst Photos,Compressed,$(src))
all : $(out)
clean:
@rmdir -r Compressed
Compressed:
@mkdir Compressed
Compressed/%.jpg: Photos/%.jpg Compressed
@echo "Compressing $<"
@convert "$<" -scale 20% "$@"
Compressed/%.JPG: Photos/%.JPG Compressed
@echo "Compressing $<"
@convert "$<" -scale 20% "$@"
Run Code Online (Sandbox Code Playgroud)
但是,例如,当我的图片名称中带有空格时Piper PA-28-236 Dakota.JPG,会出现以下错误:
make: *** No rule to make target `Compressed/Piper', needed by `all'. Stop.
Run Code Online (Sandbox Code Playgroud)
我认为这是wildcard命令中的一个问题,但我不确定要更改什么才能使其正常工作。
如何修改我的 makefile 以允许文件名中包含空格?
我知道这是一个愚蠢的问题,但是由于我自己非常努力地学习 linux,所以我需要你们的帮助。
我在互联网上找到了这个任务,我正在尝试解决它,但我不明白如何在 linux 中使用 makefile 以及如何创建它们。
假设我的打印工作目录是 /home/george/Documents
我想创建一个执行以下操作的 makefile:
date在这个 make 文件中使用命令来显示前三个字母。敷/etc/hosts在/tmp使用gzip(这里大概应该是这样的
gzip -c SOURCE DESTINATION # ??
Run Code Online (Sandbox Code Playgroud)干杯
我试图构建 dasher,但我得到了它的需要glib。所以这样做了:
Checking for GLIB... configure: error: Package requirements (glib-2.0>= 2.6) were not met:
No package 'glib-2.0' found
Run Code Online (Sandbox Code Playgroud)
所以我尝试安装libglib2.0-dev
它给出了另一个错误:
libglib2.0-dev:
Depends: libglib2.0-0 (=2.26.0-0ubuntu1) but 2.26.1-0ubuntu1 is to be installed
Depends: libglib2.0-bin but it is not going to be installed
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
我以前从未在 Ubuntu 中构建过一个项目,我正在努力掌握 GNU 构建工具和过程。
当我尝试使我得到glib.h - no such file or directory.
这是输出 pkg-config --cflags --libs glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -L/usr/lib/i386-linux-gnu -lglib-2.0
Run Code Online (Sandbox Code Playgroud)
我认为上面的输出是编译器标志使用的吗?
有任何想法吗?
是否可以找出 ./configure 脚本的哪些选项用于创建 Makefile?
使用 make 编译了几个 *.c 和 *.h 文件后,我使用 make clean 清理了目标文件。但是我不知道如何删除可执行文件。
我的makefile代码-->
CC=gcc
CFLAGS=-I.
mp1: main.o downloader.o json.o
$(CC) -o mp1 main.o downloader.o json.o -I.
.PHONY : clean
clean :
-rm *.o $(objects)
Run Code Online (Sandbox Code Playgroud) 全部,
我发现相同的 Makefile 在 Mac OS X 中运行良好,但在 Ubuntu 中不起作用。片段如下:
start:
@echo $(seperator)
@if [[ "$(PROJECT)" == "" ]]; then \
echo " Project powered by CodeMate!"; \
else \
echo " $(PROJECT)"; \
fi
@echo $(seperator)
Run Code Online (Sandbox Code Playgroud)
并提出抱怨:
/bin/sh: [[: not found
Run Code Online (Sandbox Code Playgroud)
任何的想法?
干杯,
李
更新:
我已将上述条件 Bash 语句更改为:
if test "$(PROJECT)" = ""; then \
Run Code Online (Sandbox Code Playgroud)
然后一切正常。那么“[[”有什么问题呢?
Hello Caffe 是一个深度学习库。尝试在 Ubuntu 15.04 下构建该库时,编译失败并显示以下消息:
:~/App/caffe$ make all
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/layer_factory.cpp
In file included from ./include/caffe/common_layers.hpp:10:0,
from ./include/caffe/vision_layers.hpp:10,
from src/caffe/layer_factory.cpp:6:
./include/caffe/data_layers.hpp:9:18: fatal error: hdf5.h: Aucun fichier ou dossier de ce type
#include "hdf5.h"
^
compilation terminated.
Makefile:512: recipe for target '.build_release/src/caffe/layer_factory.o' failed
make: *** [.build_release/src/caffe/layer_factory.o] Error 1
Run Code Online (Sandbox Code Playgroud)
构建失败似乎是特定于 Ubuntu 的。我已经检查了不同的依赖项。我尝试了不同的解决方法:直接在 Makefile.config 中写入 hdf5.h 的路径,从源代码构建 hdf5...
谢谢你的建议
我正在尝试修复一个旧程序,我以前遇到的问题可以在Missing modversions.h 中找到
当我make程序时,它给了我以下错误,
kaodv-mod.c:22:27: fatal error: linux/version.h: No such file or directory
compilation terminated.
Run Code Online (Sandbox Code Playgroud)
所以我跑了
find / -name version.h
Run Code Online (Sandbox Code Playgroud)
返回
/opt/VBoxGuestAdditions-4.3.2/src/vboxguest-4.3.2/vboxguest/include/VBox/version.h
/usr/include/linux/dvb/version.h
/usr/include/linux/version.h
/usr/src/linux-headers-3.8.0-29-generic/include/config/arch/want/ipc/parse/version.h
/usr/src/linux-headers-3.8.0-29-generic/include/generated/uapi/linux/version.h
/usr/src/linux-headers-3.8.0-29/include/uapi/linux/dvb/version.h
/usr/src/linux-headers-3.8.0-29/include/xen/interface/version.h
Run Code Online (Sandbox Code Playgroud)
这清楚地证明linux/version.h存在
为了解决这个问题,我应该改变
kaodv-mod.c:22:27: fatal error: linux/version.h: No such file or directory
compilation terminated.
Run Code Online (Sandbox Code Playgroud)
进入
#include</usr/include/linux/version.h>
Run Code Online (Sandbox Code Playgroud)
或者是否可以对 Makefile 进行更改
PS:生成文件