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

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

QT moc remove before compiling

File size: 4.3 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
[679]46  ifndef QTLIBS
[758]47    QT3LIBS   := -L$(QTHOME)/lib -lqt-mt
48    QT4LIBS   := -L$(QTHOME)/lib QtCore4.lib QtGui4.lib QtOpenGL4.lib QtSql4.lib QtXml4.lib
49    QTLIBS    := $(shell test -f $(QTHOME)/lib/Qt3Support4.lib && echo $(QT4LIBS) || echo $(QT3LIBS))
[679]50  endif
[472]51
52#
53# Building DLLs (G.Barrand)
54# -------------
55#  The commands below allow to build DLLs from the archive libraries.
56#  From a libG4xxx.a, it will extract the symbols with :
57#    DOS> dumpbin /symbols libG4xxx.a > G4xxx.dumpbin
58#  After that it will produce a G4xxx.def using the 'win32def' program.
59#  The G4xxx.def file will contain the list of symbols that are "exported"
60#  or made public for using the DLLs.
61#  The source win32def.c is in the geant4/config directory. The binary is
62#  built during the library installation process, and will be placed in
63#  $G4LIB/G4SYSTEM.
64#  If can also be built as follows :
65#    DOS> cl.exe /Fowin32def.exe win32def.c
66#  Then, to use it :
67#    DOS> win32def G4xxx < G4xxx.dumpbin > G4xxx.def
68#  Libraries libG4xxx.lib can also be built with :
69#    DOS> lib /def:G4xxx.def /out:libG4xxx.lib
70#  It also produces a libG4xxx.exp used to build the DLL.
71#  The DLL can be built with :
72#    DOS> link /dll /out:G4xxx.dll libG4xxx.exp libG4xxx.a <dependencies>
73#  Note that a DLL must be fully linked. You should NOT have undefined
74#  symbols as output of the link command.
75#
76  define build-granular-shared-lib
77    @libdir=`(cd $(@D);/bin/pwd)`;\
78    cd $(G4TMP)/$(G4SYSTEM);\
[483]79    $(ECHO) "Building $(name).dumpbin file ...";\
[472]80    $(RM) $(name).dumpbin;\
81    dumpbin /symbols $(G4LIBDIR)/lib$(name).a > $(name).dumpbin;\
[483]82    $(ECHO) "Building $(name).def file ...";\
[472]83    $(RM) $(name).def;\
84    $(G4LIB)/$(G4SYSTEM)/win32def.exe $(name) < $(name).dumpbin > $(name).def;\
85    $(RM) $(name).dumpbin;\
[483]86    $(ECHO) "Building lib$(name).exp and lib$(name).lib file ...";\
[472]87    $(RM) $(G4LIBDIR)/lib$(name).exp;\
88    $(RM) $(G4LIBDIR)/lib$(name).lib;\
89    lib.exe /nologo /machine:ix86 /def:$(name).def \
90            /out:$(G4LIBDIR)/lib$(name).lib;\
91    $(RM) $(G4LIBDIR)/$(name).dll;\
[483]92    $(ECHO) "Building $(name).dll file ...";\
[472]93    link.exe /nologo /dll /out:$(G4LIBDIR)/$(name).dll \
94             $(G4LIBDIR)/lib$(name).exp $(G4LIBDIR)/lib$(name).a \
95             /libpath:$(G4LIBDIR) $(GLOBLIBS) \
96             $(LIB_PATH)$(CLHEP_LIB_DIR) $(CLHEP_LIB) \
[689]97             $(INTYLIBS) $(GDMLLIBS) $(ANALYSISLIBS) $(UI32LIBS)
[472]98  endef
99  define build-global-shared-lib
100    @libdir=`(cd $(@D);/bin/pwd)`;\
101    cd $(G4TMP)/$(G4SYSTEM);\
[483]102    $(ECHO) "Building $(name).dumpbin file ...";\
[472]103    $(RM) $(name).dumpbin;\
104    dumpbin /symbols $(G4LIBDIR)/lib$(name).a > $(name).dumpbin;\
[483]105    $(ECHO) "Building $(name).def file ...";\
[472]106    $(RM) $(name).def;\
107    $(G4LIB)/$(G4SYSTEM)/win32def.exe $(name) < $(name).dumpbin > $(name).def;\
108    $(RM) $(name).dumpbin;\
[483]109    $(ECHO) "Building lib$(name).exp and lib$(name).lib ...";\
[472]110    $(RM) $(G4LIBDIR)/lib$(name).exp;\
111    $(RM) $(G4LIBDIR)/lib$(name).lib;\
112    lib.exe /nologo /machine:ix86 /def:$(name).def \
113            /out:$(G4LIBDIR)/lib$(name).lib;\
114    $(RM) $(G4LIBDIR)/$(name).dll;\
[483]115    $(ECHO) "Building $(name).dll ...";\
[472]116    link.exe /nologo /dll /out:$(G4LIBDIR)/$(name).dll \
117             $(G4LIBDIR)/lib$(name).exp $(G4LIBDIR)/lib$(name).a \
118             /libpath:$(G4LIBDIR) $(GLOBLIBS) \
119             $(LIB_PATH)$(CLHEP_LIB_DIR) $(CLHEP_LIB) \
[689]120             $(INTYLIBS) $(GDMLLIBS) $(ANALYSISLIBS) $(UI32LIBS)
[472]121  endef
122endif
Note: See TracBrowser for help on using the repository browser.