Home | History | Annotate | Line # | Download | only in windows
      1  1.1  christos ########################################################################
      2  1.1  christos #
      3  1.1  christos # Copyright (c) 2021, PADL Software Pty Ltd.
      4  1.1  christos # All rights reserved.
      5  1.1  christos #
      6  1.1  christos # Redistribution and use in source and binary forms, with or without
      7  1.1  christos # modification, are permitted provided that the following conditions
      8  1.1  christos # are met:
      9  1.1  christos #
     10  1.1  christos # - Redistributions of source code must retain the above copyright
     11  1.1  christos #   notice, this list of conditions and the following disclaimer.
     12  1.1  christos #
     13  1.1  christos # - Redistributions in binary form must reproduce the above copyright
     14  1.1  christos #   notice, this list of conditions and the following disclaimer in
     15  1.1  christos #   the documentation and/or other materials provided with the
     16  1.1  christos #   distribution.
     17  1.1  christos #
     18  1.1  christos # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     19  1.1  christos # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     20  1.1  christos # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     21  1.1  christos # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
     22  1.1  christos # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
     23  1.1  christos # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     24  1.1  christos # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     25  1.1  christos # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     26  1.1  christos # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     27  1.1  christos # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     28  1.1  christos # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN if ADVISED OF THE
     29  1.1  christos # POSSIBILITY OF SUCH DAMAGE.
     30  1.1  christos #
     31  1.1  christos 
     32  1.1  christos !if !defined(CPU) || "$(CPU)" == ""
     33  1.1  christos CPU         =AMD64
     34  1.1  christos !endif
     35  1.1  christos 
     36  1.1  christos !if "$(CPU)" == "X86" || "$(CPU)" == "x86"
     37  1.1  christos CPU         =i386
     38  1.1  christos !endif
     39  1.1  christos 
     40  1.1  christos !if !defined(APPVER)
     41  1.1  christos APPVER      =6.1
     42  1.1  christos !endif
     43  1.1  christos 
     44  1.1  christos !if "$(APPVER)" == "5.0"
     45  1.1  christos NMAKE_WINVER=0x0500
     46  1.1  christos !elseif "$(APPVER)" == "5.01"
     47  1.1  christos NMAKE_WINVER=0x0501
     48  1.1  christos !elseif "$(APPVER)" == "5.02"
     49  1.1  christos NMAKE_WINVER=0x0502
     50  1.1  christos !elseif "$(APPVER)" == "6.0"
     51  1.1  christos NMAKE_WINVER=0x0600
     52  1.1  christos !elseif "$(APPVER)" == "6.1"
     53  1.1  christos NMAKE_WINVER=0x0601
     54  1.1  christos !elseif "$(APPVER)" == "10.0"
     55  1.1  christos NMAKE_WINVER=0x0A00
     56  1.1  christos !endif
     57  1.1  christos 
     58  1.1  christos cc          = cl
     59  1.1  christos link        = link
     60  1.1  christos implib      = lib
     61  1.1  christos 
     62  1.1  christos cflags      = -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -W4
     63  1.1  christos 
     64  1.1  christos !if "$(CPU)" == "i386"
     65  1.1  christos cflags      = $(cflags) -D_X86_=1
     66  1.1  christos !endif
     67  1.1  christos !if "$(CPU)" == "AMD64"
     68  1.1  christos cflags      = $(cflags) -D_AMD64_=1
     69  1.1  christos !endif
     70  1.1  christos !if "$(CPU)" == "ARM"
     71  1.1  christos cflags      = $(cflags) -D_ARM_=1
     72  1.1  christos !endif
     73  1.1  christos !if "$(CPU)" == "ARM64"
     74  1.1  christos cflags      = $(cflags) -D_ARM64_=1
     75  1.1  christos !endif
     76  1.1  christos 
     77  1.1  christos cflags      = $(cflags) -DWIN32 -D_WIN32
     78  1.1  christos !if "$(CPU)" == "AMD64" || "$(CPU)" == "ARM64"
     79  1.1  christos cflags      = $(cflags) -DWIN64 -D_WIN64
     80  1.1  christos !endif
     81  1.1  christos 
     82  1.1  christos cflags      = $(cflags) -D_WINNT -D_WIN32_WINNT=$(NMAKE_WINVER)
     83  1.1  christos cflags      = $(cflags) -DNTDDI_VERSION=$(NMAKE_WINVER)0000
     84  1.1  christos cflags      = $(cflags) -D_WIN32_IE=$(NMAKE_WINVER) -DWINVER=$(NMAKE_WINVER)
     85  1.1  christos 
     86  1.1  christos !ifdef NODEBUG
     87  1.1  christos cdebug      = -Ox -DNDEBUG
     88  1.1  christos !else
     89  1.1  christos cdebug      = -Zi -Od -DDEBUG
     90  1.1  christos !endif
     91  1.1  christos 
     92  1.1  christos cvarsmt     = -D_MT
     93  1.1  christos cvarsdll    = -D_MT -D_DLL
     94  1.1  christos !ifdef NODEBUG
     95  1.1  christos cvarsmt     = $(cvarsmt) -MTd
     96  1.1  christos cvarsdll    = $(cvarsdll) -MDd
     97  1.1  christos !else
     98  1.1  christos cvarsmt     = $(cvarsmt) -MT
     99  1.1  christos cvarsdll    = $(cvarsdll) -MD
    100  1.1  christos !endif
    101  1.1  christos cvars       = $(cvarsmt)
    102  1.1  christos 
    103  1.1  christos lflags      = $(lflags) /INCREMENTAL:NO /NOLOGO
    104  1.1  christos !ifdef NODEBUG
    105  1.1  christos ldebug      = /RELEASE
    106  1.1  christos !else
    107  1.1  christos ldebug      = /DEBUG /DEBUGTYPE:cv
    108  1.1  christos !endif
    109  1.1  christos 
    110  1.1  christos !if "$(CPU)" == "i386"
    111  1.1  christos dllentry    = _DllMainCRTStartup@12
    112  1.1  christos !else
    113  1.1  christos dllentry    = _DllMainCRTStartup
    114  1.1  christos !endif
    115  1.1  christos 
    116  1.1  christos conlflags   = $(lflags) -subsystem:console,$(APPVER)
    117  1.1  christos guilflags   = $(lflags) -subsystem:windows,$(APPVER)
    118  1.1  christos dlllflags   = $(lflags) -entry:$(dllentry) -dll
    119  1.1  christos 
    120  1.1  christos baselibs    = kernel32.lib ws2_32.lib mswsock.lib advapi32.lib
    121  1.1  christos conlibs     = $(baselibs)
    122  1.1  christos conlibsmt   = $(baselibs)
    123  1.1  christos conlibsdll  = $(baselibs)
    124  1.1  christos 
    125  1.1  christos winlibs     = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
    126  1.1  christos guilibs     = $(winlibs)
    127  1.1  christos guilibsmt   = $(winlibs)
    128  1.1  christos guilibsdll  = $(winlibs)
    129