# Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net) # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # vim: ft=make ifndef SAGA_MK_INC_PYTHON SAGA_MK_INC_PYTHON = yes ########################################################### # # make configuration for python builds # include $(SAGA_ROOT)/make/saga.mk # thise needs to come from configure -- FIXME SAGA_PY_VER = 2.4 SAGA_PY_ROOT = /usr/ # additional defines for build and install SAGA_PY_SCRIPT_ROOT = $(SAGA_LOCATION)/share/saga/python SAGA_PY_MODULE_ROOT = $(SAGA_LOCATION)/lib/python$(SAGA_PY_VER)/site-packages/ SAGA_PY_CXXFLAGS += -I/$(SAGA_PY_ROOT)/include/python$(SAGA_PY_VER)/ SAGA_PY_LDFLAGS += -L/$(SAGA_PY_ROOT)/lib -lpython$(SAGA_PY_VER) SAGA_ALL_PY_OBJ += $(SAGA_PY_MODULE_OBJ) $(SAGA_PY_OBJ) # we need SAGA_PY_CXXFLAGS also for SAGA_CXXFLAGS, otherwise deps fail SAGA_CXXFLAGS += $(SAGA_PY_CXXFLAGS) # build objects and modules by default all:: $(SAGA_ALL_PY_OBJ) $(SAGA_PY_MODULE) # additional rules for obkect and module building $(SAGA_PY_MODULE):: $(SAGA_PY_MODULE_OBJ) @echo " liblink python module $@" @$(SAGA_LD_LIB) -o $@ $^ $(SAGA_PY_LDFLAGS) $(SAGA_LDFLAGS) $(SAGA_LDFLAGS_EXT) $(SAGA_ALL_PY_OBJ): %.o : %.cpp @echo " compile python object $@" @$(SAGA_CXX) -c -o $@ $< $(SAGA_CXXFLAGS) $(SAGA_PY_CXXFLAGS) # additional install targets install:: all ifdef SAGA_PY_SCRIPT @echo " install python scripts" @mkdir -p $(SAGA_PY_SCRIPT_ROOT)/$(SAGA_PY_SCRIPT_DIR) @cp -f $(SAGA_PY_SCRIPT) $(SAGA_PY_SCRIPT_ROOT)/$(SAGA_PY_SCRIPT_DIR) endif ifdef SAGA_PY_MODULE @echo " install python modules" @mkdir -p $(SAGA_PY_MODULE_ROOT)/$(SAGA_PY_MODULE_DIR) @cp -f $(SAGA_PY_MODULE) $(SAGA_PY_MODULE_ROOT)/$(SAGA_PY_MODULE_DIR) endif clean:: @rm -f $(SAGA_PY_MODULE_OBJ) @rm -f $(SAGA_PY_MODULE) endif # guard