libssh2/NMakefile

91 lines
1.7 KiB
Plaintext
Raw Normal View History

2024-05-07 13:49:03 +08:00
!if "$(TARGET)" == ""
TARGET=Release
!endif
2022-12-09 14:21:41 +08:00
2024-05-07 13:49:03 +08:00
!if "$(TARGET)" == "Debug"
SUFFIX=_debug
CFLAGS=/Od /MDd
DLLFLAGS=/LDd /DEBUG
2022-12-09 14:21:41 +08:00
!else
2024-05-07 13:49:03 +08:00
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
2022-12-09 14:21:41 +08:00
!endif
2024-05-07 13:49:03 +08:00
LIBS=$(LIBS) ws2_32.lib user32.lib advapi32.lib gdi32.lib
INTDIR=$(TARGET)
SUBDIR=src
!include "src/Makefile.inc"
2022-12-09 14:21:41 +08:00
OBJECTS=$(CSOURCES:.c=.obj)
2024-05-07 13:49:03 +08:00
!if "$(TARGET)" == "Debug"
OBJECTS=Debug/$(OBJECTS: = Debug/)
OBJECTS=$(OBJECTS: Debug/ = )
!else
TARGET=Release
OBJECTS=Release/$(OBJECTS: = Release/)
OBJECTS=$(OBJECTS: Release/ = )
!endif
2022-12-09 14:21:41 +08:00
2024-05-07 13:49:03 +08:00
!if "$(AR)" == ""
AR=lib
ARFLAGS=-nologo /LTCG
!endif
2022-12-09 14:21:41 +08:00
2024-05-07 13:49:03 +08:00
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)
2022-12-09 14:21:41 +08:00
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