# 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_ADAPTOR SAGA_MK_INC_ADAPTOR = yes ifdef SAGA_ROOT include $(SAGA_ROOT)/make/saga.util.mk else include $(SAGA_LOCATION)/share/saga/make/saga.util.mk endif ########################################################### # # make configuration for adaptor builds # ifndef SAGA_ADAPTOR_NAME $(info make: ) $(info make: -- Adaptor name not defined! -- ) $(info make: ) $(info make: SAGA_ADAPTOR_NAME must be set in Makefile) $(info make: if saga.adaptor.mk is used.) $(info make: ) $(error SAGA make error ***)) endif ifndef SAGA_ADAPTOR_TYPE $(info make: ) $(info make: -- Adaptor type not defined! -- ) $(info make: ) $(info make: SAGA_ADAPTOR_TYPE must be set in Makefile) $(info make: if saga.adaptor.mk is used.) $(info make: ) $(error SAGA make error ***)) endif # check if that package type is enabled ifeq "$(SAGA_PACKAGE_$(call saga_uc,$(SAGA_ADAPTOR_TYPE)))" "yes" # check if we have the pre-requisits # check_pre = $(or $(SAGA_HAVE_$(call saga_uc,$(1))) \ # $(SAGA_HAVE_INTERNAL_$(call saga_uc,$(1))) ) check_pre = $(SAGA_HAVE_$(call saga_uc,$(1)))$(SAGA_HAVE_INTERNAL_$(call saga_uc,$(1))) check_sub = $(subst no,,$(call check_pre,$(1))) check_req = $(if $(strip $(call check_sub,$(1))),, \ SAGA_DISABLE_ADAPTOR:="$(SAGA_DISABLE_ADAPTOR) $(1)") dummy = $(foreach req, \ $(SAGA_ADAPTOR_REQS), \ $(call check_req,$(req))) endif endif # guard # this stupid construct prevents eval from beeing called # with an ifdef'ed area, which is broken for make 3.80, at least on MacOS X... dummy2 := $(eval $(dummy)) ifeq "x$dummy2" "x" $(warning $(dummy2)) endif ifndef SAGA_MK_INC_ADAPTOR_2 SAGA_MK_INC_ADAPTOR_2 = yes ifdef SAGA_DISABLE_ADAPTOR .PHONY: nothing nothing: @$(ECHO) " ======================================================" @$(ECHO) " the $(SAGA_ADAPTOR_NAME) adaptor is disabled, missing:$(SAGA_DISABLE_ADAPTOR)" @$(ECHO) " ======================================================" configure: nothing confclean: nothing makefiles: nothing deps: nothing depend: nothing depclean: nothing distclean: nothing libclean: nothing clean: nothing install: nothing all: nothing else SAGA_ADP_NAME = $(SAGA_ADAPTOR_NAME) SAGA_ADP = libsaga_adaptor_$(SAGA_ADP_NAME).$(SAGA_LEXT) SAGA_ADP_ROOT = $(SAGA_LOCATION)/lib/ SAGA_ADP_ROOTQ = "$$SAGA_LOCATION/lib/" SAGA_ADP_INI = saga_adaptor_$(SAGA_ADAPTOR_NAME).ini ifdef SAGA_ROOT include $(SAGA_ROOT)/make/saga.mk SAGA_PACKAGE_INC = $(wildcard $(SAGA_ROOT)/make/saga.package.*.i.mk) else include $(SAGA_LOCATION)/share/saga/make/saga.mk SAGA_PACKAGE_INC = $(wildcard $(SAGA_LOCATION)/share/saga/make/saga.package.*.mk) endif include $(SAGA_PACKAGE_INC) all:: $(SAGA_ADP) install:: @$(ECHO) " install $(SAGA_ADAPTOR_NAME) adaptor" @$(MKDIR) $(SAGA_ADP_ROOT) @$(CP) $(SAGA_ADP) $(SAGA_ADP_ROOT) @$(ECHO) " install $(SAGA_ADAPTOR_NAME) ini" @$(MKDIR) $(SAGA_INI_ROOT) @$(CP) $(SAGA_ADAPTOR_INI) $(SAGA_INI_ROOT)/$(SAGA_ADP_INI) $(SAGA_ADP):: $(SAGA_ADAPTOR_OBJ) @$(ECHO) " liblinking $@" @$(SAGA_LD_LIB) -o $@ $^ $(SAGA_LDFLAGS) $(SAGA_LDFLAGS_EXT) clean:: -@$(RM) $(SAGA_ADP) SAGA_CCFLAGS += -DSAGA_ADAPTOR_NAME=$(SAGA_ADAPTOR_NAME) SAGA_CXXFLAGS += -DSAGA_ADAPTOR_NAME=$(SAGA_ADAPTOR_NAME) ifdef SAGA_ROOT SAGA_LDFLAGS += -L$(SAGA_ROOT)/src/impl/engine -lsaga_engine else SAGA_LDFLAGS += -L$(SAGA_LOCATION)/lib -lsaga_engine endif endif # package enabled endif # guard