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

Last change on this file since 609 was 483, checked in by garnier, 17 years ago

r569@mac-90108: laurentgarnier | 2007-06-05 15:53:34 +0200
version contre geant4.8.2.p01

File size: 3.9 KB
Line 
1#
2# ------ WIN32/VC ------    Visual-C++ 7 .NET and higher
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
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
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
37
38#
39# Building DLLs (G.Barrand)
40# -------------
41#  The commands below allow to build DLLs from the archive libraries.
42#  From a libG4xxx.a, it will extract the symbols with :
43#    DOS> dumpbin /symbols libG4xxx.a > G4xxx.dumpbin
44#  After that it will produce a G4xxx.def using the 'win32def' program.
45#  The G4xxx.def file will contain the list of symbols that are "exported"
46#  or made public for using the DLLs.
47#  The source win32def.c is in the geant4/config directory. The binary is
48#  built during the library installation process, and will be placed in
49#  $G4LIB/G4SYSTEM.
50#  If can also be built as follows :
51#    DOS> cl.exe /Fowin32def.exe win32def.c
52#  Then, to use it :
53#    DOS> win32def G4xxx < G4xxx.dumpbin > G4xxx.def
54#  Libraries libG4xxx.lib can also be built with :
55#    DOS> lib /def:G4xxx.def /out:libG4xxx.lib
56#  It also produces a libG4xxx.exp used to build the DLL.
57#  The DLL can be built with :
58#    DOS> link /dll /out:G4xxx.dll libG4xxx.exp libG4xxx.a <dependencies>
59#  Note that a DLL must be fully linked. You should NOT have undefined
60#  symbols as output of the link command.
61#
62  define build-granular-shared-lib
63    @libdir=`(cd $(@D);/bin/pwd)`;\
64    cd $(G4TMP)/$(G4SYSTEM);\
65    $(ECHO) "Building $(name).dumpbin file ...";\
66    $(RM) $(name).dumpbin;\
67    dumpbin /symbols $(G4LIBDIR)/lib$(name).a > $(name).dumpbin;\
68    $(ECHO) "Building $(name).def file ...";\
69    $(RM) $(name).def;\
70    $(G4LIB)/$(G4SYSTEM)/win32def.exe $(name) < $(name).dumpbin > $(name).def;\
71    $(RM) $(name).dumpbin;\
72    $(ECHO) "Building lib$(name).exp and lib$(name).lib file ...";\
73    $(RM) $(G4LIBDIR)/lib$(name).exp;\
74    $(RM) $(G4LIBDIR)/lib$(name).lib;\
75    lib.exe /nologo /machine:ix86 /def:$(name).def \
76            /out:$(G4LIBDIR)/lib$(name).lib;\
77    $(RM) $(G4LIBDIR)/$(name).dll;\
78    $(ECHO) "Building $(name).dll file ...";\
79    link.exe /nologo /dll /out:$(G4LIBDIR)/$(name).dll \
80             $(G4LIBDIR)/lib$(name).exp $(G4LIBDIR)/lib$(name).a \
81             /libpath:$(G4LIBDIR) $(GLOBLIBS) \
82             $(LIB_PATH)$(CLHEP_LIB_DIR) $(CLHEP_LIB) \
83             $(INTYLIBS) $(ANALYSISLIBS) $(UI32LIBS)
84  endef
85  define build-global-shared-lib
86    @libdir=`(cd $(@D);/bin/pwd)`;\
87    cd $(G4TMP)/$(G4SYSTEM);\
88    $(ECHO) "Building $(name).dumpbin file ...";\
89    $(RM) $(name).dumpbin;\
90    dumpbin /symbols $(G4LIBDIR)/lib$(name).a > $(name).dumpbin;\
91    $(ECHO) "Building $(name).def file ...";\
92    $(RM) $(name).def;\
93    $(G4LIB)/$(G4SYSTEM)/win32def.exe $(name) < $(name).dumpbin > $(name).def;\
94    $(RM) $(name).dumpbin;\
95    $(ECHO) "Building lib$(name).exp and lib$(name).lib ...";\
96    $(RM) $(G4LIBDIR)/lib$(name).exp;\
97    $(RM) $(G4LIBDIR)/lib$(name).lib;\
98    lib.exe /nologo /machine:ix86 /def:$(name).def \
99            /out:$(G4LIBDIR)/lib$(name).lib;\
100    $(RM) $(G4LIBDIR)/$(name).dll;\
101    $(ECHO) "Building $(name).dll ...";\
102    link.exe /nologo /dll /out:$(G4LIBDIR)/$(name).dll \
103             $(G4LIBDIR)/lib$(name).exp $(G4LIBDIR)/lib$(name).a \
104             /libpath:$(G4LIBDIR) $(GLOBLIBS) \
105             $(LIB_PATH)$(CLHEP_LIB_DIR) $(CLHEP_LIB) \
106             $(INTYLIBS) $(ANALYSISLIBS) $(UI32LIBS)
107  endef
108endif
Note: See TracBrowser for help on using the repository browser.