• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LIBS = $(LIBS) oleaut32.lib ole32.lib
2
3!IFNDEF MY_NO_UNICODE
4CFLAGS = $(CFLAGS) -DUNICODE -D_UNICODE
5!ENDIF
6
7!IFNDEF O
8!IFDEF PLATFORM
9O=$(PLATFORM)
10!ELSE
11O=o
12!ENDIF
13!ENDIF
14
15!IF "$(CC)" != "clang-cl"
16# CFLAGS = $(CFLAGS) -FAsc -Fa$O/asm/
17!ENDIF
18
19
20!IF "$(PLATFORM)" == "x64"
21MY_ML = ml64 -WX
22#-Dx64
23!ELSEIF "$(PLATFORM)" == "arm"
24MY_ML = armasm -WX
25!ELSE
26MY_ML = ml -WX
27# -DABI_CDECL
28!ENDIF
29
30# MY_ML = "$(MY_ML) -Fl$O\asm\
31
32
33!IFDEF UNDER_CE
34RFLAGS = $(RFLAGS) -dUNDER_CE
35!IFDEF MY_CONSOLE
36LFLAGS = $(LFLAGS) /ENTRY:mainACRTStartup
37!ENDIF
38!ELSE
39!IFDEF OLD_COMPILER
40LFLAGS = $(LFLAGS) -OPT:NOWIN98
41!ENDIF
42!IF "$(PLATFORM)" != "arm" && "$(PLATFORM)" != "arm64"
43CFLAGS = $(CFLAGS) -Gr
44!ENDIF
45LIBS = $(LIBS) user32.lib advapi32.lib shell32.lib
46!ENDIF
47
48!IF "$(PLATFORM)" == "arm"
49COMPL_ASM = $(MY_ML) $** $O/$(*B).obj
50!ELSE
51COMPL_ASM = $(MY_ML) -c -Fo$O/ $**
52!ENDIF
53
54CFLAGS = $(CFLAGS) -nologo -c -Fo$O/ -W4 -WX -EHsc -Gy -GR- -GF
55
56!IF "$(CC)" == "clang-cl"
57
58CFLAGS = $(CFLAGS) \
59  -Werror \
60  -Wextra \
61  -Wall \
62  -Weverything \
63  -Wno-extra-semi-stmt \
64  -Wno-extra-semi \
65  -Wno-zero-as-null-pointer-constant \
66  -Wno-sign-conversion \
67  -Wno-old-style-cast \
68  -Wno-reserved-id-macro \
69  -Wno-deprecated-dynamic-exception-spec \
70  -Wno-language-extension-token \
71  -Wno-global-constructors \
72  -Wno-non-virtual-dtor \
73  -Wno-deprecated-copy-dtor \
74  -Wno-exit-time-destructors \
75  -Wno-switch-enum \
76  -Wno-covered-switch-default \
77  -Wno-nonportable-system-include-path \
78  -Wno-c++98-compat-pedantic \
79  -Wno-cast-qual \
80  -Wc++11-extensions \
81
82!ENDIF
83
84!IFDEF MY_DYNAMIC_LINK
85CFLAGS = $(CFLAGS) -MD
86!ELSE
87!IFNDEF MY_SINGLE_THREAD
88CFLAGS = $(CFLAGS) -MT
89!ENDIF
90!ENDIF
91
92
93CFLAGS = $(CFLAGS_COMMON) $(CFLAGS)
94
95!IFNDEF OLD_COMPILER
96CFLAGS = $(CFLAGS) -GS- -Zc:forScope -Zc:wchar_t
97!IFNDEF UNDER_CE
98!IF "$(CC)" != "clang-cl"
99CFLAGS = $(CFLAGS) -MP4
100!ENDIF
101!IFNDEF PLATFORM
102# CFLAGS = $(CFLAGS) -arch:IA32
103!ENDIF
104!ENDIF
105!ELSE
106CFLAGS = $(CFLAGS)
107!ENDIF
108
109!IFDEF MY_CONSOLE
110CFLAGS = $(CFLAGS) -D_CONSOLE
111!ENDIF
112
113!IFNDEF UNDER_CE
114!IF "$(PLATFORM)" == "arm"
115CFLAGS = $(CFLAGS) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
116!ENDIF
117!ENDIF
118
119!IF "$(PLATFORM)" == "x64"
120CFLAGS_O1 = $(CFLAGS) -O1
121!ELSE
122CFLAGS_O1 = $(CFLAGS) -O1
123!ENDIF
124CFLAGS_O2 = $(CFLAGS) -O2
125
126LFLAGS = $(LFLAGS) -nologo -OPT:REF -OPT:ICF
127
128!IFNDEF UNDER_CE
129LFLAGS = $(LFLAGS) /LARGEADDRESSAWARE
130!ENDIF
131
132!IFDEF DEF_FILE
133LFLAGS = $(LFLAGS) -DLL -DEF:$(DEF_FILE)
134!ELSE
135!IF defined(MY_FIXED) && "$(PLATFORM)" != "arm" && "$(PLATFORM)" != "arm64"
136LFLAGS = $(LFLAGS) /FIXED
137!ELSE
138LFLAGS = $(LFLAGS) /FIXED:NO
139!ENDIF
140# /BASE:0x400000
141!ENDIF
142
143
144# !IF "$(PLATFORM)" == "x64"
145
146!IFDEF SUB_SYS_VER
147
148MY_SUB_SYS_VER=5.02
149
150!IFDEF MY_CONSOLE
151LFLAGS = $(LFLAGS) /SUBSYSTEM:console,$(MY_SUB_SYS_VER)
152!ELSE
153LFLAGS = $(LFLAGS) /SUBSYSTEM:windows,$(MY_SUB_SYS_VER)
154!ENDIF
155
156!ENDIF
157
158
159PROGPATH = $O\$(PROG)
160
161COMPL_O1   = $(CC) $(CFLAGS_O1) $**
162COMPL_O2   = $(CC) $(CFLAGS_O2) $**
163COMPL_PCH  = $(CC) $(CFLAGS_O1) -Yc"StdAfx.h" -Fp$O/a.pch $**
164COMPL      = $(CC) $(CFLAGS_O1) -Yu"StdAfx.h" -Fp$O/a.pch $**
165
166COMPLB    = $(CC) $(CFLAGS_O1) -Yu"StdAfx.h" -Fp$O/a.pch $<
167# COMPLB_O2 = $(CC) $(CFLAGS_O2) -Yu"StdAfx.h" -Fp$O/a.pch $<
168COMPLB_O2 = $(CC) $(CFLAGS_O2) $<
169
170CFLAGS_C_ALL = $(CFLAGS_O2) $(CFLAGS_C_SPEC)
171CCOMPL_PCH  = $(CC) $(CFLAGS_C_ALL) -Yc"Precomp.h" -Fp$O/a.pch $**
172CCOMPL_USE  = $(CC) $(CFLAGS_C_ALL) -Yu"Precomp.h" -Fp$O/a.pch $**
173CCOMPL      = $(CC) $(CFLAGS_C_ALL) $**
174CCOMPLB     = $(CC) $(CFLAGS_C_ALL) $<
175
176!IF "$(CC)" == "clang-cl"
177COMPL  = $(COMPL) -FI StdAfx.h
178COMPLB = $(COMPLB) -FI StdAfx.h
179CCOMPL_USE = $(CCOMPL_USE) -FI Precomp.h
180!ENDIF
181
182all: $(PROGPATH)
183
184clean:
185	-del /Q $(PROGPATH) $O\*.exe $O\*.dll $O\*.obj $O\*.lib $O\*.exp $O\*.res $O\*.pch $O\*.asm
186
187$O:
188	if not exist "$O" mkdir "$O"
189$O/asm:
190	if not exist "$O/asm" mkdir "$O/asm"
191
192$(PROGPATH): $O $O/asm $(OBJS) $(DEF_FILE)
193	link $(LFLAGS) -out:$(PROGPATH) $(OBJS) $(LIBS)
194
195!IFNDEF NO_DEFAULT_RES
196$O\resource.res: $(*B).rc
197	rc $(RFLAGS) -fo$@ $**
198!ENDIF
199$O\StdAfx.obj: $(*B).cpp
200	$(COMPL_PCH)
201