forked from libssh2/libssh2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
NMakefile
93 lines (70 loc) · 1.81 KB
/
NMakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright (C) The libssh2 project and its contributors.
# SPDX-License-Identifier: BSD-3-Clause
!if "$(TARGET)" == ""
TARGET=Release
!endif
!if "$(TARGET)" == "Debug"
SUFFIX=_debug
CFLAGS=/Od /MDd
DLLFLAGS=/LDd /DEBUG
!else
CFLAGS=/Oi /O2 /Oy /GF /Y- /MD /DNDEBUG
DLLFLAGS=/LD
!endif
CFLAGS=/nologo /GL /Zi /EHsc $(CFLAGS) /Iinclude
!if "$(OPENSSL_PATH)" != ""
CFLAGS=$(CFLAGS) /DLIBSSH2_OPENSSL /I$(OPENSSL_PATH)\include
LIBS=$(LIBS) $(OPENSSL_PATH)\lib\crypto.lib $(OPENSSL_PATH)\lib\ssl.lib
!else
CFLAGS=$(CFLAGS) /DLIBSSH2_WINCNG
LIBS=crypt32.lib bcrypt.lib
!endif
!if "$(ZLIB_PATH)" != ""
CFLAGS=$(CFLAGS) /DLIBSSH2_HAVE_ZLIB /I$(ZLIB_PATH)\include
LIBS=$(LIBS) $(ZLIB_PATH)\lib\zlib.lib
!endif
LIBS=$(LIBS) ws2_32.lib user32.lib advapi32.lib gdi32.lib
INTDIR=$(TARGET)
SUBDIR=src
!include "src/Makefile.inc"
OBJECTS=$(CSOURCES:.c=.obj)
!if "$(TARGET)" == "Debug"
OBJECTS=Debug/$(OBJECTS: = Debug/)
OBJECTS=$(OBJECTS: Debug/ = )
!else
TARGET=Release
OBJECTS=Release/$(OBJECTS: = Release/)
OBJECTS=$(OBJECTS: Release/ = )
!endif
!if "$(AR)" == ""
AR=lib
ARFLAGS=-nologo /LTCG
!endif
RESOURCE=$(INTDIR)\libssh2.res
DLL=libssh2$(SUFFIX).dll
STATICLIB=$(INTDIR)\libssh2.lib
!if "$(BUILD_STATIC_LIB)" == ""
all: $(INTDIR) $(DLL)
!else
all: $(INTDIR) $(STATICLIB)
!endif
$(INTDIR):
@if not exist $(INTDIR) mkdir $(INTDIR)
$(DLL): $(OBJECTS) $(RESOURCE)
$(CC) -o $(DLL) $(CFLAGS) $(DLLFLAGS) $(OBJECTS) $(RESOURCE) $(LIBS)
$(STATICLIB): $(OBJECTS)
$(AR) $(ARFLAGS) -out:$@ $(OBJECTS)
$(RESOURCE): src\libssh2.rc
$(RC) /Iinclude /Fo"$@" $?
all-sub: $(INTDIR) all
clean-sub: clean
{$(SUBDIR)}.c{$(INTDIR)}.obj::
$(CC) -c $(CFLAGS) /Fo"$(INTDIR)\\" $<
clean:
-rd 2>NUL /q /s $(TARGET)
real-clean vclean: clean
-del 2>NUL libssh2.dll
-del 2>NUL libssh2.exp
-del 2>NUL libssh2.ilk
-del 2>NUL libssh2.lib
-del 2>NUL *.pdb