1LIBS = $(LIBS) oleaut32.lib ole32.lib
2
3!IFDEF CPU
4!IFNDEF NO_BUFFEROVERFLOWU
5LIBS = $(LIBS) bufferoverflowU.lib
6!ENDIF
7!ENDIF
8
9
10!IFNDEF O
11!IFDEF CPU
12O=$(CPU)
13!ELSE
14O=O
15!ENDIF
16!ENDIF
17
18!IF "$(CPU)" == "AMD64"
19MY_ML = ml64 -Dx64
20!ELSEIF "$(CPU)" == "ARM"
21MY_ML = armasm
22!ELSE
23MY_ML = ml
24!ENDIF
25
26
27!IFDEF UNDER_CE
28RFLAGS = $(RFLAGS) -dUNDER_CE
29!IFDEF MY_CONSOLE
30LFLAGS = $(LFLAGS) /ENTRY:mainACRTStartup
31!ENDIF
32!ELSE
33!IFNDEF NEW_COMPILER
34LFLAGS = $(LFLAGS) -OPT:NOWIN98
35!ENDIF
36CFLAGS = $(CFLAGS) -Gr
37LIBS = $(LIBS) user32.lib advapi32.lib shell32.lib
38!ENDIF
39
40!IF "$(CPU)" == "ARM"
41COMPL_ASM = $(MY_ML) $** $O/$(*B).obj
42!ELSE
43COMPL_ASM = $(MY_ML) -c -Fo$O/ $**
44!ENDIF
45
46CFLAGS = $(CFLAGS) -nologo -c -Fo$O/ -WX -EHsc -Gy -GR-
47
48!IFDEF MY_STATIC_LINK
49!IFNDEF MY_SINGLE_THREAD
50CFLAGS = $(CFLAGS) -MT
51!ENDIF
52!ELSE
53CFLAGS = $(CFLAGS) -MD
54!ENDIF
55
56!IFDEF NEW_COMPILER
57CFLAGS = $(CFLAGS) -W4 -GS- -Zc:forScope
58!ELSE
59CFLAGS = $(CFLAGS) -W3
60!ENDIF
61
62CFLAGS_O1 = $(CFLAGS) -O1
63CFLAGS_O2 = $(CFLAGS) -O2
64
65LFLAGS = $(LFLAGS) -nologo -OPT:REF -OPT:ICF
66
67!IFDEF DEF_FILE
68LFLAGS = $(LFLAGS) -DLL -DEF:$(DEF_FILE)
69!ENDIF
70
71PROGPATH = $O\$(PROG)
72
73COMPL_O1   = $(CC) $(CFLAGS_O1) $**
74COMPL_O2   = $(CC) $(CFLAGS_O2) $**
75COMPL_PCH  = $(CC) $(CFLAGS_O1) -Yc"StdAfx.h" -Fp$O/a.pch $**
76COMPL      = $(CC) $(CFLAGS_O1) -Yu"StdAfx.h" -Fp$O/a.pch $**
77
78all: $(PROGPATH)
79
80clean:
81	-del /Q $(PROGPATH) $O\*.exe $O\*.dll $O\*.obj $O\*.lib $O\*.exp $O\*.res $O\*.pch
82
83$O:
84	if not exist "$O" mkdir "$O"
85
86$(PROGPATH): $O $(OBJS) $(DEF_FILE)
87	link $(LFLAGS) -out:$(PROGPATH) $(OBJS) $(LIBS)
88
89!IFNDEF NO_DEFAULT_RES
90$O\resource.res: $(*B).rc
91	rc $(RFLAGS) -fo$@ $**
92!ENDIF
93$O\StdAfx.obj: $(*B).cpp
94	$(COMPL_PCH)
95