1######################################################################## 2# 3# Copyright (c) 2021, PADL Software Pty Ltd. 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: 9# 10# - Redistributions of source code must retain the above copyright 11# notice, this list of conditions and the following disclaimer. 12# 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 16# distribution. 17# 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. 30# 31 32!if !defined(CPU) || "$(CPU)" == "" 33CPU =AMD64 34!endif 35 36!if "$(CPU)" == "X86" || "$(CPU)" == "x86" 37CPU =i386 38!endif 39 40!if !defined(APPVER) 41APPVER =6.1 42!endif 43 44!if "$(APPVER)" == "5.0" 45NMAKE_WINVER=0x0500 46!elseif "$(APPVER)" == "5.01" 47NMAKE_WINVER=0x0501 48!elseif "$(APPVER)" == "5.02" 49NMAKE_WINVER=0x0502 50!elseif "$(APPVER)" == "6.0" 51NMAKE_WINVER=0x0600 52!elseif "$(APPVER)" == "6.1" 53NMAKE_WINVER=0x0601 54!elseif "$(APPVER)" == "10.0" 55NMAKE_WINVER=0x0A00 56!endif 57 58cc = cl 59link = link 60implib = lib 61 62cflags = -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -W4 63 64!if "$(CPU)" == "i386" 65cflags = $(cflags) -D_X86_=1 66!endif 67!if "$(CPU)" == "AMD64" 68cflags = $(cflags) -D_AMD64_=1 69!endif 70!if "$(CPU)" == "ARM" 71cflags = $(cflags) -D_ARM_=1 72!endif 73!if "$(CPU)" == "ARM64" 74cflags = $(cflags) -D_ARM64_=1 75!endif 76 77cflags = $(cflags) -DWIN32 -D_WIN32 78!if "$(CPU)" == "AMD64" || "$(CPU)" == "ARM64" 79cflags = $(cflags) -DWIN64 -D_WIN64 80!endif 81 82cflags = $(cflags) -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER) 83cflags = $(cflags) -DNTDDI_VERSION=$(NMAKE_WINVER)0000 84cflags = $(cflags) -D_WIN32_IE=$(NMAKE_WINVER) -DWINVER=$(NMAKE_WINVER) 85 86!ifdef NODEBUG 87cdebug = -Ox -DNDEBUG 88!else 89cdebug = -Zi -Od -DDEBUG 90!endif 91 92cvarsmt = -D_MT 93cvarsdll = -D_MT -D_DLL 94!ifdef NODEBUG 95cvarsmt = $(cvarsmt) -MTd 96cvarsdll = $(cvarsdll) -MDd 97!else 98cvarsmt = $(cvarsmt) -MT 99cvarsdll = $(cvarsdll) -MD 100!endif 101cvars = $(cvarsmt) 102 103lflags = $(lflags) /INCREMENTAL:NO /NOLOGO 104!ifdef NODEBUG 105ldebug = /RELEASE 106!else 107ldebug = /DEBUG /DEBUGTYPE:cv 108!endif 109 110!if "$(CPU)" == "i386" 111dllentry = _DllMainCRTStartup@12 112!else 113dllentry = _DllMainCRTStartup 114!endif 115 116conlflags = $(lflags) -subsystem:console,$(APPVER) 117guilflags = $(lflags) -subsystem:windows,$(APPVER) 118dlllflags = $(lflags) -entry:$(dllentry) -dll 119 120baselibs = kernel32.lib ws2_32.lib mswsock.lib advapi32.lib 121conlibs = $(baselibs) 122conlibsmt = $(baselibs) 123conlibsdll = $(baselibs) 124 125winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib 126guilibs = $(winlibs) 127guilibsmt = $(winlibs) 128guilibsdll = $(winlibs) 129