<div dir="ltr"><div><div><div>Hello Colug,<br><br>Does anyone know how to test for a file's presence and set a Make variable accordingly?<br><br></div>I have an apache module that needs one of two structure elements, depending on whether it's 2.2 or 2.4. I have the following function in my makefile:<br>
<br># Test for presence of /etc/redhat-release:<br>which-version: $(DEFS)<br> export DEFS=-DDEF_REMOTE_IP=client_ip;<br> if test -f /etc/redhat-release; then \<br> echo RedhatRelease is present. ; \<br>
export DEFS=-DDEF_REMOTE_IP=remote_ip; \<br> fi;<br> echo DEFS is "$(DEFS)"<br><br></div>$(DEFS) is never getting set. What am I doing wrong?<br><br>Thanks!<br></div>-JK<br></div>