#25 $CURDIR incompatible with gnumake
来源:互联网 发布:淘宝模块是什么 编辑:程序博客网 时间:2024/05/20 23:31
#25 $CURDIR incompatible with gnumake
I noticed that the release notes for 1.14 says that CURDIR is now compatible, but in my testing with 1.15 and 2.0rc makepp returns the current file directory (if its included, then the directory of the include) while gnumake always returns the original makefile location.
gnu documentation at http://www.gnu.org/s/hello/manual/make/Recursion.html states:
For your convenience, when GNU make starts (after it has processed any -C options) it sets the variable CURDIR to the pathname of the current working directory. This value is never touched by make again: in particular note that if you include files from other directories the value of CURDIR does not change. The value has the same precedence it would have if it were set in the makefile (by default, an environment variable CURDIR will not override this value). Note that setting this variable has no impact on the operation of make (it does not cause make to change its working directory, for example).
makepp documentation at http://makepp.sourceforge.net/2.0/makepp_variables.html#curdir states:
CURDIR
The directory in which the current Makefile resides.
Discussion
Daniel Pfeiffer
2011-12-13I can't reproduce this. Given /tmp/abc/Makeppfile with:
&echo bef $(CURDIR)
include toto
&echo aft $(CURDIR)and /tmp/toto with:
&echo inc $(CURDIR)
mpp prints:
bef /tmp/abc
inc /tmp/abc
aft /tmp/abcCan you please attach some simple files that reproduce your case?
regards -- Daniel
Credzba
2011-12-14I tried your test, and it worked just as it did for you, then I retried my production code, and it had the same problem ! So.. just need to shrink the problem.
Here is what I found ..
setup your files slightly different:
abc/Makefile (will include ../toto/Makefile.inc)move your toto to
../toto/Makefile.inc (so it will get included properly)
create a ../toto/Makefile (this is the root problem)Now when you makepp in abc directory, you will see it loads the Makefile in toto directory just before it loads toto/Makefile.inc, and Makefile.inc will now have the CURDIR of ITS toto/Makefile, not the original Makefile.
Perhaps this is a feature of makepp, and I can turn it off ?
Daniel Pfeiffer
2011-12-14I still don't get it. I set it up as you write, with an echo in the new file too, and I get:
makepp: Loading makefile `/tmp/abc/Makefile'
bef /tmp/abc
makepp: Loading makefile `/tmp/toto/Makefile'
toto/mf /tmp/toto
inc /tmp/abc <-- still right
aft /tmp/abcThe way you describe it, loading the extra makefile doesn't seem to be your problem. But just in case, be aware that makepp will check if it needs to (re)create an include file. As it does not have a rule for toto/Makefile.inc yet, it will try to load a makefile in its directory to see if that produces a rule. It does not here, so loading the makefile has no effect (at least in my setup, where it does nothing except echo).
So please try to narrow down your problem to a small tarball that reproduces what you mean!
regards -- Daniel
Credzba
2011-12-15tar of example
Attachments
Credzba
2011-12-15The problem is the Makefile in toto has an include for Makefile.inc as well, and since it gets loaded Makefile.inc gets loaded with an invalid directory (in my case).
I think I can work around the problem by moving Makefile out of the include directory or tell it not to try to find a rule for Makefile.inc (if that is possible).
here are sample executions with make and makepp:
% makepp
makepp: Loading makefile `/c/users/desktop/maketest/main/makefile'
CURDIR in main is /c/users/desktop/maketest/main
makepp: Loading makefile `/c/users/desktop/maketest/secondary/makefile'
Makefile from secondary loaded
CURDIR in secondary is /c/users/desktop/maketest/secondary
CURDIR in secondary is /c/users/desktop/maketest/main
CURDIR in main after include is /c/users/desktop/maketest/main
makepp: Entering directory `/c/users/desktop/maketest/main'
Main Target all
makepp: 0 files updated and 1 phony target built09:22 PM ~/makeTest/main
% make
CURDIR in main is /c/Users/desktop/makeTest/main
CURDIR in secondary is /c/Users/desktop/makeTest/main
CURDIR in main after include is /c/Users/desktop/makeTest/main
Main Target all
Daniel Pfeiffer
2011-12-16Ok, now it's clear: you have a misconception here. Makefile.inc is not a makefile in its own right. It does not have its own value of CURDIR. Instead you must think of it, as though it were copy pasted literally instead of the include statements, just like #include in C.
The difference to gmake is that mpp is more thorough in that it loads secondary/Makefile too. This gives you an extra output, which is correct from that makefile. You can verify this with mpp --dont-build ../secondary which is essentially like gmake.
Daniel Pfeiffer
2012-02-16- status: open --> closed-invalid
- #25 $CURDIR incompatible with gnumake
- incompatible with sql_mode=only_full_group_by
- this is incompatible with DISTINCT
- java类型转换错误信息incompatible with
- is incompatible with i386:x86-64 output
- Nil is incompatible with return type ...
- plugin scala is incompatible with current installation
- this is incompatible with sql_mode=only_full_group_by
- this is incompatible with sql_mode=only_full_group_by
- plugin “XXX”is incompatible with this installation
- [mysql] incompatible with sql_mode=only_full_group_by
- this is incompatible with sql_mode=only_full_group_by
- mysql 报错 incompatible with only_full_group_by
- GNUMake点滴(2)
- GNUMake点滴(1)
- GNUMake点滴(3)
- GNUMake点滴(4)
- GNUmake 初步介绍
- maven3.2.1 配置及与MyEclipse6.5 集成
- 香港警花卧底搜集证据 黑帮头目等37人被拘(图)
- 如何暂时取消xcode工程中所有NSLog的输出日志
- Ubuntu12.04嵌入式交叉编译环境arm-linu-gcc搭建过程,图解
- extjs中的recordType
- #25 $CURDIR incompatible with gnumake
- Ruby on Rails 错误“Rails 4.0.0, Gemfile requires rake 10.1.0 for Rake” 解决方案
- 使用 Linux 系统调用的内核命令
- POJ 2538 WERTYU 模拟
- 此文胜过你听三年的培训课,最少省十万
- 如何判断ios设备中是否安装了某款应用
- C#.net----方法
- spring 返回 JSON乱码问题的解决 及个人 动态加载ztree树结构的json数据代码
- 程序员面试精要 一 应聘求职(面试宝典书摘)