Forum OpenACS Q&A: Response to Makefile Help

Collapse
7: Response to Makefile Help (response to 1)
Posted by Todd Gillespie on
Jonathan is correct. You are confusing shell script with makefiles. You cannot run arbitrary commands in makefiles, and there are only a subset of the tests available from the shell syntax. So anyway, I assumed this might work:
ifndef PGLIB
        if [ -d "/usr/local/pgsql" ]; then 
                export PGLIB=/usr/local/pgsql/lib; 
        else 
                export PGLIB=/usr/lib 
        fi
endif
but it turns out that the fragment of script above is executed in its own 'sh -c', and can't assign variables to the makefile. Moreover, IIAC, makefile 'variables' can only be target definitions.

Eventually one has to give up and start working with autoconf/automake.