生成文件:"multiple target patterns. stop."
Makefile: "multiple target patterns. stop."
我当然又犯傻了
谁能告诉我这是为什么;
$(shell compileJava.bat)
没有任何变量、特殊字符、不需要的空格、冒号等的表达式导致错误 Makefile:70: *** multiple target patterns. Stop.
。
我在整个互联网上搜索了一个答案。
我正在尝试做什么。
我正在制作一个涉及当地人的 Java 项目。我有这样的结构;
+ root (project)
-+ build
-+ natives (for the built native libraries like dlls)
-+ classes (for the built java classes)
-+ generated (gradles compileJava task automatically generates jni header files)
-+ src
-+ main
-+ java (all of the java source)
-+ resources
-+ c
-+ Makefile (will be called to compile and link the c(++) code)
-+ Makefile (the general makefile, error occurs in here at line 70)
-+ compileJava.bat (calls gradlew compileJava with a jdk argument, but since im using
windows and make doesnt support colons, like C:, i had to put it in a batch file)
根 Makefile 应该遵循此过程;
[1] call "compileJava.bat" to compile the java code & gen the headers (error occurs here)
[2] call "make -C src/main/c" to run the native build makefile
[3] call "jar cf <name> <contents>" to package all java code (and the natives) into a jar
链接
My whole root Makefile: Pastebin
compileJava.bat
: Pastebin
$(shell ...)
是做什么的?它调用 shell 命令,并且 计算命令的标准输出 。
如果你这样写 makefile:
$(shell true)
然后 shell 命令不打印任何内容,因此它展开为无,然后 make 尝试不计算任何内容,但什么也没有发生。
如果你这样写 makefile:
$(shell echo hi)
然后shell命令打印“hi”,这个函数扩展为字符串“hi”,就好像你写了一个makefile:
hi
当然,这不是有效的 makefile。
所以这个:
$(shell make -C src/...)
将 扩展为 运行 make 的整个输出,这显然根本不是一个有效的 makefile。
您可以通过将结果放在变量中来避免这种情况:
_tmp := $(shell make -C src/...)
但是,我真的认为您需要重新考虑您的整个方法。 Makefile 不是像 shell 脚本那样的程序程序。
我当然又犯傻了
谁能告诉我这是为什么;
$(shell compileJava.bat)
没有任何变量、特殊字符、不需要的空格、冒号等的表达式导致错误 Makefile:70: *** multiple target patterns. Stop.
。
我在整个互联网上搜索了一个答案。
我正在尝试做什么。
我正在制作一个涉及当地人的 Java 项目。我有这样的结构;
+ root (project)
-+ build
-+ natives (for the built native libraries like dlls)
-+ classes (for the built java classes)
-+ generated (gradles compileJava task automatically generates jni header files)
-+ src
-+ main
-+ java (all of the java source)
-+ resources
-+ c
-+ Makefile (will be called to compile and link the c(++) code)
-+ Makefile (the general makefile, error occurs in here at line 70)
-+ compileJava.bat (calls gradlew compileJava with a jdk argument, but since im using
windows and make doesnt support colons, like C:, i had to put it in a batch file)
根 Makefile 应该遵循此过程;
[1] call "compileJava.bat" to compile the java code & gen the headers (error occurs here)
[2] call "make -C src/main/c" to run the native build makefile
[3] call "jar cf <name> <contents>" to package all java code (and the natives) into a jar
链接
My whole root Makefile: Pastebin
compileJava.bat
: Pastebin
$(shell ...)
是做什么的?它调用 shell 命令,并且 计算命令的标准输出 。
如果你这样写 makefile:
$(shell true)
然后 shell 命令不打印任何内容,因此它展开为无,然后 make 尝试不计算任何内容,但什么也没有发生。
如果你这样写 makefile:
$(shell echo hi)
然后shell命令打印“hi”,这个函数扩展为字符串“hi”,就好像你写了一个makefile:
hi
当然,这不是有效的 makefile。
所以这个:
$(shell make -C src/...)
将 扩展为 运行 make 的整个输出,这显然根本不是一个有效的 makefile。
您可以通过将结果放在变量中来避免这种情况:
_tmp := $(shell make -C src/...)
但是,我真的认为您需要重新考虑您的整个方法。 Makefile 不是像 shell 脚本那样的程序程序。