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

Last change on this file since 797 was 790, checked in by garnier, 18 years ago

r818@wl-72126: garnier | 2008-04-30 12:42:00 +0200
modif mise a jour sur le cvs

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