-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathOWWinDll.mak
85 lines (63 loc) · 1.75 KB
/
OWWinDll.mak
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
# this makefile in OW WMake style creates JWASM.DLL (Win32)
# tools used:
# - Open Watcom v1.8/v1.9
name = JWasm
# Open Watcom root directory
!ifndef WATCOM
WATCOM = \Watcom
!endif
!ifndef DEBUG
DEBUG=0
!endif
!ifndef OUTD
!if $(DEBUG)
OUTD=build\OWWinDllD
!else
OUTD=build\OWWinDll
!endif
!endif
# calling convention for compiler: s=Stack, r=register
# r will create a slightly smaller binary
CCV=r
inc_dirs = -Isrc\H -I$(WATCOM)\H
LINK = $(WATCOM)\binnt\wlink.exe
#cflags stuff
#########
extra_c_flags =
!if $(DEBUG)
extra_c_flags += -od -d2 -w3 -DDEBUG_OUT
!else
extra_c_flags += -ox -s -DNDEBUG
!endif
#########
LOPT = op quiet
!if $(DEBUG)
# for OW v1.8, the debug version needs user32.lib to resolve CharUpperA()
# without it, WD(W) will crash immediately.
LOPTD = debug dwarf op symfile lib user32.lib
!endif
lflagsw = $(LOPTD) format windows pe dll $(LOPT) op map=$^*, offset=0x5000000 export AssembleModule='_AssembleModule@4', ParseCmdline='_ParseCmdline@8', CmdlineFini='_CmdlineFini@0'
CC=$(WATCOM)\binnt\wcc386 -q -3$(CCV) -bd -zc -bt=nt $(inc_dirs) $(extra_c_flags) -fo$@
{src}.c{$(OUTD)}.obj:
$(CC) $<
proj_obj = &
!include owmod.inc
ALL: $(OUTD) $(OUTD)/$(name).dll
$(OUTD):
@if not exist $(OUTD) mkdir $(OUTD)
$(OUTD)/$(name).dll: $(proj_obj)
$(LINK) @<<
$(lflagsw) file { $(proj_obj) } name $@
Libpath $(WATCOM)\lib386
Libpath $(WATCOM)\lib386\nt
Library kernel32, user32
<<
$(OUTD)/msgtext.obj: src\msgtext.c src\H/msgdef.h src\H/usage.h src\H/globals.h
$(CC) src\msgtext.c
$(OUTD)/reswords.obj: src\reswords.c src\H/instruct.h src\H/special.h src\H/directve.h
$(CC) src\reswords.c
######
clean:
@erase $(OUTD)\*.dll
@erase $(OUTD)\*.obj
@erase $(OUTD)\*.map