admin管理员组文章数量:1516870
I need to change a legacy project that's using Borland Make 5.2 (I can't change that) and I'm trying to understand why this makefile I'm using for testing is behaving so strange.
The make.exe 5.2 is available in the free Borland 5.5 C++ compiler package.
MY=a
!ifdef CONFIG
!if ($(CONFIG)==release)
MY=b
!elif ($(CONFIG)==debug)
MY=c
!else
!error unknown: $(CONFIG)
!endif
!endif
all:
@echo $(MY)
When I run with:
make
result isa--> OKmake /DCONFIG
result isb--> ???? why is that?make /DCONFIG=
result isa--> OKmake /DCONFIG=release
result isb--> OKmake /DCONFIG=debug
result isc--> OKmake /DCONFIG=invalid
result isFatal makefile 10: Error directive: unknown: invalid--> OK
And it's also very indent fragile (same makefile).
This gives just an error:
Error makefile 14: Unexpected end of file in conditional started at line 2
MY=a
!ifdef CONFIG
!if ($(CONFIG)==release)
MY=b
!elif ($(CONFIG)==debug)
MY=c
!else
!error unknown: $(CONFIG)
!endif
!endif
all:
@echo $(MY)
Can anyone with old-school knowledge explain this?
本文标签:
版权声明:本文标题:makefile - Why does Borland Make (tested 4.0,5.0,5.2) echoes 'b' when using only DCONFIG - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.betaflare.com/web/1741109325a2341192.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论