source: trunk/config/sys/WIN32-VC.gmk @ 868

Last change on this file since 868 was 868, checked in by garnier, 16 years ago

see history

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