1 ########################################################################
3 # Copyright (c) 2021, PADL Software Pty Ltd.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
10 # - Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
13 # - Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in
15 # the documentation and/or other materials provided with the
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN if ADVISED OF THE
29 # POSSIBILITY OF SUCH DAMAGE.
32 !if !defined(CPU) || "$(CPU)" == ""
36 !if "$(CPU)" == "X86" || "$(CPU)" == "x86"
44 !if "$(APPVER)" == "5.0"
46 !elseif "$(APPVER)" == "5.01"
48 !elseif "$(APPVER)" == "5.02"
50 !elseif "$(APPVER)" == "6.0"
52 !elseif "$(APPVER)" == "6.1"
54 !elseif "$(APPVER)" == "10.0"
57 !error Unknown value for APPVER
64 cflags = -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -W4
66 !if "$(CPU)" == "i386"
67 cflags = $(cflags) -D_X86_=1
69 !if "$(CPU)" == "AMD64"
70 cflags = $(cflags) -D_AMD64_=1
73 cflags = $(cflags) -D_ARM_=1
75 !if "$(CPU)" == "ARM64"
76 cflags = $(cflags) -D_ARM64_=1
79 cflags = $(cflags) -DWIN32 -D_WIN32
80 !if "$(CPU)" == "AMD64" || "$(CPU)" == "ARM64"
81 cflags = $(cflags) -DWIN64 -D_WIN64
84 cflags = $(cflags) -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER)
85 cflags = $(cflags) -DNTDDI_VERSION=$(NMAKE_WINVER)0000
86 cflags = $(cflags) -D_WIN32_IE=$(NMAKE_WINVER) -DWINVER=$(NMAKE_WINVER)
91 cdebug = -Zi -Od -DDEBUG
95 cvarsdll = -D_MT -D_DLL
97 cvarsmt = $(cvarsmt) -MT
98 cvarsdll = $(cvarsdll) -MD
100 cvarsmt = $(cvarsmt) -MTd
101 cvarsdll = $(cvarsdll) -MDd
105 lflags = $(lflags) /INCREMENTAL:NO /NOLOGO
109 ldebug = /DEBUG /DEBUGTYPE:cv
112 !if "$(CPU)" == "i386"
113 dllentry = _DllMainCRTStartup@12
115 dllentry = _DllMainCRTStartup
118 conlflags = $(lflags) -subsystem:console,$(APPVER)
119 guilflags = $(lflags) -subsystem:windows,$(APPVER)
120 dlllflags = $(lflags) -entry:$(dllentry) -dll
122 baselibs = kernel32.lib ws2_32.lib mswsock.lib advapi32.lib
123 conlibs = $(baselibs)
124 conlibsmt = $(baselibs)
125 conlibsdll = $(baselibs)
127 winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
129 guilibsmt = $(winlibs)
130 guilibsdll = $(winlibs)