-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
481 lines (337 loc) · 21.2 KB
/
Makefile
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# cat/type
CAT=$(if $(filter $(OS),Windows_NT),type,cat)
# move/mv
#MV=$(if $(filter $(OS),Windows_NT),cmd /C move /Y,mv -f)
MV=mv
RUNPATH=$(if $(filter $(OS),Windows_NT),.\,./)
NULLOUT=$(if $(filter $(OS),Windows_NT),NUL,/dev/null)
CP ?= cp
GIT ?= git
GIT_IS := $(shell $(GIT) rev-parse --is-inside-work-tree 2> $(NULLOUT))
ifeq ($(GIT_IS),true)
VERSION_PATCH := $(shell $(GIT) rev-list --count main)
endif
SUFIX=
ifeq ($(filter $(OS),Windows_NT),Windows_NT)
SUFIX=.exe
HOST_SUFIX=.exe
endif
CPP = cpp
CC ?= gcc
STRIP ?= strip
FASM ?= fasm
ifdef RELEASE
CFLAGS ?= -std=gnu99 -g0 -static -Os -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -fdata-sections -ffunction-sections
else
CFLAGS ?= -std=gnu99 -g -Wall -Wextra -Wno-unused-parameter -Wno-unused-function
endif
CFLAGS := $(CFLAGS) -I./mspack -I./system -I./pe -I./nocrt
HOST_CC ?= $(CC)
HOST_CFLAGS ?= $(CFLAGS)
HOST_LDFLAGS ?= $(LDFLAGS)
GUEST_CC ?= $(CC)
GUEST_CFLAGS ?= $(CFLAGS)
GUEST_LDFLAGS ?= $(LDFLAGS)
WINDRES ?= windres
HOST_WINDRES ?= $(WINDRES)
GUEST_WINDRES ?= $(WINDRES)
OUTNAME=patcher9x$(SUFIX)
OBJS_GUEST :=
ifdef PROFILE
ifeq ($(PROFILE),djgpp)
GUEST_CC := i586-pc-msdosdjgpp-gcc
SUFIX := .exe
STRIP := i586-pc-msdosdjgpp-strip
OUTNAME := patch9x$(SUFIX)
endif
ifeq ($(PROFILE),nocrt)
GUEST_LDFLAGS += -nostdlib -nodefaultlibs -lgcc -lkernel32 -luser32
GUEST_CFLAGS += -DNOCRT -DNOCRT_FLOAT -DNOCRT_MEM -DNOCRT_FILE -ffreestanding -march=pentium2
OBJS_GUEST += nocrt/nocrt.g.o nocrt/nocrt_exe.g.o nocrt/nocrt_file_win.g.o nocrt/nocrt_math.g.o nocrt/nocrt_mem_win.g.o
endif
ifeq ($(PROFILE),nocrt64)
GUEST_LDFLAGS += -nostdlib -nodefaultlibs -lgcc -lkernel32 -luser32
GUEST_CFLAGS += -DNOCRT -DNOCRT_FLOAT -DNOCRT_MEM -DNOCRT_FILE -ffreestanding
OBJS_GUEST += nocrt/nocrt.g.o nocrt/nocrt_exe.g.o nocrt/nocrt_file_win.g.o nocrt/nocrt_math.g.o nocrt/nocrt_mem_win.g.o
RES_FLAGS += --target=pe-x86-64
endif
endif
ifdef VERSION_PATCH
HOST_CFLAGS += -DPATCHER9X_PATCH=$(VERSION_PATCH)
GUEST_CFLAGS += -DPATCHER9X_PATCH=$(VERSION_PATCH)
RES_FLAGS += -DPATCHER9X_PATCH=$(VERSION_PATCH)
endif
DEPS_HOST=Makefile system/bitstream.h version.h
DEPS_GUEST=Makefile system/bitstream.h version.h
OBJS_GUEST +=mspack/cabc.g.o mspack/cabd.g.o mspack/crc32.g.o mspack/hlpc.g.o mspack/hlpd.g.o mspack/chmc.g.o mspack/chmd.g.o mspack/kwajc.g.o mspack/kwajd.g.o mspack/litc.g.o \
mspack/litd.g.o mspack/lzssd.g.o mspack/lzxc.g.o mspack/lzxd.g.o mspack/mszipc.g.o mspack/mszipd.g.o mspack/oabc.g.o mspack/oabd.g.o mspack/qtmd.g.o mspack/system.g.o \
mspack/szddc.g.o mspack/szddd.g.o system/filesystem.g.o system/bpatcher.g.o pe/pew.g.o pe/ds_compress.g.o pe/ds_decompress.g.o pwin32.g.o
OBJS_OUT=$(OBJS_GUEST) unpacker.g.o patch.g.o trace.g.o patcher9x.g.o cputest.g.o files.g.o batch.g.o
OBJS_HOST=system/bpatcher.h.o
OBJS_MAKEPATCH = vmm/makepatch.h.o
OBJS_MAKEDIFF = vmm/makediff.h.o
ifeq ($(filter $(OS),Windows_NT),Windows_NT)
OBJS_MAKEPATCH += vmm/makepatch.h.res
OBJS_MAKEDIFF += vmm/makediff.h.res
OBJS_OUT += patcher9x.g.res
endif
TESTS=test_bitstream$(SUFIX) test_pe$(SUFIX) test_pe2$(SUFIX) test_ds$(SUFIX) test_ds_compress$(SUFIX) test_w3$(SUFIX) test_patch$(SUFIX) test_ds2$(SUFIX)
all: $(OUTNAME)
tests: $(TESTS)
.PHONY: all tests clean fasmdiff
%.g.o: %.c $(DEPS_GUEST)
$(GUEST_CC) $(GUEST_CFLAGS) -c -o $@ $<
%.h.o: %.c $(DEPS_HOST)
$(HOST_CC) $(HOST_CFLAGS) -c -o $@ $<
%.h.res: %.rc
$(HOST_WINDRES) $(RES_FLAGS) --input $< --output $@ --output-format=coff
%.g.res: %.rc
$(GUEST_WINDRES) $(RES_FLAGS) --input $< --output $@ --output-format=coff
%.h: %.h.tmp
$(CP) $< $@
%.bin: %.asm.gen
$(FASM) $< $@
$(OUTNAME): $(OBJS_OUT) $(EXTRA_DEPS)
$(GUEST_CC) $(GUEST_CFLAGS) -o $(OUTNAME) $(OBJS_OUT) $(GUEST_LDFLAGS)
strip: $(OUTNAME)
$(STRIP) -s $(OUTNAME)
test_bitstream$(SUFIX): $(OBJS_GUEST) test/test_bitstream.g.o
$(GUEST_CC) $(GUEST_CFLAGS) -o test_bitstream$(SUFIX) $(OBJS_GUEST) test/test_bitstream.g.o $(GUEST_LDFLAGS)
test_pe$(SUFIX): $(OBJS_GUEST) test/test_pe.g.o
$(GUEST_CC) $(GUEST_CFLAGS) -o test_pe$(SUFIX) $(OBJS_GUEST) test/test_pe.g.o $(GUEST_LDFLAGS)
test_pe2$(SUFIX): $(OBJS_GUEST) test/test_pe2.g.o
$(GUEST_CC) $(GUEST_CFLAGS) -o test_pe2$(SUFIX) $(OBJS_GUEST) test/test_pe2.g.o $(GUEST_LDFLAGS)
test_w3$(SUFIX): $(OBJS_GUEST) test/test_w3.g.o
$(GUEST_CC) $(GUEST_CFLAGS) -o test_w3$(SUFIX) $(OBJS_GUEST) test/test_w3.g.o $(GUEST_LDFLAGS)
test_ds$(SUFIX): $(OBJS_GUEST) test/test_ds.g.o
$(GUEST_CC) $(GUEST_CFLAGS) -o test_ds$(SUFIX) $(OBJS_GUEST) test/test_ds.g.o $(GUEST_LDFLAGS)
test_ds2$(SUFIX): $(OBJS_GUEST) test/test_ds2.g.o
$(GUEST_CC) $(GUEST_CFLAGS) -o test_ds2$(SUFIX) $(OBJS_GUEST) test/test_ds2.g.o $(GUEST_LDFLAGS)
test_ds_compress$(SUFIX): $(OBJS_GUEST) test/test_ds_compress.g.o
$(GUEST_CC) $(GUEST_CFLAGS) -o test_ds_compress$(SUFIX) $(OBJS_GUEST) test/test_ds_compress.g.o $(GUEST_LDFLAGS)
test_patch$(SUFIX): $(OBJS_GUEST) test/test_patch.g.o
$(GUEST_CC) $(GUEST_CFLAGS) -o test_patch$(SUFIX) $(OBJS_GUEST) test/test_patch.g.o $(GUEST_LDFLAGS)
########## patcher .h generators
makepatch$(HOST_SUFIX): $(OBJS_HOST) $(OBJS_MAKEPATCH)
$(HOST_CC) $(HOST_CFLAGS) -o $@ $^ $(HOST_LDFLAGS)
makediff$(HOST_SUFIX): $(OBJS_HOST) $(OBJS_MAKEDIFF)
$(HOST_CC) $(HOST_CFLAGS) -o $@ $^ $(HOST_LDFLAGS)
########## VMM patch (SE only)
vmm/patched.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Dvmmbugfix1 $< -o $@
vmm/original.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Doriginalcode $< -o $@
vmm/reloc.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dnofuncrelocate $< -o $@
# Version 2
vmm/patched_v2.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Dvmmbugfix1 -Dversion_2 $< -o $@
vmm/original_v2.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_2 $< -o $@
vmm/reloc_v2.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dnofuncrelocate -Dversion_2 $< -o $@
########## VMM patch (ME all)
vmm/patchedme.asm.gen: vmm/FlushMappedCacheBlockMe.asm
$(CPP) -nostdinc -E -P -Dvmmbugfix2 $< -o $@
vmm/originalme.asm.gen: vmm/FlushMappedCacheBlockMe.asm
$(CPP) -nostdinc -E -P -Doriginalcode $< -o $@
vmm/relocme.asm.gen: vmm/FlushMappedCacheBlockMe.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate $< -o $@
########## update old versions of patch (SE only)
vmm/original_old.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P $< -o $@
vmm/reloc_old.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Drelocate -Dnofuncrelocate $< -o $@
vmm/original_old_v2.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Dversion_2 $< -o $@
vmm/reloc_old_v2.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Drelocate -Dversion_2 -Dnofuncrelocate $< -o $@
########## VMM patch (simpler version: 98 ALL)
vmm/patched_simple.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P $< -o $@
vmm/original_simple.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Doriginalcode $< -o $@
vmm/reloc_simple.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate $< -o $@
# Version 2
vmm/patched_simple_v2.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Dversion_2 $< -o $@
vmm/original_simple_v2.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_2 $< -o $@
vmm/reloc_simple_v2.asm.gen: vmm/FlushMappedCacheBlock.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_2 $< -o $@
########## headers VMM
# V1 (SE)
vmm_patch.h.tmp: vmm/patched.bin vmm/original.bin vmm/reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) 98 vmm_patch 1040 448 592 > $@
# V2 (SE)
vmm_patch_v2.h.tmp: vmm/patched_v2.bin vmm/original_v2.bin vmm/reloc_v2.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) 98v2 vmm_patch_v2 1052 448 604 > $@
# ME (2 parts)
vmm_patch_me1.h.tmp: vmm/patchedme.bin vmm/originalme.bin vmm/relocme.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) me vmm_patch_me1 16320 12 461 > $@
vmm_patch_me2.h.tmp: vmm/patchedme.bin vmm/originalme.bin vmm/relocme.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) me vmm_patch_me2 16320 16160 160 > $@
vmm/fasmdiff.h.tmp: vmm/original.bin vmm/dump.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) fasmdiff vmm/dump.bin vmm/original.bin > $@
vmm/fasmdiff_v2.h.tmp: vmm/original_v2.bin vmm/dump_v2.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) fasmdiff_v2 vmm/dump_v2.bin vmm/original_v2.bin > $@
vmm/fasmdiff_me.h.tmp: vmm/originalme.bin vmm/dumpme.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) fasmdiff_me vmm/dumpme.bin vmm/originalme.bin 0x1D8 0x3F20 > $@
vmm/fasmdiff_old.h.tmp: vmm/original_old.bin vmm/dump_old.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) fasmdiff_old vmm/dump_old.bin vmm/original_old.bin > $@
vmm/fasmdiff_old_v2.h.tmp: vmm/original_old_v2.bin vmm/dump_old_v2.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) fasmdiff_old_v2 vmm/dump_old_v2.bin vmm/original_old_v2.bin > $@
vmm_patch_old.h.tmp: vmm/patched.bin vmm/original_old.bin vmm/reloc_old.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) 98_old vmm_patch_old 1040 448 592 > $@
vmm_patch_old_v2.h.tmp: vmm/patched_v2.bin vmm/original_old_v2.bin vmm/reloc_old_v2.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) 98_old_v2 vmm_patch_old_v2 1052 448 604 > $@
vmm_patch_simple.h.tmp: vmm/patched_simple.bin vmm/original_simple.bin vmm/reloc_simple.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) 98_simple vmm_patch_simple 1040 448 592 > $@
vmm_patch_simple_v2.h.tmp: vmm/patched_simple_v2.bin vmm/original_simple_v2.bin vmm/reloc_simple_v2.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) 98_simple_v2 vmm_patch_simple_v2 1052 448 604 > $@
# cpu speed V1
cpuspeed/speed_v1.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v1.asm
$(CPP) -nostdinc -E -P -Dversion_1 cpuspeed/speed_v1.asm -o $@
cpuspeed/speed_v1_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v1.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_1 cpuspeed/speed_v1.asm -o $@
cpuspeed/speed_v1_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v1.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_1 cpuspeed/speed_v1.asm -o $@
cpuspeed/speed_v1_diff.h.tmp: cpuspeed/speed_v1_dump.bin cpuspeed/speed_v1_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speed_v1_diff cpuspeed/speed_v1_dump.bin cpuspeed/speed_v1_orig.bin > $@
cpuspeed_patch_v1.h.tmp: cpuspeed/speed_v1.bin cpuspeed/speed_v1_orig.bin cpuspeed/speed_v1_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speed_v1 cpuspeed_patch_v1 53 0 53 > $@
# cpu speed V2
cpuspeed/speed_v2.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v1.asm
$(CPP) -nostdinc -E -P -Dversion_2 cpuspeed/speed_v1.asm -o $@
cpuspeed/speed_v2_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v1.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_2 cpuspeed/speed_v1.asm -o $@
cpuspeed/speed_v2_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v1.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_2 cpuspeed/speed_v1.asm -o $@
cpuspeed/speed_v2_diff.h.tmp: cpuspeed/speed_v2_dump.bin cpuspeed/speed_v2_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speed_v2_diff cpuspeed/speed_v2_dump.bin cpuspeed/speed_v2_orig.bin > $@
cpuspeed_patch_v2.h.tmp: cpuspeed/speed_v2.bin cpuspeed/speed_v2_orig.bin cpuspeed/speed_v2_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speed_v2 cpuspeed_patch_v2 53 0 53 > $@
# cpu speed V4
cpuspeed/speed_v4.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v1.asm
$(CPP) -nostdinc -E -P -Dversion_4 cpuspeed/speed_v1.asm -o $@
cpuspeed/speed_v4_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v1.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_4 cpuspeed/speed_v1.asm -o $@
cpuspeed/speed_v4_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v1.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_4 cpuspeed/speed_v1.asm -o $@
cpuspeed/speed_v4_diff.h.tmp: cpuspeed/speed_v4_dump.bin cpuspeed/speed_v4_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speed_v4_diff cpuspeed/speed_v4_dump.bin cpuspeed/speed_v4_orig.bin > $@
cpuspeed_patch_v4.h.tmp: cpuspeed/speed_v4.bin cpuspeed/speed_v4_orig.bin cpuspeed/speed_v4_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speed_v4 cpuspeed_patch_v4 53 0 53 > $@
# cpu speed V3
cpuspeed/speed_v3.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v3.asm
$(CPP) -nostdinc -E -P -Dversion_3 cpuspeed/speed_v3.asm -o $@
cpuspeed/speed_v3_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v3.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_3 cpuspeed/speed_v3.asm -o $@
cpuspeed/speed_v3_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v3.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_3 cpuspeed/speed_v3.asm -o $@
cpuspeed/speed_v3_diff.h.tmp: cpuspeed/speed_v3_dump.bin cpuspeed/speed_v3_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speed_v3_diff cpuspeed/speed_v3_dump.bin cpuspeed/speed_v3_orig.bin > $@
cpuspeed_patch_v3.h.tmp: cpuspeed/speed_v3.bin cpuspeed/speed_v3_orig.bin cpuspeed/speed_v3_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speed_v3 cpuspeed_patch_v3 44 0 44 > $@
# cpu speed V5
cpuspeed/speed_v5.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v5.asm
$(CPP) -nostdinc -E -P -Dversion_5 cpuspeed/speed_v5.asm -o $@
cpuspeed/speed_v5_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v5.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_5 cpuspeed/speed_v5.asm -o $@
cpuspeed/speed_v5_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v5.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_5 cpuspeed/speed_v5.asm -o $@
cpuspeed/speed_v5_diff.h.tmp: cpuspeed/speed_v5_dump.bin cpuspeed/speed_v5_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speed_v5_diff cpuspeed/speed_v5_dump.bin cpuspeed/speed_v5_orig.bin > $@
cpuspeed_patch_v5.h.tmp: cpuspeed/speed_v5.bin cpuspeed/speed_v5_orig.bin cpuspeed/speed_v5_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speed_v5 cpuspeed_patch_v5 69 0 69 > $@
# cpu speed V6
cpuspeed/speed_v6.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v5.asm
$(CPP) -nostdinc -E -P -Dversion_6 cpuspeed/speed_v5.asm -o $@
cpuspeed/speed_v6_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v5.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_6 cpuspeed/speed_v5.asm -o $@
cpuspeed/speed_v6_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v5.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_6 cpuspeed/speed_v5.asm -o $@
cpuspeed/speed_v6_diff.h.tmp: cpuspeed/speed_v6_dump.bin cpuspeed/speed_v6_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speed_v6_diff cpuspeed/speed_v6_dump.bin cpuspeed/speed_v6_orig.bin > $@
cpuspeed_patch_v6.h.tmp: cpuspeed/speed_v6.bin cpuspeed/speed_v6_orig.bin cpuspeed/speed_v6_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speed_v6 cpuspeed_patch_v6 69 0 69 > $@
# cpu speed V7
cpuspeed/speed_v7.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v5.asm
$(CPP) -nostdinc -E -P -Dversion_7 cpuspeed/speed_v5.asm -o $@
cpuspeed/speed_v7_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v5.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_7 cpuspeed/speed_v5.asm -o $@
cpuspeed/speed_v7_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v5.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_7 cpuspeed/speed_v5.asm -o $@
cpuspeed/speed_v7_diff.h.tmp: cpuspeed/speed_v7_dump.bin cpuspeed/speed_v7_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speed_v7_diff cpuspeed/speed_v7_dump.bin cpuspeed/speed_v7_orig.bin > $@
cpuspeed_patch_v7.h.tmp: cpuspeed/speed_v7.bin cpuspeed/speed_v7_orig.bin cpuspeed/speed_v7_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speed_v7 cpuspeed_patch_v7 69 0 69 > $@
# cpu speed V8
cpuspeed/speed_v8.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v8.asm
$(CPP) -nostdinc -E -P -Dversion_8 cpuspeed/speed_v8.asm -o $@
cpuspeed/speed_v8_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v8.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_8 cpuspeed/speed_v8.asm -o $@
cpuspeed/speed_v8_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speed_v8.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_8 cpuspeed/speed_v8.asm -o $@
cpuspeed/speed_v8_diff.h.tmp: cpuspeed/speed_v8_dump.bin cpuspeed/speed_v8_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speed_v8_diff cpuspeed/speed_v8_dump.bin cpuspeed/speed_v8_orig.bin > $@
cpuspeed_patch_v8.h.tmp: cpuspeed/speed_v8.bin cpuspeed/speed_v8_orig.bin cpuspeed/speed_v8_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speed_v8 cpuspeed_patch_v8 60 0 60 > $@
# cpu speed NDIS.VXD V1
cpuspeed/speedndis_v1.asm.gen: cpuspeed/speed.inc cpuspeed/speedndis_v1.asm
$(CPP) -nostdinc -E -P -Dversion_1 cpuspeed/speedndis_v1.asm -o $@
cpuspeed/speedndis_v1_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speedndis_v1.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_1 cpuspeed/speedndis_v1.asm -o $@
cpuspeed/speedndis_v1_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speedndis_v1.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_1 cpuspeed/speedndis_v1.asm -o $@
cpuspeed/speedndis_v1_diff.h.tmp: cpuspeed/speedndis_v1_dump.bin cpuspeed/speedndis_v1_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speedndis_v1_diff cpuspeed/speedndis_v1_dump.bin cpuspeed/speedndis_v1_orig.bin > $@
cpuspeed_ndis_patch_v1.h.tmp: cpuspeed/speedndis_v1.bin cpuspeed/speedndis_v1_orig.bin cpuspeed/speedndis_v1_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speedndis_v1 cpuspeed_ndis_patch_v1 112 0 112 > $@
# cpu speed NDIS.VXD V3
cpuspeed/speedndis_v3.asm.gen: cpuspeed/speed.inc cpuspeed/speedndis_v1.asm
$(CPP) -nostdinc -E -P -Dversion_3 cpuspeed/speedndis_v1.asm -o $@
cpuspeed/speedndis_v3_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speedndis_v1.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_3 cpuspeed/speedndis_v1.asm -o $@
cpuspeed/speedndis_v3_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speedndis_v1.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_3 cpuspeed/speedndis_v1.asm -o $@
cpuspeed/speedndis_v3_diff.h.tmp: cpuspeed/speedndis_v3_dump.bin cpuspeed/speedndis_v3_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speedndis_v3_diff cpuspeed/speedndis_v3_dump.bin cpuspeed/speedndis_v3_orig.bin > $@
cpuspeed_ndis_patch_v3.h.tmp: cpuspeed/speedndis_v3.bin cpuspeed/speedndis_v3_orig.bin cpuspeed/speedndis_v3_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speedndis_v3 cpuspeed_ndis_patch_v3 112 0 112 > $@
# cpu speed NDIS.VXD V2
cpuspeed/speedndis_v2.asm.gen: cpuspeed/speed.inc cpuspeed/speedndis_v2.asm
$(CPP) -nostdinc -E -P -Dversion_2 cpuspeed/speedndis_v2.asm -o $@
cpuspeed/speedndis_v2_orig.asm.gen: cpuspeed/speed.inc cpuspeed/speedndis_v2.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Dversion_2 cpuspeed/speedndis_v2.asm -o $@
cpuspeed/speedndis_v2_reloc.asm.gen: cpuspeed/speed.inc cpuspeed/speedndis_v2.asm
$(CPP) -nostdinc -E -P -Doriginalcode -Drelocate -Dversion_2 cpuspeed/speedndis_v2.asm -o $@
cpuspeed/speedndis_v2_diff.h.tmp: cpuspeed/speedndis_v2_dump.bin cpuspeed/speedndis_v2_orig.bin makediff$(HOST_SUFIX)
$(RUNPATH)makediff$(HOST_SUFIX) speedndis_v2_diff cpuspeed/speedndis_v2_dump.bin cpuspeed/speedndis_v2_orig.bin > $@
cpuspeed_ndis_patch_v2.h.tmp: cpuspeed/speedndis_v2.bin cpuspeed/speedndis_v2_orig.bin cpuspeed/speedndis_v2_reloc.bin makepatch$(HOST_SUFIX)
$(RUNPATH)makepatch$(HOST_SUFIX) speedndis_v2 cpuspeed_ndis_patch_v2 128 0 128 > $@
patch.g.o: vmm_patch.h vmm_patch_v2.h vmm_patch_me1.h vmm_patch_me2.h cpuspeed_ndis_patch_v1.h cpuspeed_ndis_patch_v2.h cpuspeed_ndis_patch_v3.h \
cpuspeed_patch_v1.h cpuspeed_patch_v2.h cpuspeed_patch_v3.h cpuspeed_patch_v4.h cpuspeed_patch_v5.h cpuspeed_patch_v6.h cpuspeed_patch_v7.h cpuspeed_patch_v8.h \
vmm_patch_old.h vmm_patch_old_v2.h vmm_patch_simple.h vmm_patch_simple_v2.h
fasmdiff: vmm/fasmdiff.h vmm/fasmdiff_v2.h vmm/fasmdiff_me.h \
cpuspeed/speed_v1_diff.h cpuspeed/speed_v2_diff.h cpuspeed/speed_v3_diff.h cpuspeed/speed_v4_diff.h \
cpuspeed/speedndis_v1_diff.h cpuspeed/speedndis_v2_diff.h cpuspeed/speedndis_v3_diff.h \
cpuspeed/speed_v5_diff.h cpuspeed/speed_v6_diff.h cpuspeed/speed_v7_diff.h cpuspeed/speed_v8_diff.h \
vmm/fasmdiff_old.h vmm/fasmdiff_old_v2.h
clean:
-$(RM) $(OBJS_OUT)
-$(RM) $(OBJS_HOST)
-$(RM) $(OBJS_MAKEPATCH)
-$(RM) $(OBJS_MAKEDIFF)
-$(RM) *.tmp
-$(RM) *.res
-cd vmm && $(RM) *.gen
-cd vmm && $(RM) *.tmp
-cd vmm && $(RM) *.res
-cd cpuspeed && $(RM) *.gen
-cd cpuspeed && $(RM) *.tmp
-$(RM) $(OUTNAME)
-$(RM) makepatch$(HOST_SUFIX)
-$(RM) makediff$(HOST_SUFIX)
-$(RM) $(TESTS)