我正在尝试通过makefile循环遍历特定目录中的.c文件。
我使用了以下代码,但它似乎不起作用:
DIR= Sources \
Sources_2
@for entry in ${DIR} ; \
do \
@for i in $${entry}/*.c ; \
do \
echo "Processing $${i}";
如何在Makefile中使用多个嵌套的if-then块?
例如。
$(NAMING_SCHEME).$(COMPRESS_TYPE):
ifeq ($(COMPRESS_TYPE),lz4)
if [ ${LOG_LEVEL} -gt 0 ] ; then \
@echo hi \
if [ ${LOG_LEVEL} -gt 1 ] ; then \
@echo hi again \
if [ ${LOG_LEVEL} -gt 2 ] ; then \
@echo hi f
我正在尝试安装一个工具,当我执行make操作时,我在config.status文件中得到如下错误:
/bin/sh ./config.status
: command not foundne 6:
: command not foundne 10:
': not a valid identifier export: `SHELL
: command not foundne 16:
./config.status: line 31: syntax error near unexpected token `newline'
'/config.status: line
下面是一个简单的bash程序。它以文件类型作为命令行参数,并查询当前目录并打印指定类型的文件。
我希望能够查询两种不同的文件类型,因此需要两个布尔表达式来表示这一点。
下面是我只查询一种文件类型的代码
#!/bin/bash
for x in $(ls *$1); do
echo $x;
done
现在我想要做的是(用伪码)
command line args fileName .sh .c
for x in (current directory files of *.sh) OR (in current directory files of *.c) do
print
我正试着在OS Capitan上安装Homebrew。
我使用以下命令安装Homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
到目前为止它起作用了。但是,如果我尝试运行任何brew命令,例如:
brew help
我发现了一个错误:
-bash: /usr/local/bin/brew: /bin/bash^M: bad interpreter: No such file or directory
因此,我尝试了的两个顶级答案(将b
我当时正在建设一个C自动化项目。运行"aclocal“将显示以下错误。
$ aclocal
' is already registered with AC_CONFIG_FILES./usr/src/ports/autoconf2.5/autoconf2.5-2.69-3.noarch/src/autoconf-2.69/lib/autoconf/status.m4:288: AC_CONFIG_FILES is
expanded from...
configure.ac:890: the top level
autom4te-2.69: /usr/bin/m4 f
我正在尝试编译从获得的libunity。但是autogen.sh失败了,并显示以下消息:
/usr/bin/gnome-autogen.sh
checking for automake >= 1.11.2...
testing automake... found 1.14.1
checking for autoreconf >= 2.53...
testing autoreconf... found 2.69
checking for intltool >= 0.25...
testing intltoolize... found 0.50.2
checking
我正在尝试安装一个带有C/C++绑定的python包(PyQt4,popplerqt4)。当我试图构建包(绑定所需的SIP包)时,我会得到以下错误:
/bin/sh: -c: line 1: syntax error:unexpected end of file
在这个安装中,他们建议
/bin/sh
由于makefile是问题所在,所以应该从windows命令行运行,而不是从sh.exe运行。
在GNU make描述中,我发现了以下内容:
Choosing the Shell
The program used as the shell is taken from the variabl
我正在学习解析参数的教程。当我运行我的脚本时,无论有没有参数,我都会得到“第45行:语法错误:文件意外结束”。这是脚本中最后一行之后的行。不过,我就是看不到这个错误( bash脚本的新手...)。
#!/bin/bash
#Explain arguments that can be passed in
argumentUsage(){
cat << EOF
usage: $0 options
This script configures rsync to backup SOURCE to DESTINATION and provide notificat
我正在尝试构建一个make文件,以便从snap telemetry...when加载插件。我尝试使用命令sudo make build,it is Makefile:21: *** recipe commences before first target. Stop. Makefile:21: *** recipe commences before first target. Stop. this error....In make file I added
export GOROOT=/usr/local/go
export GOPATH=/home/intel/Downloads/sna
我正在使用qmake明威64/MSYS。
在pro文件中,我需要引用一个相对路径(DESTDIR=../bin),以便正确放置testcase可执行文件。
运行make目标时,生成的Makefile代码包含一行带有windows路径标记的行:
cd ..\bin && /C/Projects/tests/Testcase/src/target_wrapper.sh ./Testcase.exe
更改为..\bin将失败,因为找不到..bin:
/bin/sh: Zeile 0: cd: ..bin: No such file or directory
我找不到为什么qmake