-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathMsvcDll.mak
91 lines (69 loc) · 1.83 KB
/
MsvcDll.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
86
87
88
89
90
91
# this makefile (NMake) creates the HJWasm Win32 dll with MS Visual C++.
# it has been tested with:
# - VC++ Toolkit 2003 ( = VC++ 7.1 )
name = hjwasm
# directory paths to adjust
# VCDIR - root directory for VC compiler, linker, include and lib files
# W32LIB - directory for Win32 import library files (kernel32.lib)
!ifndef VCDIR
VCDIR = \msvc71
!endif
!ifndef W32LIB
W32LIB = \wininc\lib
!endif
!ifndef DEBUG
DEBUG=0
!endif
!ifndef OUTD
!if $(DEBUG)
OUTD=MsvcDllD
!else
OUTD=MsvcDllR
!endif
!endif
inc_dirs = -IH -I"$(VCDIR)\include"
linker = $(VCDIR)\Bin\link.exe
lib = $(VCDIR)\Bin\lib.exe
!if $(DEBUG)
extra_c_flags = -Zd -Od -DDEBUG_OUT
!else
extra_c_flags = -O2 -Gs -DNDEBUG
#extra_c_flags = -Ox -DNDEBUG
!endif
c_flags =-D__NT__ -D__SW_BD $(extra_c_flags) $(c_flags64)
# if MSVC++ 2005 EE is used:
# 1. define __STDC_WANT_SECURE_LIB__=0 to avoid "deprecated" warnings
# 2. define -GS- to disable security checks
#c_flags =-D__NT__ $(extra_c_flags) -D__STDC_WANT_SECURE_LIB__=0 -GS-
#lflags stuff
#########
LOPT = /NOLOGO
!if $(DEBUG)
LOPTD = /debug
!endif
lflagsw = $(LOPTD) $(LOPT) /map:$^*.map /OPT:NOWIN98
CC=@$(VCDIR)\bin\cl.exe -c -nologo $(inc_dirs) $(c_flags)
.c{$(OUTD)}.obj:
$(CC) -Fo$* $<
proj_obj = \
!include msmod.inc
ALL: $(OUTD) $(OUTD)\$(name).dll
$(OUTD):
@mkdir $(OUTD)
$(OUTD)\$(name).dll : $(OUTD)/$(name)s.lib
$(linker) @<<
$(lflagsw) $(OUTD)/$(name)s.lib
/LIBPATH:"$(VCDIR)\Lib" /DLL "$(W32LIB)/kernel32.lib" /OUT:$@
/EXPORT:AssembleModule /EXPORT:ParseCmdline /EXPORT:CmdlineFini
<<
$(OUTD)\$(name)s.lib : $(proj_obj)
@$(lib) /out:$(OUTD)\$(name)s.lib $(proj_obj)
$(OUTD)/msgtext.obj: msgtext.c H/msgdef.h H/globals.h
$(CC) -Fo$* msgtext.c
$(OUTD)/reswords.obj: reswords.c H/instruct.h H/special.h H/directve.h
$(CC) -Fo$* reswords.c
######
clean:
@erase $(OUTD)\*.dll
@erase $(OUTD)\*.obj
@erase $(OUTD)\*.map