[472] | 1 | # |
---|
[483] | 2 | # ------ WIN32/VC ------ Visual-C++ 7 .NET and higher |
---|
[472] | 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 |
---|
[921] | 16 | LDFLAGS += -FORCE /NODEFAULTLIB:MSVCRT.dll /VERBOSE:lib |
---|
[472] | 17 | |
---|
| 18 | SHEXT := dll |
---|
| 19 | AR := LIB |
---|
[483] | 20 | ECHO := /usr/bin/echo -e |
---|
[921] | 21 | FIND := /usr/bin/find |
---|
| 22 | SORT := /usr/bin/sort |
---|
[483] | 23 | GREP := /usr/bin/grep |
---|
| 24 | SED := /usr/bin/sed |
---|
| 25 | CAT := /usr/bin/cat |
---|
| 26 | CUT := /usr/bin/cut |
---|
[921] | 27 | TOUCH := /usr/bin/touch |
---|
[483] | 28 | |
---|
[472] | 29 | FC := g77 |
---|
| 30 | # FCLIBS := -lf2c |
---|
| 31 | ifndef OGLFLAGS |
---|
| 32 | OGLFLAGS := |
---|
| 33 | endif |
---|
| 34 | ifndef OGLLIBS |
---|
| 35 | OGLLIBS := glu32.lib opengl32.lib |
---|
| 36 | endif |
---|
| 37 | ifndef UI32LIBS |
---|
| 38 | UI32LIBS := gdi32.lib user32.lib |
---|
| 39 | endif |
---|
[679] | 40 | ifndef QTHOME |
---|
[758] | 41 | QTHOME := /usr |
---|
[679] | 42 | endif |
---|
| 43 | ifndef QTFLAGS |
---|
| 44 | QTFLAGS := -I$(QTHOME)/include/Qt -I$(QTHOME)/include |
---|
| 45 | endif |
---|
[726] | 46 | ifndef QTMOC |
---|
[758] | 47 | QTMOC := $(QTHOME)/bin/moc |
---|
[726] | 48 | endif |
---|
[865] | 49 | |
---|
| 50 | QT_VERSION := $(shell test -f $(QTHOME)/lib/Qt3Support4.lib && echo QT4 || echo QT3) |
---|
| 51 | |
---|
[679] | 52 | ifndef QTLIBS |
---|
[865] | 53 | ifeq ($(QT_VERSION),QT3) |
---|
| 54 | QTLIBS := -L$(QTHOME)/lib -lqt-mt |
---|
| 55 | else |
---|
[868] | 56 | QTLIBS := -L$(QTHOME)/lib QtCore4.lib QtGui4.lib |
---|
[865] | 57 | endif |
---|
[790] | 58 | endif |
---|
[893] | 59 | ifndef GLQTLIBS |
---|
[865] | 60 | ifeq ($(QT_VERSION),QT3) |
---|
[921] | 61 | GLQTLIBS := -L$(QTHOME)/lib -lqt-mt |
---|
[865] | 62 | else |
---|
[921] | 63 | GLQTLIBS := -L$(QTHOME)/lib QtCore4.lib QtGui4.lib QtOpenGL4.lib |
---|
[865] | 64 | endif |
---|
[679] | 65 | endif |
---|
[472] | 66 | |
---|
| 67 | # |
---|
| 68 | # Building DLLs (G.Barrand) |
---|
| 69 | # ------------- |
---|
| 70 | # The commands below allow to build DLLs from the archive libraries. |
---|
| 71 | # From a libG4xxx.a, it will extract the symbols with : |
---|
| 72 | # DOS> dumpbin /symbols libG4xxx.a > G4xxx.dumpbin |
---|
| 73 | # After that it will produce a G4xxx.def using the 'win32def' program. |
---|
| 74 | # The G4xxx.def file will contain the list of symbols that are "exported" |
---|
| 75 | # or made public for using the DLLs. |
---|
| 76 | # The source win32def.c is in the geant4/config directory. The binary is |
---|
| 77 | # built during the library installation process, and will be placed in |
---|
| 78 | # $G4LIB/G4SYSTEM. |
---|
| 79 | # If can also be built as follows : |
---|
| 80 | # DOS> cl.exe /Fowin32def.exe win32def.c |
---|
| 81 | # Then, to use it : |
---|
| 82 | # DOS> win32def G4xxx < G4xxx.dumpbin > G4xxx.def |
---|
| 83 | # Libraries libG4xxx.lib can also be built with : |
---|
| 84 | # DOS> lib /def:G4xxx.def /out:libG4xxx.lib |
---|
| 85 | # It also produces a libG4xxx.exp used to build the DLL. |
---|
| 86 | # The DLL can be built with : |
---|
| 87 | # DOS> link /dll /out:G4xxx.dll libG4xxx.exp libG4xxx.a <dependencies> |
---|
| 88 | # Note that a DLL must be fully linked. You should NOT have undefined |
---|
| 89 | # symbols as output of the link command. |
---|
| 90 | # |
---|
| 91 | define build-granular-shared-lib |
---|
| 92 | @libdir=`(cd $(@D);/bin/pwd)`;\ |
---|
| 93 | cd $(G4TMP)/$(G4SYSTEM);\ |
---|
[483] | 94 | $(ECHO) "Building $(name).dumpbin file ...";\ |
---|
[472] | 95 | $(RM) $(name).dumpbin;\ |
---|
| 96 | dumpbin /symbols $(G4LIBDIR)/lib$(name).a > $(name).dumpbin;\ |
---|
[483] | 97 | $(ECHO) "Building $(name).def file ...";\ |
---|
[472] | 98 | $(RM) $(name).def;\ |
---|
| 99 | $(G4LIB)/$(G4SYSTEM)/win32def.exe $(name) < $(name).dumpbin > $(name).def;\ |
---|
| 100 | $(RM) $(name).dumpbin;\ |
---|
[483] | 101 | $(ECHO) "Building lib$(name).exp and lib$(name).lib file ...";\ |
---|
[472] | 102 | $(RM) $(G4LIBDIR)/lib$(name).exp;\ |
---|
| 103 | $(RM) $(G4LIBDIR)/lib$(name).lib;\ |
---|
| 104 | lib.exe /nologo /machine:ix86 /def:$(name).def \ |
---|
| 105 | /out:$(G4LIBDIR)/lib$(name).lib;\ |
---|
| 106 | $(RM) $(G4LIBDIR)/$(name).dll;\ |
---|
[483] | 107 | $(ECHO) "Building $(name).dll file ...";\ |
---|
[472] | 108 | link.exe /nologo /dll /out:$(G4LIBDIR)/$(name).dll \ |
---|
| 109 | $(G4LIBDIR)/lib$(name).exp $(G4LIBDIR)/lib$(name).a \ |
---|
| 110 | /libpath:$(G4LIBDIR) $(GLOBLIBS) \ |
---|
| 111 | $(LIB_PATH)$(CLHEP_LIB_DIR) $(CLHEP_LIB) \ |
---|
[689] | 112 | $(INTYLIBS) $(GDMLLIBS) $(ANALYSISLIBS) $(UI32LIBS) |
---|
[472] | 113 | endef |
---|
| 114 | define build-global-shared-lib |
---|
| 115 | @libdir=`(cd $(@D);/bin/pwd)`;\ |
---|
| 116 | cd $(G4TMP)/$(G4SYSTEM);\ |
---|
[483] | 117 | $(ECHO) "Building $(name).dumpbin file ...";\ |
---|
[472] | 118 | $(RM) $(name).dumpbin;\ |
---|
| 119 | dumpbin /symbols $(G4LIBDIR)/lib$(name).a > $(name).dumpbin;\ |
---|
[483] | 120 | $(ECHO) "Building $(name).def file ...";\ |
---|
[472] | 121 | $(RM) $(name).def;\ |
---|
| 122 | $(G4LIB)/$(G4SYSTEM)/win32def.exe $(name) < $(name).dumpbin > $(name).def;\ |
---|
| 123 | $(RM) $(name).dumpbin;\ |
---|
[483] | 124 | $(ECHO) "Building lib$(name).exp and lib$(name).lib ...";\ |
---|
[472] | 125 | $(RM) $(G4LIBDIR)/lib$(name).exp;\ |
---|
| 126 | $(RM) $(G4LIBDIR)/lib$(name).lib;\ |
---|
| 127 | lib.exe /nologo /machine:ix86 /def:$(name).def \ |
---|
| 128 | /out:$(G4LIBDIR)/lib$(name).lib;\ |
---|
| 129 | $(RM) $(G4LIBDIR)/$(name).dll;\ |
---|
[483] | 130 | $(ECHO) "Building $(name).dll ...";\ |
---|
[472] | 131 | link.exe /nologo /dll /out:$(G4LIBDIR)/$(name).dll \ |
---|
| 132 | $(G4LIBDIR)/lib$(name).exp $(G4LIBDIR)/lib$(name).a \ |
---|
| 133 | /libpath:$(G4LIBDIR) $(GLOBLIBS) \ |
---|
| 134 | $(LIB_PATH)$(CLHEP_LIB_DIR) $(CLHEP_LIB) \ |
---|
[689] | 135 | $(INTYLIBS) $(GDMLLIBS) $(ANALYSISLIBS) $(UI32LIBS) |
---|
[472] | 136 | endef |
---|
| 137 | endif |
---|