• 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# CFLAGS = $(CFLAGS) -FAsc -Fa$O/asm/
16
17
18!IF "$(PLATFORM)" == "x64"
19MY_ML = ml64 -Dx64 -WX
20!ELSEIF "$(PLATFORM)" == "arm"
21MY_ML = armasm -WX
22!ELSE
23MY_ML = ml -WX
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!IFDEF OLD_COMPILER
34LFLAGS = $(LFLAGS) -OPT:NOWIN98
35!ENDIF
36!IF "$(PLATFORM)" != "arm" && "$(PLATFORM)" != "arm64"
37CFLAGS = $(CFLAGS) -Gr
38!ENDIF
39LIBS = $(LIBS) user32.lib advapi32.lib shell32.lib
40!ENDIF
41
42!IF "$(PLATFORM)" == "arm"
43COMPL_ASM = $(MY_ML) $** $O/$(*B).obj
44!ELSE
45COMPL_ASM = $(MY_ML) -c -Fo$O/ $**
46!ENDIF
47
48CFLAGS = $(CFLAGS) -nologo -c -Fo$O/ -W4 -WX -EHsc -Gy -GR- -GF
49
50!IFDEF MY_DYNAMIC_LINK
51CFLAGS = $(CFLAGS) -MD
52!ELSE
53!IFNDEF MY_SINGLE_THREAD
54CFLAGS = $(CFLAGS) -MT
55!ENDIF
56!ENDIF
57
58!IFNDEF OLD_COMPILER
59CFLAGS = $(CFLAGS) -GS- -Zc:forScope -Zc:wchar_t
60!IFNDEF UNDER_CE
61CFLAGS = $(CFLAGS) -MP2
62!IFNDEF PLATFORM
63# CFLAGS = $(CFLAGS) -arch:IA32
64!ENDIF
65!ENDIF
66!ELSE
67CFLAGS = $(CFLAGS)
68!ENDIF
69
70!IFNDEF UNDER_CE
71!IF "$(PLATFORM)" == "arm"
72CFLAGS = $(CFLAGS) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
73!ENDIF
74!ENDIF
75
76!IF "$(PLATFORM)" == "x64"
77CFLAGS_O1 = $(CFLAGS) -O1
78!ELSE
79CFLAGS_O1 = $(CFLAGS) -O1
80!ENDIF
81CFLAGS_O2 = $(CFLAGS) -O2
82
83LFLAGS = $(LFLAGS) -nologo -OPT:REF -OPT:ICF
84
85!IFNDEF UNDER_CE
86LFLAGS = $(LFLAGS) /LARGEADDRESSAWARE
87!ENDIF
88
89!IFDEF DEF_FILE
90LFLAGS = $(LFLAGS) -DLL -DEF:$(DEF_FILE)
91!ELSE
92!IF defined(MY_FIXED) && "$(PLATFORM)" != "arm" && "$(PLATFORM)" != "arm64"
93LFLAGS = $(LFLAGS) /FIXED
94!ELSE
95LFLAGS = $(LFLAGS) /FIXED:NO
96!ENDIF
97# /BASE:0x400000
98!ENDIF
99
100
101# !IF "$(PLATFORM)" == "x64"
102
103!IFDEF SUB_SYS_VER
104
105MY_SUB_SYS_VER=5.02
106
107!IFDEF MY_CONSOLE
108LFLAGS = $(LFLAGS) /SUBSYSTEM:console,$(MY_SUB_SYS_VER)
109!ELSE
110LFLAGS = $(LFLAGS) /SUBSYSTEM:windows,$(MY_SUB_SYS_VER)
111!ENDIF
112
113!ENDIF
114
115
116PROGPATH = $O\$(PROG)
117
118COMPL_O1   = $(CC) $(CFLAGS_O1) $**
119COMPL_O2   = $(CC) $(CFLAGS_O2) $**
120COMPL_PCH  = $(CC) $(CFLAGS_O1) -Yc"StdAfx.h" -Fp$O/a.pch $**
121COMPL      = $(CC) $(CFLAGS_O1) -Yu"StdAfx.h" -Fp$O/a.pch $**
122
123COMPLB    = $(CC) $(CFLAGS_O1) -Yu"StdAfx.h" -Fp$O/a.pch $<
124# COMPLB_O2 = $(CC) $(CFLAGS_O2) -Yu"StdAfx.h" -Fp$O/a.pch $<
125COMPLB_O2 = $(CC) $(CFLAGS_O2) $<
126
127CFLAGS_C_ALL = $(CFLAGS_O2) $(CFLAGS_C_SPEC)
128CCOMPL_PCH  = $(CC) $(CFLAGS_C_ALL) -Yc"Precomp.h" -Fp$O/a.pch $**
129CCOMPL_USE  = $(CC) $(CFLAGS_C_ALL) -Yu"Precomp.h" -Fp$O/a.pch $**
130CCOMPL      = $(CC) $(CFLAGS_C_ALL) $**
131CCOMPLB     = $(CC) $(CFLAGS_C_ALL) $<
132
133
134all: $(PROGPATH)
135
136clean:
137	-del /Q $(PROGPATH) $O\*.exe $O\*.dll $O\*.obj $O\*.lib $O\*.exp $O\*.res $O\*.pch $O\*.asm
138
139$O:
140	if not exist "$O" mkdir "$O"
141$O/asm:
142	if not exist "$O/asm" mkdir "$O/asm"
143
144$(PROGPATH): $O $O/asm $(OBJS) $(DEF_FILE)
145	link $(LFLAGS) -out:$(PROGPATH) $(OBJS) $(LIBS)
146
147!IFNDEF NO_DEFAULT_RES
148$O\resource.res: $(*B).rc
149	rc $(RFLAGS) -fo$@ $**
150!ENDIF
151$O\StdAfx.obj: $(*B).cpp
152	$(COMPL_PCH)
153