mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-21 14:00:51 +03:00
GNUmakefile: cleanups [ci skip] (#840)
- indent - sync `test/GNUmakefile` with main - delete `RANLIB` - use `else if` - use more `?=` - use ASCII-7 copyright symbol (in test)
This commit is contained in:
@@ -7,15 +7,14 @@
|
|||||||
#
|
#
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
|
# Project root
|
||||||
|
PROOT := ..
|
||||||
|
|
||||||
# Edit the path below to point to the base of your Zlib sources.
|
# Edit the path below to point to the base of your Zlib sources.
|
||||||
ifndef ZLIB_PATH
|
ZLIB_PATH ?= $(PROOT)/../zlib
|
||||||
ZLIB_PATH = ../../zlib
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Edit the path below to point to the base of your OpenSSL package.
|
# Edit the path below to point to the base of your OpenSSL package.
|
||||||
ifndef OPENSSL_PATH
|
OPENSSL_PATH ?= $(PROOT)/../openssl
|
||||||
OPENSSL_PATH = ../../openssl
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Edit the path below to point to your Distribution folder.
|
# Edit the path below to point to your Distribution folder.
|
||||||
ifndef DISTDIR
|
ifndef DISTDIR
|
||||||
@@ -29,9 +28,6 @@ DEVLDIR = libssh2-$(LIBSSH2_VERSION_STR)-dev-$(ARCH)
|
|||||||
endif
|
endif
|
||||||
DEVLARC = $(DEVLDIR).zip
|
DEVLARC = $(DEVLDIR).zip
|
||||||
|
|
||||||
# Project root
|
|
||||||
PROOT = ..
|
|
||||||
|
|
||||||
# Edit the vars below to change target settings.
|
# Edit the vars below to change target settings.
|
||||||
TARGET = libssh2
|
TARGET = libssh2
|
||||||
WWWURL = https://www.libssh2.org/
|
WWWURL = https://www.libssh2.org/
|
||||||
@@ -39,10 +35,7 @@ DESCR = libssh2 $(LIBSSH2_VERSION_STR)
|
|||||||
#STACK = 64000
|
#STACK = 64000
|
||||||
|
|
||||||
# must be equal to DEBUG or NDEBUG
|
# must be equal to DEBUG or NDEBUG
|
||||||
ifndef DB
|
DB ?= NDEBUG
|
||||||
DB = NDEBUG
|
|
||||||
# DB = DEBUG
|
|
||||||
endif
|
|
||||||
# Optimization: -O<n> or debugging: -g
|
# Optimization: -O<n> or debugging: -g
|
||||||
ifeq ($(DB),NDEBUG)
|
ifeq ($(DB),NDEBUG)
|
||||||
OPT = -O2
|
OPT = -O2
|
||||||
@@ -86,37 +79,26 @@ CAT = type
|
|||||||
ECHONL = $(ComSpec) /c echo.
|
ECHONL = $(ComSpec) /c echo.
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(LIBSSH2_RC),)
|
LIBSSH2_RC ?= $(CROSSPREFIX)windres
|
||||||
LIBSSH2_RC := $(CROSSPREFIX)windres
|
LIBSSH2_CC ?= $(CROSSPREFIX)gcc
|
||||||
endif
|
LIBSSH2_AR ?= $(CROSSPREFIX)ar
|
||||||
ifeq ($(LIBSSH2_CC),)
|
|
||||||
LIBSSH2_CC := $(CROSSPREFIX)gcc
|
|
||||||
endif
|
|
||||||
ifeq ($(LIBSSH2_AR),)
|
|
||||||
LIBSSH2_AR := $(CROSSPREFIX)ar
|
|
||||||
endif
|
|
||||||
ifeq ($(LIBSSH2_RANLIB),)
|
|
||||||
LIBSSH2_RANLIB := $(CROSSPREFIX)ranlib
|
|
||||||
endif
|
|
||||||
ifeq ($(LIBSSH2_DLL_A_SUFFIX),)
|
|
||||||
LIBSSH2_DLL_A_SUFFIX := dll
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
LIBSSH2_DLL_A_SUFFIX ?= dll
|
||||||
libssh2_dll_LIBRARY = $(TARGET)$(LIBSSH2_DLL_SUFFIX).dll
|
libssh2_dll_LIBRARY = $(TARGET)$(LIBSSH2_DLL_SUFFIX).dll
|
||||||
|
|
||||||
CC = $(LIBSSH2_CC)
|
CC = $(LIBSSH2_CC)
|
||||||
|
|
||||||
# Set environment var ARCH to your architecture to override autodetection.
|
# Set environment var ARCH to your architecture to override autodetection.
|
||||||
ifndef ARCH
|
ifndef ARCH
|
||||||
ifeq ($(findstring gcc,$(CC)),gcc)
|
ifeq ($(findstring gcc,$(CC)),gcc)
|
||||||
ifeq ($(findstring x86_64,$(shell $(CC) -dumpmachine)),x86_64)
|
ifeq ($(findstring x86_64,$(shell $(CC) -dumpmachine)),x86_64)
|
||||||
ARCH = w64
|
ARCH = w64
|
||||||
else
|
else
|
||||||
ARCH = w32
|
ARCH = w32
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
ARCH = w32
|
ARCH = w32
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Include the version info retrieved from libssh2.h
|
# Include the version info retrieved from libssh2.h
|
||||||
@@ -132,66 +114,61 @@ RC = $(LIBSSH2_RC)
|
|||||||
LDFLAGS += -s -shared -Wl,--output-def,$(libssh2_dll_LIBRARY:.dll=.def),--out-implib,$(TARGET)$(LIBSSH2_DLL_A_SUFFIX).$(LIBEXT)
|
LDFLAGS += -s -shared -Wl,--output-def,$(libssh2_dll_LIBRARY:.dll=.def),--out-implib,$(TARGET)$(LIBSSH2_DLL_A_SUFFIX).$(LIBEXT)
|
||||||
AR = $(LIBSSH2_AR)
|
AR = $(LIBSSH2_AR)
|
||||||
ARFLAGS = cru
|
ARFLAGS = cru
|
||||||
RANLIB = $(LIBSSH2_RANLIB)
|
|
||||||
RCFLAGS = -I $(PROOT)/include -O coff
|
RCFLAGS = -I $(PROOT)/include -O coff
|
||||||
CFLAGS += -fno-builtin
|
CFLAGS += -fno-builtin
|
||||||
CFLAGS += -fno-strict-aliasing
|
CFLAGS += -fno-strict-aliasing
|
||||||
CFLAGS += -Wall # -pedantic
|
CFLAGS += -Wall # -pedantic
|
||||||
ifeq ($(ARCH),w64)
|
ifeq ($(ARCH),w64)
|
||||||
CFLAGS += -m64
|
CFLAGS += -m64
|
||||||
LDFLAGS += -m64
|
LDFLAGS += -m64
|
||||||
RCFLAGS += -F pe-x86-64
|
RCFLAGS += -F pe-x86-64
|
||||||
else
|
else ifeq ($(ARCH),w32)
|
||||||
ifeq ($(ARCH),w32)
|
CFLAGS += -m32
|
||||||
CFLAGS += -m32
|
LDFLAGS += -m32
|
||||||
LDFLAGS += -m32
|
RCFLAGS += -F pe-i386
|
||||||
RCFLAGS += -F pe-i386
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
INCLUDES = -I$(PROOT)/win32 -I$(PROOT)/include
|
INCLUDES = -I$(PROOT)/win32 -I$(PROOT)/include
|
||||||
|
|
||||||
ifdef WITH_WINCNG
|
ifdef WITH_WINCNG
|
||||||
CFLAGS += -DLIBSSH2_WINCNG
|
CFLAGS += -DLIBSSH2_WINCNG
|
||||||
LDLIBS += -lbcrypt -lcrypt32
|
LDLIBS += -lbcrypt -lcrypt32
|
||||||
|
else ifdef MBEDTLS_PATH
|
||||||
|
CFLAGS += -DLIBSSH2_MBEDTLS
|
||||||
|
CFLAGS += -I"$(MBEDTLS_PATH)/include"
|
||||||
|
LIBPATH += -L"$(MBEDTLS_PATH)/libs"
|
||||||
|
LDLIBS += -lmbedtls -lmbedx509 -lmbedcrypto
|
||||||
else
|
else
|
||||||
ifdef MBEDTLS_PATH
|
CFLAGS += -DLIBSSH2_OPENSSL
|
||||||
CFLAGS += -DLIBSSH2_MBEDTLS
|
ifndef OPENSSL_INCLUDE
|
||||||
CFLAGS += -I"$(MBEDTLS_PATH)/include"
|
ifeq "$(wildcard $(OPENSSL_PATH)/outinc)" "$(OPENSSL_PATH)/outinc"
|
||||||
LIBPATH += -L"$(MBEDTLS_PATH)/libs"
|
OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc
|
||||||
LDLIBS += -lmbedtls -lmbedx509 -lmbedcrypto
|
endif
|
||||||
else
|
ifeq "$(wildcard $(OPENSSL_PATH)/include)" "$(OPENSSL_PATH)/include"
|
||||||
CFLAGS += -DLIBSSH2_OPENSSL
|
OPENSSL_INCLUDE = $(OPENSSL_PATH)/include
|
||||||
ifndef OPENSSL_INCLUDE
|
endif
|
||||||
ifeq "$(wildcard $(OPENSSL_PATH)/outinc)" "$(OPENSSL_PATH)/outinc"
|
|
||||||
OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc
|
|
||||||
endif
|
endif
|
||||||
ifeq "$(wildcard $(OPENSSL_PATH)/include)" "$(OPENSSL_PATH)/include"
|
ifneq "$(wildcard $(OPENSSL_INCLUDE)/openssl/opensslv.h)" "$(OPENSSL_INCLUDE)/openssl/opensslv.h"
|
||||||
OPENSSL_INCLUDE = $(OPENSSL_PATH)/include
|
$(error Invalid OPENSSL_PATH: $(OPENSSL_PATH))
|
||||||
endif
|
endif
|
||||||
endif
|
INCLUDES += -I"$(OPENSSL_INCLUDE)"
|
||||||
ifneq "$(wildcard $(OPENSSL_INCLUDE)/openssl/opensslv.h)" "$(OPENSSL_INCLUDE)/openssl/opensslv.h"
|
ifndef OPENSSL_LIBPATH
|
||||||
$(error Invalid OPENSSL_PATH: $(OPENSSL_PATH))
|
OPENSSL_LIBS_STAT = crypto ssl
|
||||||
endif
|
ifeq "$(wildcard $(OPENSSL_PATH)/out)" "$(OPENSSL_PATH)/out"
|
||||||
INCLUDES += -I"$(OPENSSL_INCLUDE)"
|
OPENSSL_LIBPATH = $(OPENSSL_PATH)/out
|
||||||
ifndef OPENSSL_LIBPATH
|
OPENSSL_LIBS_DYN = eay32 ssl32
|
||||||
OPENSSL_LIBS_STAT = crypto ssl
|
endif
|
||||||
ifeq "$(wildcard $(OPENSSL_PATH)/out)" "$(OPENSSL_PATH)/out"
|
ifeq "$(wildcard $(OPENSSL_PATH)/lib)" "$(OPENSSL_PATH)/lib"
|
||||||
OPENSSL_LIBPATH = $(OPENSSL_PATH)/out
|
OPENSSL_LIBPATH = $(OPENSSL_PATH)/lib
|
||||||
OPENSSL_LIBS_DYN = eay32 ssl32
|
OPENSSL_LIBS_DYN = crypto.dll ssl.dll
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq "$(wildcard $(OPENSSL_PATH)/lib)" "$(OPENSSL_PATH)/lib"
|
ifdef LINK_OPENSSL_STATIC
|
||||||
OPENSSL_LIBPATH = $(OPENSSL_PATH)/lib
|
LDLIBS += $(patsubst %,$(OPENSSL_LIBPATH)/lib%.$(LIBEXT), $(OPENSSL_LIBS_STAT)) -lgdi32
|
||||||
OPENSSL_LIBS_DYN = crypto.dll ssl.dll
|
else
|
||||||
|
LDLIBS += $(patsubst %,$(OPENSSL_LIBPATH)/lib%.$(LIBEXT), $(OPENSSL_LIBS_DYN))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifdef LINK_OPENSSL_STATIC
|
|
||||||
LDLIBS += $(patsubst %,$(OPENSSL_LIBPATH)/lib%.$(LIBEXT), $(OPENSSL_LIBS_STAT)) -lgdi32
|
|
||||||
else
|
|
||||||
LDLIBS += $(patsubst %,$(OPENSSL_LIBPATH)/lib%.$(LIBEXT), $(OPENSSL_LIBS_DYN))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
LDLIBS += -lws2_32
|
LDLIBS += -lws2_32
|
||||||
|
|
||||||
ifdef WITH_ZLIB
|
ifdef WITH_ZLIB
|
||||||
@@ -209,13 +186,11 @@ CFLAGS += $(INCLUDES)
|
|||||||
vpath %.c $(PROOT)/src
|
vpath %.c $(PROOT)/src
|
||||||
|
|
||||||
ifdef WITH_WINCNG
|
ifdef WITH_WINCNG
|
||||||
include $(PROOT)/Makefile.WinCNG.inc
|
include $(PROOT)/Makefile.WinCNG.inc
|
||||||
|
else ifdef MBEDTLS_PATH
|
||||||
|
include $(PROOT)/Makefile.mbedTLS.inc
|
||||||
else
|
else
|
||||||
ifdef MBEDTLS_PATH
|
include $(PROOT)/Makefile.OpenSSL.inc
|
||||||
include $(PROOT)/Makefile.mbedTLS.inc
|
|
||||||
else
|
|
||||||
include $(PROOT)/Makefile.OpenSSL.inc
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# include Makefile.inc to get CSOURCES define
|
# include Makefile.inc to get CSOURCES define
|
||||||
@@ -305,9 +280,6 @@ $(TARGET).$(LIBEXT): $(OBJS)
|
|||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
@$(call DEL, $@)
|
@$(call DEL, $@)
|
||||||
@$(AR) $(ARFLAGS) $@ $^
|
@$(AR) $(ARFLAGS) $@ $^
|
||||||
ifdef RANLIB
|
|
||||||
@$(RANLIB) $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(libssh2_dll_LIBRARY) $(TARGET)$(LIBSSH2_DLL_A_SUFFIX).$(LIBEXT): $(OBJL)
|
$(libssh2_dll_LIBRARY) $(TARGET)$(LIBSSH2_DLL_A_SUFFIX).$(LIBEXT): $(OBJL)
|
||||||
@echo Linking $@
|
@echo Linking $@
|
||||||
|
|||||||
@@ -7,34 +7,27 @@
|
|||||||
#
|
#
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
|
# Project root
|
||||||
|
PROOT := ../..
|
||||||
|
|
||||||
# Edit the path below to point to the base of your Zlib sources.
|
# Edit the path below to point to the base of your Zlib sources.
|
||||||
ifndef ZLIB_PATH
|
ZLIB_PATH ?= $(PROOT)/../zlib
|
||||||
ZLIB_PATH = ../../../zlib
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Edit the path below to point to the base of your OpenSSL package.
|
# Edit the path below to point to the base of your OpenSSL package.
|
||||||
ifndef OPENSSL_PATH
|
OPENSSL_PATH ?= $(PROOT)/../openssl
|
||||||
OPENSSL_PATH = ../../../openssl
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Project root
|
|
||||||
PROOT = ../..
|
|
||||||
|
|
||||||
# Edit the var below to enable static linking of libssh2 and libz
|
# Edit the var below to enable static linking of libssh2 and libz
|
||||||
LINK_STATIC = 1
|
LINK_STATIC := 1
|
||||||
|
|
||||||
# Edit the vars below to change target settings.
|
# Edit the vars below to change target settings.
|
||||||
SAMPLES = $(PROOT)/example
|
SAMPLES = $(PROOT)/example
|
||||||
TARGETS := $(filter-out x11.exe,$(patsubst $(SAMPLES)/%.c,%.exe,$(strip $(wildcard $(SAMPLES)/*.c))))
|
TARGETS := $(filter-out x11.exe,$(patsubst $(SAMPLES)/%.c,%.exe,$(strip $(wildcard $(SAMPLES)/*.c))))
|
||||||
WWWURL = https://www.libssh2.org/
|
WWWURL = https://www.libssh2.org/
|
||||||
DESCR = libssh2 $(subst .rc,,$(notdir $@)) $(LIBSSH2_VERSION_STR)
|
DESCR = libssh2 $(subst .rc,,$(notdir $@)) $(LIBSSH2_VERSION_STR)
|
||||||
#STACK = 64000
|
#STACK = 64000
|
||||||
|
|
||||||
# must be equal to DEBUG or NDEBUG
|
# must be equal to DEBUG or NDEBUG
|
||||||
ifndef DB
|
DB ?= NDEBUG
|
||||||
DB = NDEBUG
|
|
||||||
# DB = DEBUG
|
|
||||||
endif
|
|
||||||
# Optimization: -O<n> or debugging: -g
|
# Optimization: -O<n> or debugging: -g
|
||||||
ifeq ($(DB),NDEBUG)
|
ifeq ($(DB),NDEBUG)
|
||||||
OPT = -O2
|
OPT = -O2
|
||||||
@@ -46,78 +39,81 @@ endif
|
|||||||
|
|
||||||
# Here you can find a native Win32 binary of the original awk:
|
# Here you can find a native Win32 binary of the original awk:
|
||||||
# http://www.gknw.net/development/prgtools/awk-20100523.zip
|
# http://www.gknw.net/development/prgtools/awk-20100523.zip
|
||||||
AWK = awk
|
AWK = awk
|
||||||
ZIP = zip -qzr9
|
ZIP = zip -qzr9
|
||||||
|
|
||||||
# Platform-dependent helper tool macros
|
# Platform-dependent helper tool macros
|
||||||
ifeq ($(findstring /sh,$(SHELL)),/sh)
|
ifeq ($(findstring /sh,$(SHELL)),/sh)
|
||||||
DEL = rm -f $1
|
DEL = rm -f $1
|
||||||
RMDIR = rm -fr $1
|
RMDIR = rm -fr $1
|
||||||
MKDIR = mkdir -p $1
|
MKDIR = mkdir -p $1
|
||||||
COPY = -cp -afv $1 $2
|
COPY = -cp -afv $1 $2
|
||||||
#COPYR = -cp -afr $1/* $2
|
#COPYR = -cp -afr $1/* $2
|
||||||
COPYR = -rsync -aC $1/* $2
|
COPYR = -rsync -aC $1/* $2
|
||||||
TOUCH = touch $1
|
TOUCH = touch $1
|
||||||
CAT = cat
|
CAT = cat
|
||||||
ECHONL = echo ""
|
ECHONL = echo ""
|
||||||
DL = '
|
DL = '
|
||||||
else
|
else
|
||||||
ifeq "$(OS)" "Windows_NT"
|
ifeq "$(OS)" "Windows_NT"
|
||||||
DEL = -del 2>NUL /q /f $(subst /,\,$1)
|
DEL = -del 2>NUL /q /f $(subst /,\,$1)
|
||||||
RMDIR = -rd 2>NUL /q /s $(subst /,\,$1)
|
RMDIR = -rd 2>NUL /q /s $(subst /,\,$1)
|
||||||
else
|
else
|
||||||
DEL = -del 2>NUL $(subst /,\,$1)
|
DEL = -del 2>NUL $(subst /,\,$1)
|
||||||
RMDIR = -deltree 2>NUL /y $(subst /,\,$1)
|
RMDIR = -deltree 2>NUL /y $(subst /,\,$1)
|
||||||
endif
|
endif
|
||||||
MKDIR = -md 2>NUL $(subst /,\,$1)
|
MKDIR = -md 2>NUL $(subst /,\,$1)
|
||||||
COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2)
|
COPY = -copy 2>NUL /y $(subst /,\,$1) $(subst /,\,$2)
|
||||||
COPYR = -xcopy 2>NUL /q /y /e $(subst /,\,$1) $(subst /,\,$2)
|
COPYR = -xcopy 2>NUL /q /y /e $(subst /,\,$1) $(subst /,\,$2)
|
||||||
TOUCH = copy 2>&1>NUL /b $(subst /,\,$1) +,,
|
TOUCH = copy 2>&1>NUL /b $(subst /,\,$1) +,,
|
||||||
CAT = type
|
CAT = type
|
||||||
ECHONL = $(ComSpec) /c echo.
|
ECHONL = $(ComSpec) /c echo.
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CC = $(CROSSPREFIX)gcc
|
LIBSSH2_RC ?= $(CROSSPREFIX)windres
|
||||||
|
LIBSSH2_CC ?= $(CROSSPREFIX)gcc
|
||||||
|
LIBSSH2_AR ?= $(CROSSPREFIX)ar
|
||||||
|
|
||||||
|
CC = $(LIBSSH2_CC)
|
||||||
|
|
||||||
# Set environment var ARCH to your architecture to override autodetection.
|
# Set environment var ARCH to your architecture to override autodetection.
|
||||||
ifndef ARCH
|
ifndef ARCH
|
||||||
ifeq ($(findstring gcc,$(CC)),gcc)
|
ifeq ($(findstring gcc,$(CC)),gcc)
|
||||||
ifeq ($(findstring x86_64,$(shell $(CC) -dumpmachine)),x86_64)
|
ifeq ($(findstring x86_64,$(shell $(CC) -dumpmachine)),x86_64)
|
||||||
ARCH = w64
|
ARCH = w64
|
||||||
else
|
else
|
||||||
ARCH = w32
|
ARCH = w32
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
ARCH = w32
|
ARCH = w32
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Include the version info retrieved from libssh2.h
|
# Include the version info retrieved from libssh2.h
|
||||||
-include $(OBJDIR)/version.inc
|
-include $(OBJDIR)/version.inc
|
||||||
|
|
||||||
# Global flags for all compilers
|
# Global flags for all compilers
|
||||||
CFLAGS = $(OPT) -D$(DB)
|
CFLAGS = $(LIBSSH2_CFLAG_EXTRAS) $(OPT) -D$(DB)
|
||||||
|
LDFLAGS = $(LIBSSH2_LDFLAG_EXTRAS)
|
||||||
|
|
||||||
LD = $(CROSSPREFIX)gcc
|
|
||||||
RC = $(CROSSPREFIX)windres
|
|
||||||
LDFLAGS = -s
|
|
||||||
AR = $(CROSSPREFIX)ar
|
|
||||||
ARFLAGS = -cq
|
|
||||||
LIBEXT = a
|
LIBEXT = a
|
||||||
#LDLIBS += -lwsock32
|
LD = $(LIBSSH2_CC)
|
||||||
LDLIBS += -lws2_32
|
RC = $(LIBSSH2_RC)
|
||||||
|
LDFLAGS += -s
|
||||||
|
AR = $(LIBSSH2_AR)
|
||||||
|
ARFLAGS = cru
|
||||||
RCFLAGS = -I $(PROOT)/include -O coff
|
RCFLAGS = -I $(PROOT)/include -O coff
|
||||||
CFLAGS += -fno-builtin
|
CFLAGS += -fno-builtin
|
||||||
CFLAGS += -fno-strict-aliasing
|
CFLAGS += -fno-strict-aliasing
|
||||||
CFLAGS += -Wall #-Wno-unused #-pedantic
|
CFLAGS += -Wall # -pedantic
|
||||||
ifeq ($(ARCH),w64)
|
ifeq ($(ARCH),w64)
|
||||||
CFLAGS += -m64
|
CFLAGS += -m64
|
||||||
RCFLAGS += -F pe-x86-64
|
LDFLAGS += -m64
|
||||||
else
|
RCFLAGS += -F pe-x86-64
|
||||||
ifeq ($(ARCH),w32)
|
else ifeq ($(ARCH),w32)
|
||||||
CFLAGS += -m32
|
CFLAGS += -m32
|
||||||
RCFLAGS += -F pe-i386
|
LDFLAGS += -m32
|
||||||
endif
|
RCFLAGS += -F pe-i386
|
||||||
endif
|
endif
|
||||||
|
|
||||||
INCLUDES = -I$(PROOT)/win32 -I$(PROOT)/include
|
INCLUDES = -I$(PROOT)/win32 -I$(PROOT)/include
|
||||||
@@ -130,41 +126,44 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef WITH_WINCNG
|
ifdef WITH_WINCNG
|
||||||
# CFLAGS += -DLIBSSH2_WINCNG
|
LDLIBS += -lbcrypt -lcrypt32
|
||||||
LDLIBS += -lbcrypt -lcrypt32
|
else ifdef MBEDTLS_PATH
|
||||||
|
CFLAGS += -I"$(MBEDTLS_PATH)/include"
|
||||||
|
LIBPATH += -L"$(MBEDTLS_PATH)/libs"
|
||||||
|
LDLIBS += -lmbedtls -lmbedx509 -lmbedcrypto
|
||||||
else
|
else
|
||||||
# CFLAGS += -DLIBSSH2_OPENSSL
|
ifndef OPENSSL_INCLUDE
|
||||||
ifndef OPENSSL_INCLUDE
|
ifeq "$(wildcard $(OPENSSL_PATH)/outinc)" "$(OPENSSL_PATH)/outinc"
|
||||||
ifeq "$(wildcard $(OPENSSL_PATH)/outinc)" "$(OPENSSL_PATH)/outinc"
|
OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc
|
||||||
OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc
|
endif
|
||||||
|
ifeq "$(wildcard $(OPENSSL_PATH)/include)" "$(OPENSSL_PATH)/include"
|
||||||
|
OPENSSL_INCLUDE = $(OPENSSL_PATH)/include
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq "$(wildcard $(OPENSSL_PATH)/include)" "$(OPENSSL_PATH)/include"
|
ifneq "$(wildcard $(OPENSSL_INCLUDE)/openssl/opensslv.h)" "$(OPENSSL_INCLUDE)/openssl/opensslv.h"
|
||||||
OPENSSL_INCLUDE = $(OPENSSL_PATH)/include
|
$(error Invalid OPENSSL_PATH: $(OPENSSL_PATH))
|
||||||
|
endif
|
||||||
|
INCLUDES += -I"$(OPENSSL_INCLUDE)"
|
||||||
|
ifndef OPENSSL_LIBPATH
|
||||||
|
OPENSSL_LIBS_STAT = crypto ssl
|
||||||
|
ifeq "$(wildcard $(OPENSSL_PATH)/out)" "$(OPENSSL_PATH)/out"
|
||||||
|
OPENSSL_LIBPATH = $(OPENSSL_PATH)/out
|
||||||
|
OPENSSL_LIBS_DYN = eay32 ssl32
|
||||||
|
endif
|
||||||
|
ifeq "$(wildcard $(OPENSSL_PATH)/lib)" "$(OPENSSL_PATH)/lib"
|
||||||
|
OPENSSL_LIBPATH = $(OPENSSL_PATH)/lib
|
||||||
|
OPENSSL_LIBS_DYN = crypto.dll ssl.dll
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifdef LINK_STATIC
|
||||||
|
ifdef LINK_OPENSSL_STATIC
|
||||||
|
LDLIBS += $(patsubst %,$(OPENSSL_LIBPATH)/lib%.$(LIBEXT), $(OPENSSL_LIBS_STAT)) -lgdi32
|
||||||
|
else
|
||||||
|
LDLIBS += $(patsubst %,$(OPENSSL_LIBPATH)/lib%.$(LIBEXT), $(OPENSSL_LIBS_DYN))
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifneq "$(wildcard $(OPENSSL_INCLUDE)/openssl/opensslv.h)" "$(OPENSSL_INCLUDE)/openssl/opensslv.h"
|
LDLIBS += -lws2_32
|
||||||
$(error Invalid OPENSSL_PATH: $(OPENSSL_PATH))
|
|
||||||
endif
|
|
||||||
INCLUDES += -I"$(OPENSSL_INCLUDE)"
|
|
||||||
ifndef OPENSSL_LIBPATH
|
|
||||||
OPENSSL_LIBS_STAT = crypto ssl
|
|
||||||
ifeq "$(wildcard $(OPENSSL_PATH)/out)" "$(OPENSSL_PATH)/out"
|
|
||||||
OPENSSL_LIBPATH = $(OPENSSL_PATH)/out
|
|
||||||
OPENSSL_LIBS_DYN = eay32 ssl32
|
|
||||||
endif
|
|
||||||
ifeq "$(wildcard $(OPENSSL_PATH)/lib)" "$(OPENSSL_PATH)/lib"
|
|
||||||
OPENSSL_LIBPATH = $(OPENSSL_PATH)/lib
|
|
||||||
OPENSSL_LIBS_DYN = crypto.dll ssl.dll
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
ifdef LINK_STATIC
|
|
||||||
ifdef LINK_OPENSSL_STATIC
|
|
||||||
LDLIBS += $(patsubst %,$(OPENSSL_LIBPATH)/lib%.$(LIBEXT), $(OPENSSL_LIBS_STAT)) -lgdi32
|
|
||||||
else
|
|
||||||
LDLIBS += $(patsubst %,$(OPENSSL_LIBPATH)/lib%.$(LIBEXT), $(OPENSSL_LIBS_DYN))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef WITH_ZLIB
|
ifdef WITH_ZLIB
|
||||||
CFLAGS += -DLIBSSH2_HAVE_ZLIB
|
CFLAGS += -DLIBSSH2_HAVE_ZLIB
|
||||||
@@ -172,7 +171,7 @@ ifdef WITH_ZLIB
|
|||||||
ifdef LINK_ZLIB_STATIC
|
ifdef LINK_ZLIB_STATIC
|
||||||
LDLIBS += $(ZLIB_PATH)/libz.$(LIBEXT)
|
LDLIBS += $(ZLIB_PATH)/libz.$(LIBEXT)
|
||||||
else
|
else
|
||||||
LDLIBS += $(ZLIB_PATH)/libzdll.$(LIBEXT)
|
LDLIBS += $(ZLIB_PATH)/libz.dll.$(LIBEXT)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -227,7 +226,7 @@ $(OBJDIR)/%.rc: GNUmakefile $(OBJDIR)/version.inc
|
|||||||
@echo $(DL) BEGIN$(DL) >> $@
|
@echo $(DL) BEGIN$(DL) >> $@
|
||||||
@echo $(DL) BLOCK "040904E4"$(DL) >> $@
|
@echo $(DL) BLOCK "040904E4"$(DL) >> $@
|
||||||
@echo $(DL) BEGIN$(DL) >> $@
|
@echo $(DL) BEGIN$(DL) >> $@
|
||||||
@echo $(DL) VALUE "LegalCopyright","\xA9 $(LIBSSH2_COPYRIGHT_STR)\0"$(DL) >> $@
|
@echo $(DL) VALUE "LegalCopyright","(C) $(LIBSSH2_COPYRIGHT_STR)\0"$(DL) >> $@
|
||||||
ifdef COMPANY
|
ifdef COMPANY
|
||||||
@echo $(DL) VALUE "CompanyName","$(COMPANY)\0"$(DL) >> $@
|
@echo $(DL) VALUE "CompanyName","$(COMPANY)\0"$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user