-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMAKEFILE
More file actions
184 lines (165 loc) · 4.51 KB
/
MAKEFILE
File metadata and controls
184 lines (165 loc) · 4.51 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name = ppxfs # アプリケーション名
# nmake を用いる場合、$.→$@、$&→*に書き換え、@&&|~|ブロックの対処が必要
UseDebug = 0 # 1 なら debug 指定
!ifndef UseBCC
UseBCC = 1 # 1 なら BCC32 , 0 なら CL
!endif
!ifndef X64
X64 = 0 # 1 なら x64版(常にUNICODE版)
!else
X64 = 1
!endif
!ifndef ARM
ARM = 0 # 1 なら Arm/Arm64版(常にUNICODE版)
!endif
!ifndef UseUnicode
UseUnicode = 0 # 1 なら UNICODE版
!endif
!ifndef VCTOOLKIT
VCTOOLKIT = 0 # VC TOOL KIT を使うなら有効に、VS2008なら無効に
!endif
UseIlink = 0 # 1 なら ilink32(BCC 5.5以降) を使用
!ifdef RELEASE
CTAIL = R
UseDebug = 0
Copt = /DRELEASE
!endif
!if $(X64)
UseBCC = 0
UseUnicode = 0
TAIL = $(TAIL)64
PPXLIB = PPLIB64W
!else
TAIL =
SSEOPT = /arch:SSE2
PPXLIB = PPLIB32W
!endif
!if $(ARM)
UseBCC = 0
UseUnicode = 0
TAIL = $(TAIL)A
!endif
!if $(UseUnicode)
UnicodeCopt = -DUNICODE
!endif
#=============================================================== Borland 用設定
!if $(UseBCC)
.autodepend
!if $(UseDebug)
Copt = -R -v -vG -DDEBUG # 追加 C コンパイルオプション
DebugLopt = -v
DebugLib = CG32.LIB # 追加ライブラリ
!endif
!if $(UseTASM)
C0D = TINYC0D
C0DOBJ = TINYC0D.OBJ
!else
C0D = $(C0DLL)
!endif
#-------------------------------------- コンパイラ共通指定
cc = @BCC32 -4 -c -C -d -H -Hc -w -O -O1 -RT- -x- -DWINVER=0x400 $(bc56opt) $(Copt) $(UnicodeCopt)
#-------------------------------------- リンカ共通指定
!if $(UseIlink)
bc56opt = -Oc -q -a4
linkopt = @ilink32 -c -m -P -V4.0 -Gn -q $(DebugLopt)
!else
linkopt = @tlink32 -c -m -P -V4.0 $(DebugLopt)
!endif
C0CON = C0X32
C0GUI = C0W32
C0DLL = C0D32X
#-------------------------------------- リンカ(GUI)
linkexe = $(linkopt) -Tpe -aa
#-------------------------------------- リンカ(CONSOLE)
linkcon = $(linkopt) -Tpe -ap
#-------------------------------------- リンカ(DLL)
linkdll = $(linkopt) -Tpd -aa
#-------------------------------------- インポート
implib = @implib
#-------------------------------------- リソースコンパイラ
rc = @Brc32 -r
#-------------------------------------- 暗黙の指定
.c.obj:
$(cc) -o$@ $<
.cpp.obj:
$(cc) -o$@ $<
.rc.res:
$(rc) -fo$@ $<
#============================================================= Microsoft 用設定
!else
!if $(UseDebug)
Copt = /Od /Zi /GS #/analyze
DebugLopt = /DEBUG
!else # UseDebug
!ifdef RELEASE
Copt = /Gz /O2 /Os /Oy /DRELEASE
!else # RELEASE
Copt = /Gz /O2 /Os /Oy
!endif # RELEASE
!endif # UseDebug
!if $(X64)
X64Copt = /wd4244 /wd4267
# ↑サイズ違い警告を消す(※できるだけこの指定を使わないこと)
closeall =
!if $(VCTOOLKIT)
LINK64 = /MACHINE:AMD64
LIB64 = bufferoverflowu.lib
RC64 = /d_WIN64 /dLEGACYICON
!else # !VCTOOLKIT
!if !$(ARM)
LINK64 = /MACHINE:AMD64 /LARGEADDRESSAWARE
!else # ARM
LINK64 = /MACHINE:ARM64 /LARGEADDRESSAWARE
Copt = /O2 /Os /Oy /DRELEASE
X64Copt = /wd4244 /wd4267
!endif # ARM
RC64 = /d_WIN64
!endif # VCTOOLKIT
!else # !$(X64)
!if $(VCTOOLKIT)
RC64 = /dLEGACYICON
!endif # VCTOOLKIT
!if $(ARM)
LINK64 = /MACHINE:ARM /LARGEADDRESSAWARE
!endif # ARM
!endif # X64
#-------------------------------------- コンパイラ
cc = @"cl" /GF /nologo /c /DWINVER=0x400 $(Copt) $(UnicodeCopt) $(WineCopt) $(X64Copt) /W3 /wd4068 /wd4996
# 4068:不明な #pragma 4996:古い関数を使用した /Wp64:64bit移植性チェック
#-------------------------------------- リンカ共通指定
linkopt = @"link" /NOLOGO /INCREMENTAL:NO
C0DLL = Kernel32.Lib AdvAPI32.Lib Ole32.Lib Imm32.Lib Gdi32.Lib\
Shell32.Lib User32.Lib comctl32.lib Comdlg32.lib $(LIB64)
C0GUI = $(C0DLL)
C0CON = $(C0DLL)
#-------------------------------------- リンカ(GUI)
linkexe = $(linkopt) /SUBSYSTEM:WINDOWS
#-------------------------------------- リンカ(CONSOLE)
linkcon = $(linkopt) /SUBSYSTEM:CONSOLE
#-------------------------------------- リンカ(DLL)
linkdll = $(linkopt) /DLL
#-------------------------------------- リソースコンパイラ
rc = @%COMSPEC% /C RC /dSDKRC
#-------------------------------------- 暗黙の指定
.c.obj:
$(cc) /Fo$@ $<
.cpp.obj:
$(cc) /Fo$@ $<
.rc.res:
$(rc) $<
!endif
#------------------------------------------------------------------------------
allFiles: makefile CODE$(TAIL)$(CTAIL).OBJ $(name)$(TAIL).dll
#------------------------------------------------------ code体系切換用
CODE$(TAIL)$(CTAIL).OBJ:
-@del *.obj 2> nul
-@del *.res 2> nul
-@if exist %CSM% del %CSM%\*.CSM
@copy nul CODE$(TAIL)$(CTAIL).OBJ > nul
#------------------------------------------------------------------------------
$(name)$(TAIL).dll: $(name).obj
!if $(UseBCC)
$(linkdll) $(C0DLL) $&,$<,$*,$(DebugLib) NOEH32 IMPORT32 CW32 $(PPXLIB),PPXMDL
!else
$(linkdll) $(C0DLL) $(name).obj $(PPXLIB).lib /OUT:$&.dll /DEF:PPXMDL.def
!endif