URL: <https://savannah.gnu.org/bugs/?59584>
Summary: ifeq with a space after the first open parenthesis Project: make Submitted by: None Submitted on: Tue 01 Dec 2020 03:55:44 AM UTC Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: 4.2.1 Operating System: POSIX-Based Fixed Release: None Triage Status: None _______________________________________________________ Details: Seems like a space breaks the ifeq conditional. Fedora: 32 5.8.13-200.fc32.x86_64 Make: 4.2.1 NB: The first and the last tests. # The checks are for this variable being set to true. using_thirdPartyLib=true #confirmation. No trailing spaces $(warning using_thirdPartyLib=[$(using_thirdPartyLib)] ) # THIS DOES NOT WORK!!!! due to the extra space after the open paren ifeq ( $(using_thirdPartyLib),true) my_c_flags = -I/home/3plibs/tplib/src else my_c_flags = UNSET endif $(warning conditonal using parens but WITH the extra space after open paren : my_c_flags=$(my_c_flags) ) my_c_flags = # this works. No parens. Using quotes instead ifeq "$(using_thirdPartyLib)" "true" my_c_flags = -I/home/3plibs/tplib/src else my_c_flags = UNSET endif $(warning conditonal using double quotes and no parens and hence no space after open paren : my_c_flags=$(my_c_flags) ) my_c_flags = # this works. No parens. Using quotes instead ifeq '$(using_thirdPartyLib)' 'true' my_c_flags = -I/home/3plibs/tplib/src else my_c_flags = UNSET endif $(warning conditonal using single quotes and no parens and hence no space after open paren : my_c_flags=$(my_c_flags) ) my_c_flags = # this works as expected ifeq ($(using_thirdPartyLib),true) my_c_flags = -I/home/3plibs/tplib/src else my_c_flags = UNSET endif $(warning conditonal with parens but WITHOUT the extra space after open paren : my_c_flags=$(my_c_flags) ) my_c_flags = # this test has the same space after the first paren but it actually works ifneq ( $(using_thirdPartyLib),false) $(warning using_thirdPartyLib=[$(using_thirdPartyLib)] ) my_c_flags = -I/home/3plibs/tplib/src else my_c_flags = UNSET endif $(warning ifneq conditonal with parens but WITH the extra space after open paren: my_c_flags=$(my_c_flags) ) all: _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?59584> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/