makefile

DYLD_LIBRARY_PATH environment variable is not forwarded to external command in Makefile on macOS

时间秒杀一切 提交于 2021-02-16 20:48:10
问题 I am debugging some test failures ( make test ) for a Perl module on macOS. I discovered that the problem seems to be that the environment variable DYLD_LIBRARY_PATH is not forwarded to an external command run from within the Makefile . Here is a minimal example: .PHONY: all all: @echo $$DYLD_LIBRARY_PATH On Linux from the Bash shell, I can do (or rather replace DYLD_LIBRARY_PATH with LD_LIBRARY_PATH which is used for this purpose on Linux): $ export DYLD_LIBRARY_PATH=bar $ make bar However,

Makefile compiles all the files everytime

隐身守侯 提交于 2021-02-11 17:01:08
问题 My Makefile compiles all the files everytime I run it though the files have not been changed. I know that this question has been asked several times but none of the provided solutions seem to work for me. I am new to Makefile and most of the times I do not understand the jargon used in the solution. Also, I want to save all the generated .o files under the folder 'obj' Here is my folder structure project (-) gen (-) display (-) .c and .h files logic (-) .c and .h files lib (-) include (-) .h

Makefile compiles all the files everytime

痴心易碎 提交于 2021-02-11 17:01:03
问题 My Makefile compiles all the files everytime I run it though the files have not been changed. I know that this question has been asked several times but none of the provided solutions seem to work for me. I am new to Makefile and most of the times I do not understand the jargon used in the solution. Also, I want to save all the generated .o files under the folder 'obj' Here is my folder structure project (-) gen (-) display (-) .c and .h files logic (-) .c and .h files lib (-) include (-) .h

Can't figure out how to build C application after adding Mongoose Embedded

谁说胖子不能爱 提交于 2021-02-11 15:16:39
问题 I'm fairly new to C development, and especially to makefiles, so please bear with me. I have a functional C application that builds nicely (based on this project) with it's Makefile, but I want to be able to have it respond to http requests. Thus, Mongoose. Functionally, the Makefile calls: g++ -pthread -I./ -I../../dmx/include -I/usr/include/glib-2.0 -I/usr/include/gtk-3.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I

Can't figure out how to build C application after adding Mongoose Embedded

别等时光非礼了梦想. 提交于 2021-02-11 15:04:33
问题 I'm fairly new to C development, and especially to makefiles, so please bear with me. I have a functional C application that builds nicely (based on this project) with it's Makefile, but I want to be able to have it respond to http requests. Thus, Mongoose. Functionally, the Makefile calls: g++ -pthread -I./ -I../../dmx/include -I/usr/include/glib-2.0 -I/usr/include/gtk-3.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I

Calling one target from another and also pass a variable or value in makefile

痞子三分冷 提交于 2021-02-11 14:49:12
问题 I need to call "target_1" from "target_2" plus also pass on a variable to the "target_1". .PHONY:target_1 target_1: ifeq ($(RQM_SETUP),ci) mkdir /tmp/$1 chown 1000:1000 /tmp/$1 else @echo "Nothing to do" endif .PHONY:target_2 target_2: $(MAKE) target_1(dags) So like in this eg, target_2 would call target_1 and also pass on value as "dags" to it. So that it would create a "/tmp/dags" folder 来源: https://stackoverflow.com/questions/63884790/calling-one-target-from-another-and-also-pass-a

What alternatives are there for “ readlink -e”

那年仲夏 提交于 2021-02-11 14:44:14
问题 I use a makefile which in order to create a library uses a .pc file which looks like this current_path=`readlink -e .` cat > lib/libmy.pc << EOM prefix=$current_path includedir=\${prefix}/inc libdir=\${prefix}/lib Name: my Description: My library Version: 1.0 Cflags: -I\${includedir} Libs: -L\${libdir} -lmy Libs.private: -lm EOM The problem is that on mac the -e flag doesn't work (even I installed coreutils). I there a method to replace the flag? 回答1: The most portable way I could find:

apply the patches based on openwrt package version

流过昼夜 提交于 2021-02-11 14:10:39
问题 In openwrt, as we known, usually the patches for a certain package should be put in package/[pkg]/patches and it will be applied in Makefile via $(Build/Patch). Example: package/test/0001-1.0.1.8.fix-A.patch package/test/0002-1.0.1.8.fix-B.patch When the package update to a new version, the patches sometimes also need to be updated. Example: package/test/0001-1.0.1.9.fix-A.patch package/test/0002-1.0.1.9.fix-B.patch OR package/test/0001-1.0.2.0.fix-A.patch package/test/0002-1.0.2.0.fix-B

apply the patches based on openwrt package version

守給你的承諾、 提交于 2021-02-11 14:09:23
问题 In openwrt, as we known, usually the patches for a certain package should be put in package/[pkg]/patches and it will be applied in Makefile via $(Build/Patch). Example: package/test/0001-1.0.1.8.fix-A.patch package/test/0002-1.0.1.8.fix-B.patch When the package update to a new version, the patches sometimes also need to be updated. Example: package/test/0001-1.0.1.9.fix-A.patch package/test/0002-1.0.1.9.fix-B.patch OR package/test/0001-1.0.2.0.fix-A.patch package/test/0002-1.0.2.0.fix-B

define gets ignored by target_compile_definitions

跟風遠走 提交于 2021-02-11 13:51:03
问题 I am looking to build a library and I need to pass two defines to that build, but cmake's target_compile_definitions() scrambles them in a manner that renders them unusable. The two defines are: -D'_LIB_EXCEPTION_ABI=__attribute__((visibility("default")))' -D'_LIB_FALLTHROUGH()=((void)0)' Unfortunately, the first one gets translated to (in the command build line): -D'_LIB_EXCEPTION_ABI="\__attribute__((visibility(\"default\")))'" While the second one is missing altogether from the command