forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.win32
155 lines (130 loc) · 5.32 KB
/
Makefile.win32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
!if "$(CFG)" == ""
!if ([findstr /c:"--build=debug" $(ROOTSYS)\bin\root-config > nul ] == 0)
CFG = Win32 Debug
!if ([findstr /c:"--disable-winrtdebug" $(ROOTSYS)\bin\root-config > nul ] == 0)
RUNTIME = Release
!else
RUNTIME = Debug
!endif
!message No configuration specified: Defaulting to Win32 Debug
!message With $(RUNTIME) Runtime DLL (Taken from ROOT config).
!message .
!else
CFG = Win32 Release
RUNTIME = Release
!message No configuration specified: Defaulting to Win32 Release
!message With $(RUNTIME) Runtime DLL (Taken from ROOT config).
!message .
!endif
!else
!if "$(CFG)" == "Win32 Release"
RUNTIME = Release
!elseif "$(CFG)" == "Win32 Debug"
RUNTIME = Debug
!endif
!endif
!if "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug"
!message Invalid configuration "$(CFG)" specified.
!message You can specify a configuration when running NMAKE
!message by defining the macro CFG on the command line. For example:
!message
!message NMAKE /f "Makefile.msc" CFG="Win32 Debug"
!message
!message Possible choices for configuration are:
!message
!message "Win32 Release" (based on "Win32 (x86) Dynamic Library")
!message "Win32 Debug" (based on "Win32 (x86) Dynamic Library")
!message
!error An invalid configuration is specified.
!endif
ObjSuf = obj
SrcSuf = cxx
ExeSuf = .exe
DllSuf = dll
OutPutOpt = -out:
# Win32 system with Microsoft Visual C/C++
!include <win32.mak>
CC = $(cc)
CXX = $(cc)
CXXFLAGS = -nologo -EHsc -GR -DWIN32 -W3 -D_WINDOWS \
-DVISUAL_CPLUSPLUS -I$(ROOTSYS)/include \
-wd4244 -FIw32pragma.h
LD = $(link)
!if "$(CFG)" == "Win32 Release"
CXXOPT = -O2 -arch:SSE2 -MD
LDOPT = -opt:ref
!elseif "$(CFG)" == "Win32 Debug"
!if "$(RUNTIME)" == "Debug"
CXXOPT = -Z7 -MDd
!else
CXXOPT = -Z7 -O2 -arch:SSE2 -MD
!endif
LDOPT = -debug
!endif
# Check if nmake version is 8.xx or 9.xx
!if ([nmake /? 2>&1 | findstr /c:"Version 8\." > nul ] == 0) || \
([nmake /? 2>&1 | findstr /c:"Version 9\." > nul ] == 0)
MT_EXE = mt -nologo -manifest [email protected] -outputresource:$@;1
MT_DLL = mt -nologo -manifest [email protected] -outputresource:$@;2
EXTRAFLAGS = -D_CRT_SECURE_NO_DEPRECATE
!else if ([nmake /? 2>&1 | findstr /c:"Version 10\." > nul ] == 0)
EXTRAFLAGS = -D_CRT_SECURE_NO_DEPRECATE
!else
MT_EXE =
MT_DLL =
EXTRAFLAGS = -G5
!endif
LDFLAGS = $(LDOPT) $(conlflags) -nologo -include:_G__cpp_setupG__Hist \
-include:_G__cpp_setupG__Graf -include:_G__cpp_setupG__G3D \
-include:_G__cpp_setupG__GPad -include:_G__cpp_setupG__Tree \
-include:_G__cpp_setupG__Rint -include:_G__cpp_setupG__PostScript \
-include:_G__cpp_setupG__Matrix -include:_G__cpp_setupG__Physics
SOFLAGS = $(dlllflags:-pdb:none=)
ROOTLIBS = $(ROOTSYS)\lib\libCore.lib \
$(ROOTSYS)\lib\libCint.lib $(ROOTSYS)\lib\libHist.lib \
$(ROOTSYS)\lib\libGraf.lib $(ROOTSYS)\lib\libGraf3d.lib \
$(ROOTSYS)\lib\libGpad.lib $(ROOTSYS)\lib\libTree.lib \
$(ROOTSYS)\lib\libRint.lib $(ROOTSYS)\lib\libPostscript.lib \
$(ROOTSYS)\lib\libMatrix.lib $(ROOTSYS)\lib\libPhysics.lib \
$(ROOTSYS)\lib\libNet.lib $(ROOTSYS)\lib\libRIO.lib \
$(ROOTSYS)\lib\libMathCore.lib
LIBS = $(ROOTLIBS)
GLIBS = $(LIBS) $(ROOTSYS)\lib\libGui.lib $(ROOTSYS)\lib\libGraf.lib \
$(ROOTSYS)\lib\libGpad.lib
LIBSALL = $(ROOTLIBS)
EVENTLIB = libEvent.lib
#------------------------------------------------------------------------------
ROOTSHOWERS = GButtonFrame.$(SrcSuf) GTitleFrame.$(SrcSuf) MyDetector.$(SrcSuf) \
MyEvent.$(SrcSuf) MyParticle.$(SrcSuf) RootShower.$(SrcSuf) \
RSAbout.$(SrcSuf) RSHelpText.$(SrcSuf) RSMsgBox.$(SrcSuf) \
SettingsDlg.$(SrcSuf) RootShowerDict.$(SrcSuf)
ROOTSHOWERO = GButtonFrame.$(ObjSuf) GTitleFrame.$(ObjSuf) MyDetector.$(ObjSuf) \
MyEvent.$(ObjSuf) MyParticle.$(ObjSuf) RootShower.$(ObjSuf) \
RSAbout.$(ObjSuf) RSHelpText.$(ObjSuf) RSMsgBox.$(ObjSuf) \
SettingsDlg.$(ObjSuf) RootShowerDict.$(ObjSuf)
ROOTSHOWER = RootShower$(ExeSuf)
ROOTSHOWERRC = rootshower.rc
ROOTSHOWERRES = rootshower.res
OBJS = $(ROOTSHOWERO)
PROGRAMS = $(ROOTSHOWER)
#------------------------------------------------------------------------------
all: $(PROGRAMS)
$(ROOTSHOWERRES) : $(ROOTSHOWERRC)
rc -DBUILDNUMBER=0 -r -fo $(ROOTSHOWERRES) $(ROOTSHOWERRC)
$(ROOTSHOWER): $(ROOTSHOWERO) $(ROOTSHOWERRES)
$(LD) $(LDFLAGS) /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup \
$(ROOTSHOWERO) $(ROOTSHOWERRES) $(GLIBS) $(ROOTSYS)\lib\libEG.lib \
$(ROOTSYS)\lib\libHtml.lib $(ROOTSYS)\lib\libGeom.lib $(OutPutOpt)$@
$(MT_EXE)
@echo "$@ done"
RootShowerDict.$(SrcSuf): MyParticle.h MyDetector.h MyEvent.h RSLinkDef.h
@echo "Generating dictionary $@..."
$rootcling -f $@ -c MyParticle.h MyDetector.h MyEvent.h RSLinkDef.h
#------------------------------------------------------------------------------
clean:
@del *.obj *Dict.* *.def *.exp *.d *.log .def *.pdb *.ilk *.manifest
distclean: clean
@del *.exe *.root *.ps *.lib *.dll
###
.$(SrcSuf).$(ObjSuf):
$(CXX) $(CXXFLAGS) $(EXTRAFLAGS) $(CXXOPT) -c $<