forked from dcti/dnetc-client-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.bcc
295 lines (246 loc) · 10.6 KB
/
makefile.bcc
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# distributed.net client makefile for Borland C++ for Win32.
# see http://www.distributed.net/
#
# As of Jul 2000, Borland C++ 5.5.1 compiler is free for download.
# http://www.borland.com/bcppbuilder/freecompiler/
# ftp://ftpd.inprise.com/download/bcppbuilder/freecommandLinetools.exe
# ftp://ftpd.inprise.com/download/bcppbuilder/TurboDebugger.exe
#
# This makefile expects NASM (Netwide Assembler) to be in the search path.
# NASM is available at all kernel.org mirror sites under
# ftp://ftp.??.kernel.org/pub/software/devel/nasm/
# (replace ?? with a two letter country code, eg 'de', 'us', 'uk' etc)
# A list of all mirrors is at http://www.kernel.org/mirrors/
#
# $Id: makefile.bcc,v 1.39 2008/02/10 00:25:29 kakace Exp $
BASENAME = dnetc
OUTPUTPATH = output
COMMONPATH = common
RC572PATH = rc5-72
OGRPATH = ogr
CHIPSRCPATH = plat\x86
PLATSRCPATH = plat\win
#DEBUG=1
HAVE_RC5_72_CORES=1
HAVE_OGR_CORES=1
# -------------------------------------------------------------------
# Main compilation and linking options
BCC32 = "$(MAKEDIR)\bcc32.exe"
BRCC32 = "$(MAKEDIR)\brcc32.exe"
ILINK32 = "$(MAKEDIR)\ilink32.exe"
NASM32 = nasmw
UPXW = "$(MAKEDIR)\upxw.bat"
#upxw is a batchfile, eg "@i:\develop\upx\upxw.exe %1 %2 %3 %4 %5 %6 %7 %8 %9"
# -------------------------------------------------------------------
BCCWARN = -w -w! # can't do anything against the following warnings, so ignore them:
BCCWARN = $(BCCWARN) -w-8080 # "'identifier' is declared but never used"
BCCWARN = $(BCCWARN) -w-aus # "'identifier' is assigned a value that is never used" (8004)
BCCWARN = $(BCCWARN) -w-par # "Parameter 'parameter' is never used (8057)
BCCWARN = $(BCCWARN) -w-inl # "Functions containing reserved words are not expanded inline"
BCCOPTS = -q -c /a4 /Vv /x- /xd- /RT- /r /k- /d /O2 /O /OS -5 -vi -X- -P- -T- \
-tWM $(BCCWARN) -I"$(MAKEDIR)\..\include" -n$(OUTPUTPATH)
NASMOPTS = -f obj -D__OMF__
TLINKOPTS = /q /x /n /Gn /b:0x400000 /L"$(MAKEDIR)\..\lib" #/Tpe
!ifdef DEBUG
BCCOPTS = $(BCCOPTS) -y -v /DDEBUG /Tkh10000
TASMOPTS = $(TASMOPTS) /zi
TLINKOPTS = $(TLINKOPTS) -v -m -s
!endif
!ifdef BETA
BCCOPTS = $(BCCOPTS) -DBETA
!endif
MT_LIBS = noeh32.lib import32.lib cw32mt.lib
UT_LIBS = noeh32.lib import32.lib cw32.lib
DEF_FILE = $(OUTPUTPATH)\$(BASENAME).def
RES_FILE = $(OUTPUTPATH)\$(BASENAME).res
RC_FILE = $(PLATSRCPATH)\w32cons.rc
MAKE_CMD = "$(MAKEDIR)\$(MAKE)" /$(MAKEFLAGS) -fmakefile.bcc
all: $(BASENAME).com $(BASENAME).scr $(BASENAME).exe
# --------------------------------------------
COMMON_OBJS = \
$(OUTPUTPATH)/base64.obj \
$(OUTPUTPATH)/bench.obj \
$(OUTPUTPATH)/buffbase.obj \
$(OUTPUTPATH)/checkpt.obj \
$(OUTPUTPATH)/clicdata.obj \
$(OUTPUTPATH)/client.obj \
$(OUTPUTPATH)/clievent.obj \
$(OUTPUTPATH)/cliident.obj \
$(OUTPUTPATH)/clirun.obj \
$(OUTPUTPATH)/clitime.obj \
$(OUTPUTPATH)/cmdline.obj \
$(OUTPUTPATH)/confmenu.obj \
$(OUTPUTPATH)/confopt.obj \
$(OUTPUTPATH)/confrwv.obj \
$(OUTPUTPATH)/console.obj \
$(OUTPUTPATH)/coremem.obj \
$(OUTPUTPATH)/core_r72.obj \
$(OUTPUTPATH)/core_ogr.obj \
$(OUTPUTPATH)/cpucheck.obj \
$(OUTPUTPATH)/disphelp.obj \
$(OUTPUTPATH)/iniread.obj \
$(OUTPUTPATH)/logstuff.obj \
$(OUTPUTPATH)/lurk.obj \
$(OUTPUTPATH)/mail.obj \
$(OUTPUTPATH)/modereq.obj \
$(OUTPUTPATH)/netbase.obj \
$(OUTPUTPATH)/netconn.obj \
$(OUTPUTPATH)/pathwork.obj \
$(OUTPUTPATH)/pollsys.obj \
$(OUTPUTPATH)/probfill.obj \
$(OUTPUTPATH)/problem.obj \
$(OUTPUTPATH)/projdata.obj \
$(OUTPUTPATH)/probman.obj \
$(OUTPUTPATH)/random.obj \
$(OUTPUTPATH)/selcore.obj \
$(OUTPUTPATH)/selftest.obj \
$(OUTPUTPATH)/setprio.obj \
$(OUTPUTPATH)/triggers.obj \
$(OUTPUTPATH)/util.obj
BCCOPTS = $(BCCOPTS) -I$(COMMONPATH) -DLURK
!ifndef WHICHSRC
#nothing - constructed below
!elif $(WHICHSRC) == 0
COMMON_OBJS = $(COMMON_OBJS) \
$(OUTPUTPATH)/buffupd.obj \
$(OUTPUTPATH)/buffpriv.obj \
$(OUTPUTPATH)/scram.obj
!else
COMMON_OBJS = $(COMMON_OBJS) \
$(OUTPUTPATH)/buffpub.obj
!endif
PLAT_OBJS = \
$(OUTPUTPATH)/w32cons.obj \
$(OUTPUTPATH)/w32pre.obj \
$(OUTPUTPATH)/w32ras.obj \
$(OUTPUTPATH)/w32sock.obj \
$(OUTPUTPATH)/w32ss.obj \
$(OUTPUTPATH)/w32svc.obj \
$(OUTPUTPATH)/w32exe.obj \
$(OUTPUTPATH)/w32ini.obj \
$(OUTPUTPATH)/w32snapp.obj \
$(OUTPUTPATH)/w32util.obj
BCCOPTS = $(BCCOPTS) -I$(PLATSRCPATH) -DLURK
SCR_OBJS = \
$(OUTPUTPATH)/w32ss.obj \
$(OUTPUTPATH)/w32ssb.obj \
$(OUTPUTPATH)/w32exe.obj \
$(OUTPUTPATH)/w32ini.obj \
$(OUTPUTPATH)/w32util.obj
CUI_OBJS = \
$(OUTPUTPATH)/w32cuis.obj
CHIP_OBJS = $(OUTPUTPATH)/x86ident.obj \
$(OUTPUTPATH)/x86features.obj \
$(OUTPUTPATH)/x86htcount.obj
# --------------------------------- RC5-72 -------------------------
!ifndef HAVE_RC5_72_CORES
RC5_72_OBJS =
!else
RC5_72_OBJS = \
$(OUTPUTPATH)/r72-ses1.obj \
$(OUTPUTPATH)/r72-ses2.obj \
$(OUTPUTPATH)/r72-dg2.obj \
$(OUTPUTPATH)/r72-dg3.obj \
$(OUTPUTPATH)/r72-dg3a.obj \
$(OUTPUTPATH)/r72-ss2.obj \
$(OUTPUTPATH)/r72-go2.obj \
$(OUTPUTPATH)/r72-sgp3.obj
BCCOPTS = $(BCCOPTS) -DHAVE_RC5_72_CORES
!endif
# --------------------------------- OGR ----------------------------
!ifndef HAVE_OGR_CORES
OGR_OBJS =
!else
OGR_OBJS = \
$(OUTPUTPATH)/ogr-a.obj \
$(OUTPUTPATH)/ogr-b.obj \
$(OUTPUTPATH)/ogr_dat.obj \
$(OUTPUTPATH)/ogr_sup.obj
BCCOPTS = $(BCCOPTS) -DHAVE_OGR_CORES -I$(OGRPATH)
!endif
# --------------------------------------------
.autodepend
.suffixes: .asm .c .cpp # the order in which files are looked for
.path.asm = $(OGRPATH)\x86;$(RC572PATH)\x86;$(CHIPSRCPATH)
.path.cpp = $(COMMONPATH);$(OGRPATH)\x86;$(OGRPATH)\ansi;$(RC572PATH)\ansi;$(PLATSRCPATH)
.path.c = $(PLATSRCPATH)
.path.obj = $(OUTPUTPATH)
.asm.obj:
$(NASM32) $(NASMOPTS) -i $(<D:/=\) -i $(<D:/=\).. $(<:/=\) -o $(@:/=\)
.cpp.obj:
$(BCC32) $(BCCOPTS) $(<:/=\) -o$(@:/=\)
.c.obj:
$(BCC32) $(BCCOPTS) $(<:/=\) -o$(@:/=\)
# --------------------------------------------
clean:
@if exist $(OUTPUTPATH)\*.obj erase $(OUTPUTPATH)\*.obj
@if exist $(OUTPUTPATH)\*.res erase $(OUTPUTPATH)\*.res
@if exist $(OUTPUTPATH)\bltwith.* erase $(OUTPUTPATH)\bltwith.*
@if exist $(DEF_FILE) erase $(DEF_FILE)
@if exist $(RES_FILE) erase $(RES_FILE)
@if exist tdconfig.* erase tdconfig.*
@if exist td32.* erase td32.*
@if exist $(BASENAME).il? erase $(BASENAME).il?
@if exist $(BASENAME).td? erase $(BASENAME).td?
@if exist $(BASENAME).tr? erase $(BASENAME).tr?
@if exist $(BASENAME).exe erase $(BASENAME).exe
@if exist $(BASENAME).com erase $(BASENAME).com
@if exist $(BASENAME).scr erase $(BASENAME).scr
# --------------------------------------------
BCC_CHECK = $(OUTPUTPATH)/bltwith.bcc
#ensure that vc, watcom and bcc objs don't collide
$(BCC_CHECK):
@$(MAKE_CMD) clean >nul:
@echo moo > $(BCC_CHECK:/=\)
# --------------------------------------------
# Target rule to produce the compiled resource file.
$(RES_FILE): $(RC_FILE)
$(BRCC32) -32 -i$(BCCINCLUDE) -i$(COMMONPATH) -fo$(RES_FILE:/=\) $(RC_FILE:/=\)
# --------------------------------------------
### Unfortunately, the Borland C++ 5.5 initial public release does not
### include any of the include\*.rh files necessary to compile resources.
### [andreasb] Workaround: unzip plat/win/bcc55-rh.zip to bccinstallpath\include.
### The zip contains four one-line xxx.rh files including the xxx.h file.
### This is enough to compile the client's .res file. I don't know about other progs.
# --------------------------------------------
# Apparently it is necessary to supply a module definition file (*.DEF)
# for our exe, since ILINK32 says it contains "Additional segments".
$(DEF_FILE):
@if exist $(DEF_FILE:/=\) del $(DEF_FILE:/=\)
@echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(DEF_FILE:/=\)
@echo DATA PRELOAD MOVEABLE MULTIPLE >> $(DEF_FILE:/=\)
@echo HEAPSIZE 4096 >> $(DEF_FILE:/=\)
@echo STACKSIZE 1048576 >> $(DEF_FILE:/=\)
@echo SEGMENTS >> $(DEF_FILE:/=\)
@echo _TEXT >> $(DEF_FILE:/=\)
@echo _DATA >> $(DEF_FILE:/=\)
# --------------------------------------------
$(BASENAME).exe: $(BCC_CHECK) $(COMMON_OBJS) $(PLAT_OBJS) $(CHIP_OBJS) \
$(RC5_72_OBJS) $(OGR_OBJS) \
$(DEF_FILE) $(RES_FILE)
!ifndef WHICHSRC
@if exist $(COMMONPATH:/=\)\buffpriv.cpp $(MAKE_CMD) -DWHICHSRC=0
@if not exist $(COMMONPATH:/=\)\buffpriv.cpp $(MAKE_CMD) -DWHICHSRC=1
!else
$(ILINK32) $(TLINKOPTS) /aa /V3.10 c0w32.obj \
$(COMMON_OBJS:/=\) $(PLAT_OBJS:/=\) $(CHIP_OBJS:/=\) \
$(RC5_72_OBJS:/=\) $(OGR_OBJS:/=\), \
$(BASENAME:/=\).exe,,$(MT_LIBS),$(DEF_FILE:/=\),$(RES_FILE:/=\)
#actually this call to UPX doesn't work, ought to try PKLITE32 sometime
@if exist $(UPXW) \
$(UPXW) -9 -qq --compress-resources=0 $(BASENAME).exe
!endif
# the .com generated by bc is significantly larger than that created by
# watcom or vc.
$(BASENAME).com: $(BCC_CHECK) $(CUI_OBJS) #c0x32.obj
$(ILINK32) $(TLINKOPTS) /ap /V3.10 $(CUI_OBJS:/=\), \
$(BASENAME:/=\).com,,$(UT_LIBS),,
@if exist $(UPXW) \
$(UPXW) -9 -qq --compress-resources=0 $(BASENAME).com
$(BASENAME).scr: $(BCC_CHECK) $(SCR_OBJS) $(RES_FILE)
$(ILINK32) $(TLINKOPTS) /GC"SCRNSAVE : distributed.net client" \
/aa /V4.0 /Gn c0w32.obj $(SCR_OBJS:/=\), \
$(BASENAME:/=\).scr,,$(UT_LIBS),,$(RES_FILE:/=\)
@if exist $(UPXW) \
$(UPXW) -9 -qq --compress-resources=0 $(BASENAME).scr
# --------------------------------------------