# -*- Makefile -*- # # Make rule template for autoconf builds, sourced before dir.mk # # Based upon beforedir.mk and platform makefiles platform = autoconf MAKEFILE_INC_DIR = $(BASE_OMNI_TREE)/$(CURRENT)/ IMPORT_TREES = $(TOP) $(BASE_OMNI_TREE) THIS_IMPORT_TREE = $(TOP) EXPORT_TREE = $(TOP) PYTHON = @PYTHON@ # If the build tree is the same as the source tree, autoconf helpfully # clears any makefile lines that set VPATH. We put it back here. ifndef VPATH VPATH=. endif ############################################################################# # # Standard directories in import/export trees # INCDIR = include IDLDIR = idl MAKEDIR = mk LIBDIR = lib BINDIR = bin ############################################################################# # # Directories for installation # prefix := @prefix@ exec_prefix := @exec_prefix@ INSTALLTARGET := 1 INSTALLINCDIR := $(DESTDIR)@includedir@ INSTALLBINDIR := $(DESTDIR)@bindir@ INSTALLLIBDIR := $(DESTDIR)@libdir@ INSTALLPYTHONDIR := $(DESTDIR)@pythondir@ INSTALLPYEXECDIR := $(DESTDIR)@pyexecdir@ INSTALLIDLDIR := $(DESTDIR)@datadir@/idl ############################################################################# # # Tool bindir to use depends on make target # ifeq ($(MAKECMDGOALS),install) TOOLBINDIR = $(INSTALLBINDIR) else TOOLBINDIR = $(TOP)/$(BINDIR) endif ############################################################################# # # These definitions are useful for referring to spaces and commas inside # GNU make functions # empty := space := $(empty) $(empty) comma := , ############################################################################# # # DIR_CPPFLAGS can be defined in dir.mk. # IMPORT_CPPFLAGS can have platform-independent -D and -I flags added by each # import tree using +=. Note that here we already put a -I flag for each # directory in VPATH and each import tree's include directory. # # CXXDEBUGFLAGS and CDEBUGFLAGS are for setting debug/optimisation options to # the C++ and C compilers respectively. CXXOPTIONS and COPTIONS are for # setting any other options to the compilers. # # There is nothing magic about these variables, but hopefully this covers # most of the things people will want to set in other import trees and dir.mk. # IMPORT_CPPFLAGS += -I. $(patsubst %,-I%,$(VPATH)) \ -I$(TOP)/include -I$(BASE_OMNI_TREE)/include \ -D__OSVERSION__=@OSVERSION@ CPPFLAGS = $(DIR_CPPFLAGS) $(IMPORT_CPPFLAGS) CFLAGS = $(CDEBUGFLAGS) $(COPTIONS) $(CPPFLAGS) CXXFLAGS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(CPPFLAGS) ############################################################################# # # GENERATE_LIB_DEPEND is a variable which behaves more like a "function", # taking a single argument, the current value of $(lib_depend). What it does # is search through the IMPORT_LIBRARY_DIRS for the library specified in # lib_depend. It is used with ":=" (simply-expanded variables) like this: # # lib_depend := libwobble.a # WOBBLE_LIB_DEPEND := $(GENERATE_LIB_DEPEND) # # $(WOBBLE_LIB_DEPEND) can now be specified as one of the dependencies of an # executable which uses "libwobble.a", so that the executable will be rebuilt # whenever libwobble.a changes. # IMPORT_LIBRARY_DIRS = $(patsubst %,%/$(LIBDIR),$(IMPORT_TREES)) GENERATE_LIB_DEPEND = $(firstword \ $(foreach dir,$(IMPORT_LIBRARY_DIRS),$(wildcard $(dir)/$(lib_depend)))) ############################################################################# # # Phony targets # .PHONY: all export install clean veryclean redepend lastveryclean ############################################################################# # # MakeSubdirs is a general rule which runs make in each of SUBDIRS. # Unfortunately we have to unset MAKEFLAGS otherwise the -I flags which # make passed to this make will be incorrectly passed down to the sub-make. # define MakeSubdirs (unset MAKEFLAGS; \ set -e; \ if [ "$$subdir_makeflags" = "" ]; then \ subdir_makeflags='$(SUBDIR_MAKEFLAGS)'; \ fi; \ if [ "$$subdirs" = "" ]; then \ subdirs='$(SUBDIRS)'; \ fi; \ if [ "$$target" = "" ]; then \ target='$@'; \ fi; \ for dir in $$subdirs ; do \ $(CreateDir); \ (cd $$dir ; echo "making $$target in $(CURRENT)/$$dir..." ; \ eval $(MAKE) $$subdir_makeflags $$target ) ; \ if [ $$? != 0 ]; then \ exit 1; \ fi; \ done; \ ) endef # Stop SUBDIRS specified on the command line being passed down. unexport SUBDIRS ############################################################################# # # Useful bits of shell script. Most take arguments as shell variables which # can be set before putting them in your make rule. # # # Create directory $$dir if it doesn't already exist. # define CreateDir if [ ! -d $$dir ]; then \ (umask 002; set -x; $(MKDIRHIER) $$dir); \ fi endef # # Find $$file in $$dirs. Returns full file name in $$fullfile. # define FindFileInDirs case "$$file" in \ /*) fullfile="$$file";; \ *) \ fullfile=""; \ for _dir in $$dirs; do \ if [ -f $$_dir/$$file ]; then \ if [ "$$_dir" = "." ]; then \ fullfile="$$file"; \ else \ fullfile="$$_dir/$$file"; \ fi; \ break; \ fi; \ done; \ if [ ! "$$fullfile" ]; then \ echo "ERROR: Cannot find $$file in $$dirs"; \ exit 1; \ fi;; \ esac endef # # Find $$file in current directory or $(VPATH) - returns $$fullfile. # define FindFileInVpath dirs='. $(VPATH)'; \ $(FindFileInDirs) endef # # "Export" $$file to $$dir, creating $$dir if necessary. Searches for # $$file in $(VPATH) if not found in current directory. # define ExportFileToDir $(CreateDir); \ $(FindFileInVpath); \ base=`basename $$file`; \ if [ -f $$dir/$$base ] && cmp $$fullfile $$dir/$$base >/dev/null; then \ echo "File $$base hasn't changed."; \ else \ (set -x; \ $(INSTALL) $(INSTLIBFLAGS) $$fullfile $$dir); \ fi endef # # "Export" an executable file. Same as previous one but adds execute # permission. # define ExportExecutableFileToDir $(CreateDir); \ $(FindFileInVpath); \ base=`basename $$file`; \ if [ -f $$dir/$$base ] && cmp $$fullfile $$dir/$$base >/dev/null; then \ echo "File $$base hasn't changed."; \ else \ (set -x; \ $(INSTALL) $(INSTEXEFLAGS) $$fullfile $$dir); \ fi endef ############################################################################# # # CORBA stuff # include $(BASE_OMNI_TREE)/mk/version.mk # It is now possible to compile interfaces and stubs that depend on # idl from import trees without generating headers and stubs for those # imported idls locally. This is useful when the import tree supplies # the headers and stubs itself, usually as part of some library. # # To arrange this, set DIR_IDLFLAGS and DIR_STUBS_CPPFLAGS in your # dir.mk to the appropriate include flags. Usually, these will just # be the ones in IMPORT_IDLFLAGS and IMPORT_CPPFLAGS defined here, so # # DIR_IDLFLAGS = $(IMPORT_IDLFLAGS) # DIR_STUBS_CPPFLAGS = $(IMPORT_CPPFLAGS) # # is all you need. This would be the default if it weren't for the # need to preserve the old (idl-copying) behaviour for existing dir.mk # files. vpath %.idl $(IMPORT_TREES:%=%/idl) IMPORT_IDLFLAGS += -I. $(patsubst %,-I%,$(VPATH)) \ $(patsubst %,-I%/idl,$(IMPORT_TREES)) CORBA_IDL_FILES = $(CORBA_INTERFACES:%=%.idl) CORBA_STUB_DIR = $(TOP)/stub CorbaImplementation = OMNIORB CORBA_IDL = $($(CorbaImplementation)_IDL) CORBA_CPPFLAGS = $($(CorbaImplementation)_CPPFLAGS) CORBA_LIB = $($(CorbaImplementation)_LIB) CORBA_LIB_DEPEND = $($(CorbaImplementation)_LIB_DEPEND) CORBA_LIB_NODYN = $($(CorbaImplementation)_LIB_NODYN) CORBA_LIB_NODYN_DEPEND = $($(CorbaImplementation)_LIB_NODYN_DEPEND) CORBA_IDL_OUTPUTDIR_PATTERN = $($(CorbaImplementation)_IDL_OUTPUTDIR_PATTERN) CORBA_STUB_HDR_PATTERN = $($(CorbaImplementation)_STUB_HDR_PATTERN) CORBA_STUB_SRC_PATTERN = $($(CorbaImplementation)_STUB_SRC_PATTERN) CORBA_STUB_OBJ_PATTERN = $($(CorbaImplementation)_STUB_OBJ_PATTERN) CORBA_DYN_STUB_SRC_PATTERN = $($(CorbaImplementation)_DYN_STUB_SRC_PATTERN) CORBA_DYN_STUB_OBJ_PATTERN = $($(CorbaImplementation)_DYN_STUB_OBJ_PATTERN) CORBA_STUB_HDRS = \ $(CORBA_INTERFACES:%=$(CORBA_STUB_HDR_PATTERN)) CORBA_STUB_SRCS = $($(CorbaImplementation)_STUB_SRCS) CORBA_STUB_OBJS = $($(CorbaImplementation)_STUB_OBJS) CORBA_STATIC_STUB_SRCS = $($(CorbaImplementation)_STATIC_STUB_SRCS) CORBA_STATIC_STUB_OBJS = $($(CorbaImplementation)_STATIC_STUB_OBJS) CORBA_DYN_STUB_SRCS = $($(CorbaImplementation)_DYN_STUB_SRCS) CORBA_DYN_STUB_OBJS = $($(CorbaImplementation)_DYN_STUB_OBJS) CORBA_STUB_FILES = $(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%.idl) \ $(CORBA_STUB_HDRS) $(CORBA_STUB_SRCS) $(CORBA_STUB_OBJS) \ $(CORBA_STUB_OBJS:.o=.d) $(CORBA_STUB_DIR)/dir.mk \ $($(CorbaImplementation)_EXTRA_STUB_FILES) GENERATED_CXX_HDRS += $(CORBA_STUB_HDRS) # # Standard make variables and rules for all UNIX platforms. Override # later if necessary. # UnixPlatform = 1 ThreadSystem = Posix # # General rules for cleaning. # define CleanRule $(RM) *.o *.a endef define VeryCleanRule $(RM) *.d $(RM) *.pyc $(RM) $(CORBA_STUB_FILES) endef # # Patterns for various file types # LibPathPattern = -L% LibNoDebugPattern = lib%.a LibDebugPattern = lib%.a LibPattern = lib%.a LibSuffixPattern = %.a LibSearchPattern = -l% BinPattern = % TclScriptPattern = % # # Stuff to generate statically-linked libraries. # define StaticLinkLibrary (set -x; \ $(RM) $@; \ $(AR) $@ $^; \ $(RANLIB) $@; \ ) endef define ExportLibraryToDir (files="$^"; \ for file in $$files; do \ $(ExportFileToDir); \ done; \ ) endef ifdef EXPORT_TREE define ExportLibrary (dir="$(EXPORT_TREE)/$(LIBDIR)"; \ $(ExportLibraryToDir) \ ) endef endif define InstallLibrary (dir="$(INSTALLLIBDIR)"; \ $(ExportLibraryToDir) \ ) endef # # Stuff to generate executable binaries. # # These rules are used like this # # target: objs lib_depends # @(libs="libs"; $(...Executable)) # # The command we want to generate is like this # # linker -o target ... objs libs # i.e. we need to filter out the lib_depends from the command # IMPORT_LIBRARY_FLAGS = $(patsubst %,$(LibPathPattern),$(IMPORT_LIBRARY_DIRS)) define CXXExecutable (set -x; \ $(RM) $@; \ $(CXXLINK) -o $@ $(CXXLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \ $(filter-out $(LibSuffixPattern),$^) $$libs; \ ) endef define CExecutable (set -x; \ $(RM) $@; \ $(CLINK) -o $@ $(CLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \ $(filter-out $(LibSuffixPattern),$^) $$libs; \ ) endef ifdef EXPORT_TREE define ExportExecutable (dir="$(EXPORT_TREE)/$(BINDIR)"; \ files="$^"; \ for file in $$files; do \ $(ExportExecutableFileToDir); \ done; \ ) endef endif define InstallExecutable (dir="$(INSTALLBINDIR)"; \ files="$^"; \ for file in $$files; do \ $(ExportExecutableFileToDir); \ done; \ ) endef # omnithread - platform libraries required by omnithread. # Use when building omnithread. OMNITHREAD_PLATFORM_LIB = $(filter-out $(patsubst %,$(LibSearchPattern),\ omnithread), $(OMNITHREAD_LIB)) # # omniORB stuff # CorbaImplementation = OMNIORB lib_depend := $(patsubst %,$(LibPattern),omniORB$(OMNIORB_MAJOR_VERSION)) omniORB_lib_depend := $(GENERATE_LIB_DEPEND) lib_depend := $(patsubst %,$(LibPattern),omniDynamic$(OMNIORB_MAJOR_VERSION)) omniDynamic_lib_depend := $(GENERATE_LIB_DEPEND) OMNIORB_DLL_NAME = $(patsubst %,$(LibSearchPattern),\ omniORB$(OMNIORB_MAJOR_VERSION)) OMNIORB_DYNAMIC_DLL_NAME = $(patsubst %,$(LibSearchPattern),\ omniDynamic$(OMNIORB_MAJOR_VERSION)) OMNIORB_IDL_ONLY = $(TOOLBINDIR)/omniidl -bcxx OMNIORB_IDL_ANY_FLAGS = -Wba OMNIORB_IDL = $(OMNIORB_IDL_ONLY) $(OMNIORB_IDL_ANY_FLAGS) OMNIORB_CPPFLAGS = -D__OMNIORB$(OMNIORB_MAJOR_VERSION)__ \ -I$(CORBA_STUB_DIR) $(OMNITHREAD_CPPFLAGS) OMNIORB_IDL_OUTPUTDIR_PATTERN = -C% OMNIORB_LIB = $(OMNIORB_DLL_NAME) $(OMNIORB_DYNAMIC_DLL_NAME) OMNIORB_LIB_NODYN = $(OMNIORB_DLL_NAME) OMNIORB_LIB_NODYN_DEPEND = $(omniORB_lib_depend) OMNIORB_LIB_DEPEND = $(omniORB_lib_depend) $(omniDynamic_lib_depend) OMNIORB_STATIC_STUB_OBJS = \ $(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%SK.o) OMNIORB_STATIC_STUB_SRCS = \ $(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%SK.cc) OMNIORB_DYN_STUB_OBJS = \ $(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%DynSK.o) OMNIORB_DYN_STUB_SRCS = \ $(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%DynSK.cc) OMNIORB_STUB_SRCS = $(OMNIORB_STATIC_STUB_SRCS) $(OMNIORB_DYN_STUB_SRCS) OMNIORB_STUB_OBJS = $(OMNIORB_STATIC_STUB_OBJS) $(OMNIORB_DYN_STUB_OBJS) OMNIORB_STUB_SRC_PATTERN = $(CORBA_STUB_DIR)/%SK.cc OMNIORB_STUB_OBJ_PATTERN = $(CORBA_STUB_DIR)/%SK.o OMNIORB_DYN_STUB_SRC_PATTERN = $(CORBA_STUB_DIR)/%DynSK.cc OMNIORB_DYN_STUB_OBJ_PATTERN = $(CORBA_STUB_DIR)/%DynSK.o OMNIORB_STUB_HDR_PATTERN = $(CORBA_STUB_DIR)/%.hh # thread libraries required by omniORB. Make sure this is the last in # the list of omniORB related libraries OMNIORB_LIB += $(OMNITHREAD_LIB) $(SOCKET_LIB) OMNIORB_LIB_NODYN += $(OMNITHREAD_LIB) $(SOCKET_LIB) OMNIORB_LIB_DEPEND += $(OMNITHREAD_LIB_DEPEND) OMNIORB_LIB_NODYN_DEPEND += $(OMNITHREAD_LIB_DEPEND) OMNITHREAD_LIB = $(patsubst %,$(LibSearchPattern),omnithread) # CodeSets library OMNIORB_CODESETS_LIB = $(patsubst %,$(LibSearchPattern),omniCodeSets$(OMNIORB_MAJOR_VERSION)) lib_depend := $(patsubst %,$(LibPattern),omniCodeSets$(OMNIORB_MAJOR_VERSION)) OMNIORB_CODESETS_LIB_DEPEND := $(GENERATE_LIB_DEPEND) # Connections library OMNIORB_CONNECTIONS_LIB = $(patsubst %,$(LibSearchPattern),omniConnectionMgmt$(OMNIORB_MAJOR_VERSION)) lib_depend := $(patsubst %,$(LibPattern),omniConnectionMgmt$(OMNIORB_MAJOR_VERSION)) OMNIORB_CONNECTIONS_LIB_DEPEND := $(GENERATE_LIB_DEPEND) # omniORB SSL transport OMNIORB_SSL_VERSION = $(OMNIORB_VERSION) OMNIORB_SSL_MAJOR_VERSION = $(word 1,$(subst ., ,$(OMNIORB_SSL_VERSION))) OMNIORB_SSL_MINOR_VERSION = $(word 2,$(subst ., ,$(OMNIORB_SSL_VERSION))) OMNIORB_SSL_LIB = $(patsubst %,$(LibSearchPattern),\ omnisslTP$(OMNIORB_SSL_MAJOR_VERSION)) lib_depend := $(patsubst %,$(LibPattern),omnisslTP$(OMNIORB_SSL_MAJOR_VERSION)) OMNIORB_SSL_LIB_DEPEND := $(GENERATE_LIB_DEPEND) OMNIORB_SSL_LIB += $(OPEN_SSL_LIB) OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS) ########################################################################## # # Shared library support stuff # # Default setup. Work for most platforms. For those exceptions, override # the rules in their platform files. # BuildSharedLibrary = 1 # Enable by default SHAREDLIB_SUFFIX = so SharedLibraryFullNameTemplate = lib$$1$$2.$(SHAREDLIB_SUFFIX).$$3.$$4 SharedLibrarySoNameTemplate = lib$$1$$2.$(SHAREDLIB_SUFFIX).$$3 SharedLibraryLibNameTemplate = lib$$1$$2.$(SHAREDLIB_SUFFIX) SharedLibraryImplibNameTemplate = lib$$1$$2.a SharedLibraryPlatformLinkFlagsTemplate = -shared -Wl,-soname,$$soname define SharedLibraryFullName fn() { \ if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi ; \ echo $(SharedLibraryFullNameTemplate); \ }; fn endef define SharedLibraryImplibName fn() { \ if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi ; \ echo $(SharedLibraryImplibNameTemplate); \ }; fn endef define ParseNameSpec set $$namespec ; \ if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi endef # MakeCXXSharedLibrary- Build shared library # Expect shell variable: # namespec = # extralibs = # # e.g. namespec="COS 3 0 0" --> shared library libCOS3.so.0.0 # extralibs="$(OMNIORB_LIB)" # define MakeCXXSharedLibrary $(ParseNameSpec); \ soname=$(SharedLibrarySoNameTemplate); \ set -x; \ $(RM) $@; \ $(CXX) $(SharedLibraryPlatformLinkFlagsTemplate) -o $@ \ $(IMPORT_LIBRARY_FLAGS) $(filter-out $(LibSuffixPattern),$^) $$extralibs; endef # ExportSharedLibrary- export sharedlibrary # Expect shell variable: # namespec = # e.g. namespec = "COS 3 0 0" --> shared library libCOS3.so.0.0 # define ExportSharedLibraryToDir $(ExportLibraryToDir); \ $(ParseNameSpec); \ soname=$(SharedLibrarySoNameTemplate); \ libname=$(SharedLibraryLibNameTemplate); \ set -x; \ cd $$dir; \ $(RM) $$soname; \ ln -s $(= 5 SharedLibraryPlatformLinkFlagsTemplate = -G -qmkshrobj \ -bnoipath -blibpath:/usr/lib:$(prefix)/lib endif # compiler not gcc endif # AIX ################### ifdef Darwin IMPORT_CPPFLAGS += -D__darwin__ OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10 \ -DPthreadSupportThreadPriority -DNoNanoSleep CXXOPTIONS = -fno-common -bind_at_load @EXTRA_GCC_CXXFLAGS@ SHAREDLIB_SUFFIX = dylib SharedLibraryFullNameTemplate = lib$$1$$2.$$3.$$4.$(SHAREDLIB_SUFFIX) SharedLibrarySoNameTemplate = lib$$1$$2.$$3.$(SHAREDLIB_SUFFIX) SharedLibraryLibNameTemplate = lib$$1$$2.$(SHAREDLIB_SUFFIX) SharedLibraryPlatformLinkFlagsTemplate = -dynamiclib \ -install_name $(INSTALLLIBDIR)/$$soname \ -flat_namespace \ -undefined suppress PythonLibraryPlatformLinkFlagsTemplate = -bundle -flat_namespace \ -undefined suppress \ -bind_at_load PythonSHAREDLIB_SUFFIX = so # Re-define 'ExportLibrary' to run 'ranlib' after the file is copied, # for static libraries as otherwise the linker complains: "table of # contents for archive: ???? is out of date; rerun ranlib(1) (can't # load from it)" # define ExportLibraryToDir (files="$^"; \ for file in $$files; do \ $(ExportFileToDir); \ base=`basename $$file`; \ if [ $${base%.a} != $$base ]; then (set -x; $(RANLIB) $$dir/$$base); fi; \ done; \ ) endef endif ################### ifdef FreeBSD IMPORT_CPPFLAGS += -D__freebsd__ OMNITHREAD_CPPFLAGS = -D_REENTRANT -D_THREAD_SAFE OMNITHREAD_POSIX_CPPFLAGS = -DUsePthread -DPthreadDraftVersion=10 OMNITHREAD_LIB += -pthread endif ################### ifdef NetBSD IMPORT_CPPFLAGS += -D__netbsd__ OMNITHREAD_CPPFLAGS = -D_REENTRANT OMNITHREAD_POSIX_CPPFLAGS = -DUsePthread -DPthreadDraftVersion=10 OMNITHREAD_LIB += -pthread endif ################### ifdef OpenBSD IMPORT_CPPFLAGS += -D__openbsd__ OMNITHREAD_CPPFLAGS = -D_REENTRANT -D_THREAD_SAFE OMNITHREAD_POSIX_CPPFLAGS = -DUsePthread -DPthreadDraftVersion=10 OMNITHREAD_LIB += -pthread endif ################### ifdef OSR5 IMPORT_CPPFLAGS += -D__osr5__ COPTIONS = -fpcc-struct-return OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=6 \ -DPthreadSupportThreadPriority -DNoNanoSleep endif ################### ifdef Cygwin MKDIRHIER = mkdir -p CXXLINKOPTIONS += -Wl,--enable-auto-import IMPORT_CPPFLAGS += -D__cygwin__ SHAREDLIB_CPPFLAGS = OMNITHREAD_POSIX_CPPFLAGS = -DNoNanoSleep -DPthreadDraftVersion=10 OMNITHREAD_CPPFLAGS = -D_REENTRANT OMNITHREAD_LIB += -lpthread BinPattern = %.exe SharedLibraryPlatformLinkFlagsTemplate = -shared -Wl,-soname=$$soname,--out-implib=$$implib,--export-dynamic,--enable-auto-import define ExportLibraryToDir (files="$^"; \ for file in $$files; do \ $(ExportExecutableFileToDir); \ done; \ ) endef define MakeCXXSharedLibrary $(ParseNameSpec); \ soname=$(SharedLibrarySoNameTemplate); \ implib=$(SharedLibraryImplibNameTemplate); \ set -x; \ $(RM) $@; \ $(CXX) $(SharedLibraryPlatformLinkFlagsTemplate) -o $@ \ $(IMPORT_LIBRARY_FLAGS) $(filter-out $(LibSuffixPattern),$^) $$extralibs; endef define ExportSharedLibrary dir="$(EXPORT_TREE)/$(BINDIR)"; \ $(ExportSharedLibraryToDir) endef define ExportImplibLibrary dir="$(EXPORT_TREE)/$(LIBDIR)"; \ $(ExportLibraryToDir) endef define InstallSharedLibrary dir="$(INSTALLBINDIR)"; \ $(ExportSharedLibraryToDir) endef define InstallImplibLibrary dir="$(INSTALLBINDIR)"; \ $(ExportLibraryToDir) endef SHAREDLIB_SUFFIX = dll SharedLibraryFullNameTemplate = cyg$$1$$2.$(SHAREDLIB_SUFFIX).$$3.$$4 SharedLibrarySoNameTemplate = cyg$$1$$2.$(SHAREDLIB_SUFFIX).$$3 SharedLibraryLibNameTemplate = cyg$$1$$2.$(SHAREDLIB_SUFFIX) SharedLibraryImplibNameTemplate = lib$$1$$2.dll.a endif ########################################################################### # # Processor # ifdef x86Processor IMPORT_CPPFLAGS += -D__x86__ endif ifdef x8664Processor IMPORT_CPPFLAGS += -D__x86_64__ endif ifdef SparcProcessor IMPORT_CPPFLAGS += -D__sparc__ endif ifdef AlphaProcessor IMPORT_CPPFLAGS += -D__alpha__ endif ifdef m68kProcessor IMPORT_CPPFLAGS += -D__m68k__ endif ifdef IndigoProcessor IMPORT_CPPFLAGS += -D__mips__ endif ifdef ArmProcessor IMPORT_CPPFLAGS += -D__arm__ endif ifdef s390Processor IMPORT_CPPFLAGS += -D__s390__ endif ifdef ia64Processor IMPORT_CPPFLAGS += -D__ia64__ endif ifdef HppaProcessor IMPORT_CPPFLAGS += -D__hppa__ endif ifdef PowerPCProcessor IMPORT_CPPFLAGS += -D__powerpc__ endif ########################################################################### # # Final things # lib_depend := $(patsubst %,$(LibPattern),omnithread) OMNITHREAD_LIB_DEPEND := $(GENERATE_LIB_DEPEND)