[472] | 1 | # |
---|
| 2 | # ------ WIN32/VC ------ Visual-C++ 7 .NET |
---|
| 3 | # |
---|
| 4 | ifeq ($(G4SYSTEM),WIN32-VC) |
---|
| 5 | CXX := CL |
---|
| 6 | ifdef G4OPTIMISE |
---|
| 7 | CXXFLAGS += -Ox |
---|
| 8 | else |
---|
| 9 | ifdef G4DEBUG |
---|
| 10 | CXXFLAGS += -Od -Zi -Fd$(G4LIBDIR)/lib$(name) |
---|
| 11 | endif |
---|
| 12 | endif |
---|
| 13 | CXXFLAGS += -MD -GR -EHsc -Zm200 -nologo |
---|
| 14 | CXXFLAGS += -D_CONSOLE -D_WIN32 -DOS |
---|
| 15 | CPPFLAGS += -DWIN32 -DXPNET -D_CRT_SECURE_NO_DEPRECATE |
---|
| 16 | LDFLAGS += -FORCE /NODEFAULTLIB:MSVCRT.dll |
---|
| 17 | |
---|
| 18 | SHEXT := dll |
---|
| 19 | AR := LIB |
---|
| 20 | ECHO := echo -e |
---|
| 21 | FC := g77 |
---|
| 22 | # FCLIBS := -lf2c |
---|
| 23 | ifndef OGLFLAGS |
---|
| 24 | OGLFLAGS := |
---|
| 25 | endif |
---|
| 26 | ifndef OGLLIBS |
---|
| 27 | OGLLIBS := glu32.lib opengl32.lib |
---|
| 28 | endif |
---|
| 29 | ifndef UI32LIBS |
---|
| 30 | UI32LIBS := gdi32.lib user32.lib |
---|
| 31 | endif |
---|
| 32 | |
---|
| 33 | # |
---|
| 34 | # Building DLLs (G.Barrand) |
---|
| 35 | # ------------- |
---|
| 36 | # The commands below allow to build DLLs from the archive libraries. |
---|
| 37 | # From a libG4xxx.a, it will extract the symbols with : |
---|
| 38 | # DOS> dumpbin /symbols libG4xxx.a > G4xxx.dumpbin |
---|
| 39 | # After that it will produce a G4xxx.def using the 'win32def' program. |
---|
| 40 | # The G4xxx.def file will contain the list of symbols that are "exported" |
---|
| 41 | # or made public for using the DLLs. |
---|
| 42 | # The source win32def.c is in the geant4/config directory. The binary is |
---|
| 43 | # built during the library installation process, and will be placed in |
---|
| 44 | # $G4LIB/G4SYSTEM. |
---|
| 45 | # If can also be built as follows : |
---|
| 46 | # DOS> cl.exe /Fowin32def.exe win32def.c |
---|
| 47 | # Then, to use it : |
---|
| 48 | # DOS> win32def G4xxx < G4xxx.dumpbin > G4xxx.def |
---|
| 49 | # Libraries libG4xxx.lib can also be built with : |
---|
| 50 | # DOS> lib /def:G4xxx.def /out:libG4xxx.lib |
---|
| 51 | # It also produces a libG4xxx.exp used to build the DLL. |
---|
| 52 | # The DLL can be built with : |
---|
| 53 | # DOS> link /dll /out:G4xxx.dll libG4xxx.exp libG4xxx.a <dependencies> |
---|
| 54 | # Note that a DLL must be fully linked. You should NOT have undefined |
---|
| 55 | # symbols as output of the link command. |
---|
| 56 | # |
---|
| 57 | define build-granular-shared-lib |
---|
| 58 | @libdir=`(cd $(@D);/bin/pwd)`;\ |
---|
| 59 | cd $(G4TMP)/$(G4SYSTEM);\ |
---|
| 60 | echo "Building $(name).dumpbin file ...";\ |
---|
| 61 | $(RM) $(name).dumpbin;\ |
---|
| 62 | dumpbin /symbols $(G4LIBDIR)/lib$(name).a > $(name).dumpbin;\ |
---|
| 63 | echo "Building $(name).def file ...";\ |
---|
| 64 | $(RM) $(name).def;\ |
---|
| 65 | $(G4LIB)/$(G4SYSTEM)/win32def.exe $(name) < $(name).dumpbin > $(name).def;\ |
---|
| 66 | $(RM) $(name).dumpbin;\ |
---|
| 67 | echo "Building lib$(name).exp and lib$(name).lib file ...";\ |
---|
| 68 | $(RM) $(G4LIBDIR)/lib$(name).exp;\ |
---|
| 69 | $(RM) $(G4LIBDIR)/lib$(name).lib;\ |
---|
| 70 | lib.exe /nologo /machine:ix86 /def:$(name).def \ |
---|
| 71 | /out:$(G4LIBDIR)/lib$(name).lib;\ |
---|
| 72 | $(RM) $(G4LIBDIR)/$(name).dll;\ |
---|
| 73 | echo "Building $(name).dll file ...";\ |
---|
| 74 | link.exe /nologo /dll /out:$(G4LIBDIR)/$(name).dll \ |
---|
| 75 | $(G4LIBDIR)/lib$(name).exp $(G4LIBDIR)/lib$(name).a \ |
---|
| 76 | /libpath:$(G4LIBDIR) $(GLOBLIBS) \ |
---|
| 77 | $(LIB_PATH)$(CLHEP_LIB_DIR) $(CLHEP_LIB) \ |
---|
| 78 | $(INTYLIBS) $(ANALYSISLIBS) $(UI32LIBS) |
---|
| 79 | endef |
---|
| 80 | define build-global-shared-lib |
---|
| 81 | @libdir=`(cd $(@D);/bin/pwd)`;\ |
---|
| 82 | cd $(G4TMP)/$(G4SYSTEM);\ |
---|
| 83 | echo "Building $(name).dumpbin file ...";\ |
---|
| 84 | $(RM) $(name).dumpbin;\ |
---|
| 85 | dumpbin /symbols $(G4LIBDIR)/lib$(name).a > $(name).dumpbin;\ |
---|
| 86 | echo "Building $(name).def file ...";\ |
---|
| 87 | $(RM) $(name).def;\ |
---|
| 88 | $(G4LIB)/$(G4SYSTEM)/win32def.exe $(name) < $(name).dumpbin > $(name).def;\ |
---|
| 89 | $(RM) $(name).dumpbin;\ |
---|
| 90 | echo "Building lib$(name).exp and lib$(name).lib ...";\ |
---|
| 91 | $(RM) $(G4LIBDIR)/lib$(name).exp;\ |
---|
| 92 | $(RM) $(G4LIBDIR)/lib$(name).lib;\ |
---|
| 93 | lib.exe /nologo /machine:ix86 /def:$(name).def \ |
---|
| 94 | /out:$(G4LIBDIR)/lib$(name).lib;\ |
---|
| 95 | $(RM) $(G4LIBDIR)/$(name).dll;\ |
---|
| 96 | echo "Building $(name).dll ...";\ |
---|
| 97 | link.exe /nologo /dll /out:$(G4LIBDIR)/$(name).dll \ |
---|
| 98 | $(G4LIBDIR)/lib$(name).exp $(G4LIBDIR)/lib$(name).a \ |
---|
| 99 | /libpath:$(G4LIBDIR) $(GLOBLIBS) \ |
---|
| 100 | $(LIB_PATH)$(CLHEP_LIB_DIR) $(CLHEP_LIB) \ |
---|
| 101 | $(INTYLIBS) $(ANALYSISLIBS) $(UI32LIBS) |
---|
| 102 | endef |
---|
| 103 | endif |
---|