kdc: per-target CPPFLAGS do not have an _AM in the variable name
[heimdal.git] / windows / NTMakefile.sdk
bloba9f2b30dfdf35bebd8d4b1c148363b8a2e3b525f
1 ########################################################################
3 # Copyright (c) 2021, PADL Software Pty Ltd.
4 # All rights reserved.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
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
16 #   distribution.
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)" == ""
33 CPU         =AMD64
34 !endif
36 !if "$(CPU)" == "X86" || "$(CPU)" == "x86"
37 CPU         =i386
38 !endif
40 !if !defined(APPVER)
41 APPVER      =6.1
42 !endif
44 !if "$(APPVER)" == "5.0"
45 NMAKE_WINVER=0x0500
46 !elseif "$(APPVER)" == "5.01"
47 NMAKE_WINVER=0x0501
48 !elseif "$(APPVER)" == "5.02"
49 NMAKE_WINVER=0x0502
50 !elseif "$(APPVER)" == "6.0"
51 NMAKE_WINVER=0x0600
52 !elseif "$(APPVER)" == "6.1"
53 NMAKE_WINVER=0x0601
54 !elseif "$(APPVER)" == "10.0"
55 NMAKE_WINVER=0x0A00
56 !else
57 !error Unknown value for APPVER
58 !endif
60 cc          = cl
61 link        = link
62 implib      = lib
64 cflags      = -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -W4
66 !if "$(CPU)" == "i386"
67 cflags      = $(cflags) -D_X86_=1
68 !endif
69 !if "$(CPU)" == "AMD64"
70 cflags      = $(cflags) -D_AMD64_=1
71 !endif
72 !if "$(CPU)" == "ARM"
73 cflags      = $(cflags) -D_ARM_=1
74 !endif
75 !if "$(CPU)" == "ARM64"
76 cflags      = $(cflags) -D_ARM64_=1
77 !endif
79 cflags      = $(cflags) -DWIN32 -D_WIN32
80 !if "$(CPU)" == "AMD64" || "$(CPU)" == "ARM64"
81 cflags      = $(cflags) -DWIN64 -D_WIN64
82 !endif
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)
88 !ifdef NODEBUG
89 cdebug      = -Ox -DNDEBUG
90 !else
91 cdebug      = -Zi -Od -DDEBUG
92 !endif
94 cvarsmt     = -D_MT
95 cvarsdll    = -D_MT -D_DLL
96 !ifdef NODEBUG
97 cvarsmt     = $(cvarsmt) -MT
98 cvarsdll    = $(cvarsdll) -MD
99 !else
100 cvarsmt     = $(cvarsmt) -MTd
101 cvarsdll    = $(cvarsdll) -MDd
102 !endif
103 cvars       = $(cvarsmt)
105 lflags      = $(lflags) /INCREMENTAL:NO /NOLOGO
106 !ifdef NODEBUG
107 ldebug      = /RELEASE
108 !else
109 ldebug      = /DEBUG /DEBUGTYPE:cv
110 !endif
112 !if "$(CPU)" == "i386"
113 dllentry    = _DllMainCRTStartup@12
114 !else
115 dllentry    = _DllMainCRTStartup
116 !endif
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
128 guilibs     = $(winlibs)
129 guilibsmt   = $(winlibs)
130 guilibsdll  = $(winlibs)