[C++-sig] How to configure makefile for different build platforms

David Aldrich David.Aldrich at EMEA.NEC.COM
Wed Oct 5 18:12:51 CEST 2011


Hi

I have a C++ application that uses Boost.Python.  We build it on Centos 5.3, with Python 2.4 and Boost 1.34.

Our makefile uses explicit paths to find Python and Boost. For the headers we use:

PYTHON = /usr/include/python2.4
BOOST_INC = /usr/include/boost

INCPATH=$(PYTHON)
INCPATH+=$(BOOST_INC)

CXXFLAGS += $(patsubst %,-I%,$(INCPATH))

$(CXX) -c $(CXXFLAGS) sourcefile etc

Now I need to support building on Ubuntu 10.04 which has Python 2.6, not 2.4, installed.

Please can someone suggest how I can modify the makefile to conveniently handle the different Python paths according to the build platform.

Should I simply require the user to define PYTHON as an environment variable, or is there a better way without resorting to something complex like autoconf?

Best regards

David

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20111005/3211fbe5/attachment-0001.html>


More information about the Cplusplus-sig mailing list