-
Notifications
You must be signed in to change notification settings - Fork 8
/
VCmakefile
140 lines (113 loc) · 4.3 KB
/
VCmakefile
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
# Makefile to build bayon using Microsoft Visual C++
#
# This file is under development, doesn't work.
#================================================================
# Setting variables
#================================================================
# VC++ directory
VCPATH = C:\Program Files\Microsoft Visual Studio 9.0\VC
PSDKPATH = C:\Program Files\Microsoft Platform SDK
# User options
YOUR_CLFLAGS =
YOUR_LIBFLAGS =
YOUR_LINKFLAGS=
# Configurations
!IF "$(CFG)" == "ld"
!MESSAGE Build using static debug configuration
BASE_FLAGS = /MLd /W3 /ZI /Od /FD /GZ /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\"
BASE_DEFS = /D_DEBUG /D__DEBUG__
OUTDIR = .\tmp_ld
LIB_APPEND = _ld
EXE_APPEND = _ld
!ELSEIF "$(CFG)" == "l"
!MESSAGE Build using static release configuration
BASE_DEFS = /DNDEBUG
BASE_FLAGS = /ML /W3 /O2 /FD /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\"
OUTDIR = .\tmp_l
LIB_APPEND = _l
EXE_APPEND = _l
!ELSEIF "$(CFG)" == "td"
!MESSAGE Build using static threaded debug configuration
BASE_FLAGS = /MTd /W3 /ZI /Od /FD /GZ /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\"
BASE_DEFS = /D_DEBUG /D__DEBUG__
OUTDIR = .\tmp_td
LIB_APPEND = _td
EXE_APPEND = _td
!ELSEIF "$(CFG)" == "t"
!MESSAGE Build using static threaded release configuration
BASE_DEFS = /DNDEBUG
BASE_FLAGS = /MT /W3 /O2 /FD /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\"
OUTDIR = .\tmp_t
LIB_APPEND = _t
EXE_APPEND = _t
!ELSEIF "$(CFG)" == "dd"
!MESSAGE Build using dynamic threaded debug configuration
BASE_FLAGS = /MDd /W3 /ZI /Od /FD /GZ /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\"
BASE_DEFS = /D_DEBUG /D__DEBUG__
OUTDIR = .\tmp_dd
LIB_APPEND = _dd
EXE_APPEND = _dd
!ELSE
!MESSAGE Build using dynamic threaded release configuration
BASE_DEFS = /DNDEBUG
BASE_FLAGS = /MD /W3 /O2 /FD /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\"
OUTDIR = .\tmp
LIB_APPEND =
EXE_APPEND =
!ENDIF
# Building binaries
CLFLAGS = /I "$(VCPATH)\Include" /I "$(PSDKPATH)\Include" /I "." /nologo $(YOUR_CLFLAGS) $(BASE_FLAGS) $(BASE_DEFS) /D_CRT_SECURE_NO_DEPRECATE=1
LIBFLAGS = /libpath:"$(VCPATH)\lib" /libpath:"$(PSDKPATH)\lib" /libpath:"." /nologo $(YOUR_LIBFLAGS)
LINKFLAGS = /libpath:"$(VCPATH)\lib" /libpath:"$(PSDKPATH)\lib" /libpath:"." /nologo $(YOUR_LINKFLAGS)
# Targets
MYLIBS = bayon$(LIB_APPEND).dll bayon$(LIB_APPEND).lib bayon$(LIB_APPEND)_static.lib
LIBOBJS = $(OUTDIR)\byvector.obj $(OUTDIR)\classifier.obj $(OUTDIR)\cluster.obj $(OUTDIR)\util.obj
MYBINS = bayon$(EXE_APPEND).exe
#================================================================
# Suffix rules
#================================================================
.SUFFIXES :
.SUFFIXES : .cc .obj
.cc{$(OUTDIR)}.obj :
cl /c $(CLFLAGS) $<
.cc.obj:
cl /c $(CLFLAGS) $<
#================================================================
# Actions
#================================================================
all : $(OUTDIR) $(MYLIBS) $(MYBINS)
allcfg:
nmake /NOLOGO /f VCmakefile CFG=ld
nmake /NOLOGO /f VCmakefile CFG=l
nmake /NOLOGO /f VCmakefile CFG=td
nmake /NOLOGO /f VCmakefile CFG=t
nmake /NOLOGO /f VCmakefile CFG=dd
nmake /NOLOGO /f VCmakefile
clean :
-rd tmp_ld /S /Q > NUL: 2>&1
-rd tmp_l /S /Q > NUL: 2>&1
-rd tmp_td /S /Q > NUL: 2>&1
-rd tmp_t /S /Q > NUL: 2>&1
-rd tmp_dd /S /Q > NUL: 2>&1
-rd tmp /S /Q > NUL: 2>&1
-del *.obj *.lib *.dll *.exp *.exe casket /F /Q > NUL: 2>&1
"$(OUTDIR)" :
if not exist "$(OUTDIR)/" mkdir "$(OUTDIR)"
#================================================================
# Building binaries
#================================================================
#bayon$(LIB_APPEND).dll : $(LIBOBJS) bayon.def
bayon$(LIB_APPEND).dll : $(LIBOBJS)
link /DLL $(LINKFLAGS) /OUT:$@ /IMPLIB:bayon$(LIB_APPEND).lib $(LIBOBJS)
# link /DLL /DEF:qdbm.def $(LINKFLAGS) /OUT:$@ /IMPLIB:qdbm$(LIB_APPEND).lib $(LIBOBJS)
bayon$(LIB_APPEND).lib : bayon$(LIB_APPEND).dll
bayon$(LIB_APPEND)_static.lib : $(LIBOBJS)
lib $(LIBFLAGS) /OUT:$@ $(LIBOBJS)
bayon$(EXE_APPEND).exe : $(OUTDIR)\bayon.obj bayon$(LIB_APPEND).lib
link $(LINKFLAGS) /OUT:$@ $(OUTDIR)\bayon.obj bayon$(LIB_APPEND).lib
$(OUTDIR)\bayon.obj : byvector.h classifier.h cluster.h util.h
$(OUTDIR)\byvector.obj : byvector.h util.h
$(OUTDIR)\classifier.obj : byvector.h classifier.h util.h
$(OUTDIR)\cluster.obj : cluster.h util.h
$(OUTDIR)\util.obj : util.h
# END OF FILE