# # Standard make variables and rules for all Win32 platforms. # Win32Platform = 1 MinGW32Build = 1 SORT = sort AR = ar cq CXX = g++ CXXLINK = g++ CC = gcc CLINK = gcc OMKDEPEND = $(BASE_OMNI_TREE)/$(BINDIR)/omkdepend CMAKEDEPEND = $(OMKDEPEND) -D__GNUC__ CXXMAKEDEPEND = $(OMKDEPEND) -D__cplusplus -D__GNUG__ -D__GNUC__ MKDIRHIER = mkdir -p INSTALL = install -c INSTLIBFLAGS = INSTEXEFLAGS = CP = cp MV = mv -f CDLLFLAGS= CXXDLLFLAGS= MSVC_STATICLIB_CXXNODEBUGFLAGS= MSVC_STATICLIB_CXXDEBUGFLAGS= CXXOPTIONS = -mthreads COPTIONS = -mthreads ifdef BuildDebugBinary CXXLINKOPTIONS = -g -mthreads -Wl,--enable-runtime-pseudo-reloc CXXDEBUGFLAGS = -g CLINKOPTIONS = -g -mthreads -Wl,--enable-runtime-pseudo-reloc CDEBUGFLAGS = -g else CXXLINKOPTIONS = -mthreads -Wl,--enable-runtime-pseudo-reloc CXXDEBUGFLAGS = -O2 CLINKOPTIONS = -mthreads -Wl,--enable-runtime-pseudo-reloc CDEBUGFLAGS = -O2 endif ifndef WINVER WINVER = 0x0400 endif IMPORT_CPPFLAGS += -D__WIN32__ -D_WIN32_WINNT=$(WINVER) SOCKET_LIB = -lws2_32 -lmswsock # # General rule 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%d.a DLLNoDebugPattern = lib%_rt.a DLLDebugPattern = lib%_rtd.a LibNoDebugSearchPattern = -l% LibDebugSearchPattern = -l%d DLLNoDebugSearchPattern = -l%_rt DLLDebugSearchPattern = -l%_rtd ifndef BuildDebugBinary LibPattern = $(LibNoDebugPattern) DLLPattern = $(DLLNoDebugPattern) LibSearchPattern = $(LibNoDebugSearchPattern) DLLSearchPattern = $(DLLNoDebugSearchPattern) else LibPattern = $(LibDebugPattern) DLLPattern = $(DLLDebugPattern) LibSearchPattern = $(LibDebugSearchPattern) DLLSearchPattern = $(DLLDebugSearchPattern) endif BinPattern = %.exe # # Stuff to generate statically-linked libraries. # define StaticLinkLibrary (set -x; \ $(RM) $@; \ $(AR) $@ $^; \ ) endef ifdef EXPORT_TREE define ExportLibrary (dir="$(EXPORT_TREE)/$(LIBDIR)"; \ files="$^"; \ for file in $$files; do \ $(ExportFileToDir); \ done; \ ) endef endif # # Stuff to generate executable binaries. # IMPORT_LIBRARY_FLAGS = $(patsubst %,$(LibPathPattern),$(IMPORT_LIBRARY_DIRS)) define CXXExecutable (set -x; \ $(RM) $@; \ $(CXXLINK) -o$@ $(CXXLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \ $(filter-out $(LibPattern),$^) $$libs; \ ) endef define CExecutable (set -x; \ $(RM) $@; \ $(CLINK) -o$@ $(CLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) $(filter-out $(LibPattern),$^) $$libs; \ ) endef ifdef EXPORT_TREE define ExportExecutable (dir="$(EXPORT_TREE)/$(BINDIR)"; \ files="$^"; \ for file in $$files; do \ $(ExportExecutableFileToDir); \ done; \ ) endef endif ########################################################################### # # Shared library support stuff # ifndef EmbeddedSystem BuildSharedLibrary = 1 endif SharedLibraryFullNameTemplate = lib$(SharedLibraryLibNameTemplate).a SharedLibrarySearchTemplate = -l$(SharedLibraryLibNameTemplate) SharedLibraryLibNameTemplate = $$1$$2$$3$$4_rt$${extrasuffix:-} SharedLibraryExportSymbolFileNameTemplate = $$1$$2$${extrasuffix:-}.def SharedLibraryVersionStringTemplate = $$3.$$4 SharedLibrarySymbolRefLibraryTemplate = lib$${symrefdir:-static}/$$1$$2$${extrasuffix:-}.a define SharedLibraryFullName fn() { \ if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi ; \ echo $(SharedLibraryFullNameTemplate); \ }; fn endef define SharedLibraryDebugFullName fn() { \ if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi ; \ extrasuffix="d"; \ echo $(SharedLibraryFullNameTemplate); \ }; fn endef define SharedLibrarySearch fn() { \ if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi ; \ echo $(SharedLibrarySearchTemplate); \ }; fn endef define SharedLibraryDebugSearch fn() { \ if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi ; \ extrasuffix="d"; \ echo $(SharedLibrarySearchTemplate); \ }; fn endef define ParseNameSpec set $$namespec ; \ if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi endef # MakeCXXSharedLibrary- Build shared library # Expect shell variable: # namespec = # extralibs = # debug = 1 (build debug version). # # e.g. namespec="COS 3 0 0" --> COS300_rt.dll # extralibs="$(OMNIORB_LIB)" # define MakeCXXSharedLibrary $(ParseNameSpec); \ extrasuffix=$${debug:+d}; \ targetdir=$(@D); \ libname=$(SharedLibraryLibNameTemplate); \ dllname=$$targetdir/$$libname.dll; \ defname=$$targetdir/$(SharedLibraryExportSymbolFileNameTemplate); \ version=$(SharedLibraryVersionStringTemplate); \ set -x; \ $(RM) $@; \ $(CXXLINK) -shared -mthreads -Wl,-export-all -Wl,--dll -o$$dllname \ -Wl,--out-implib,$@ -Wl,--output-def,$$defname \ -Wl,--enable-runtime-pseudo-reloc \ $$extralinkoption $(IMPORT_LIBRARY_FLAGS) \ $^ $$extralibs; endef # Export SharedLibrary # Expected shell variable: # namespec = # e.g. namespec = "COS 3 0 0" # # NT treats DLLs more like executables -- the .dll file needs to go in the # bin/x86... directory so that it's on your PATH: # define ExportSharedLibrary $(ParseNameSpec); \ extrasuffix=$${debug:+d}; \ targetdir=$(