Reputation: 737
i need to change a legacy project thats using Borland Make 5.2 (i can't change that) and i try to understand why this makefile im using for testing behaves 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 is a
--> OKmake /DCONFIG
result is b
--> ???? why is that?make /DCONFIG=
result in a
--> OKmake /DCONFIG=release
result is b
--> OKmake /DCONFIG=debug
result is c
--> OKmake /DCONFIG=invalid
result is Fatal makefile 10: Error directive: unknown: invalid
--> OKand its 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)
anyone with old-school knowledge around who can explain?
Upvotes: 0
Views: 32