opensc/win32/Make.rules.mak

133 lines
5.0 KiB
Makefile
Raw Normal View History

OPENSC_FEATURES = pcsc
2016-01-22 14:18:58 +00:00
!IF "$(BUILD_ON)" == "WIN32"
PROGRAMFILES_PATH = C:\Program Files
!ELSE
PROGRAMFILES_PATH = C:\Program Files (x86)
!ENDIF
#Include support for minidriver
MINIDRIVER_DEF = /DENABLE_MINIDRIVER
#Build MSI with the Windows Installer XML (WIX) toolkit, requires WIX >= 3.9
2016-01-22 14:18:58 +00:00
WIX_PATH = $(PROGRAMFILES_PATH)\WiX Toolset v3.10
2015-12-23 17:46:30 +00:00
WIX_INCL_DIR = "/I$(WIX_PATH)\SDK\VS2010\inc"
!IF "$(BUILD_FOR)" == "WIN64"
2015-12-23 17:52:49 +00:00
WIX_LIBS = "$(WIX_PATH)\SDK\VS2010\lib\x64\dutil.lib" "$(WIX_PATH)\SDK\VS2010\lib\x64\wcautil.lib"
!ELSE
2015-12-23 17:52:49 +00:00
WIX_LIBS = "$(WIX_PATH)\SDK\VS2010\lib\x86\dutil.lib" "$(WIX_PATH)\SDK\VS2010\lib\x86\wcautil.lib"
!ENDIF
#Include support for Secure Messaging
SM_DEF = /DENABLE_SM
#Build with debugging support
#DEBUG_DEF = /DDEBUG
# If you want support for OpenSSL (needed for pkcs15-init tool, software hashing in PKCS#11 library and verification):
# - download and build OpenSSL
# - uncomment the line starting with OPENSSL_DEF
# - set the OPENSSL_INCL_DIR below to your openssl include directory, preceded by "/I"
# - set the OPENSSL_LIB below to your openssl lib file
#OPENSSL_DEF= /DENABLE_OPENSSL
Attached are the latest mode to OpenSC svn 3462 to use the Makefile.mak files to build on Windows. I got rutoken to compile, and took out the #ifdef's I had in last week. The rutoken programmer declared some variables in the middle of a block rather then having all the declare statements at the beginning of a block as is normally done in C. The Microsoft compile treats this as an error. (Actual many errors.) The makedef.pl is no longer needed, as the exports files can be used. Note that in the original Makefile.mak files only opensc.def and pkcs15init.def were created. winconfig.h has a number of changes. As discussed last week this could be created by autoconf. I also noted that the Active State Perl that was required for the makedef.pl has a psed command that could be used like sed to update winconfig.h. I did not attempt to do this. win32/Make.rules.mak - Use ENABLE_OPENSSL and ENABLE_ZLIB src/tools/Makefile.mak - add the rutoken.tool.exe src/tools/eidenv.c - use PACKAGE_VERSION src/pkcs11/Makefile.mak - reorder the objest to match the list in the Makefile.am. Makes it easier to read. src/include/winconfig.h - The windows version of the config.h Changes based on discussions on the list last week. src/common/Makefile.mak - renamed modules. src/pkcs15init/Makefile.mak - reordered, and added back the rutoken modules replaced the use of makdef.pl to sue the exports file. src/scconf/Makefile.mak - reordered objects. src/libopensc/card-rutoken.c - error. Moved the declares to the beginning of blocks. src/libopensc/Makefile.mak - reorder names, and add rutoken. Use the libopensc.exports file. src/libopensc/pkcs15-prkey-rutoken.c - more moving of declare statements. By Douglas E. Engert http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011011.html git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3464 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-07 19:42:43 +00:00
!IF "$(OPENSSL_DEF)" == "/DENABLE_OPENSSL"
!IF "$(BUILD_FOR)" == "WIN64"
OPENSSL_DIR = C:\OpenSSL-Win64
!ELSE
OPENSSL_DIR = C:\OpenSSL-Win32
!ENDIF
OPENSSL_INCL_DIR = /I$(OPENSSL_DIR)\include
#define OPENSSL_STATIC if you have visual studio compatible with OpenSSL's static binaries
OPENSSL_STATIC_DIR = static
!IF "$(DEBUG_DEF)" == "/DDEBUG"
OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libeay32MTd.lib user32.lib advapi32.lib crypt32.lib
!ELSE
OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libeay32MT.lib user32.lib advapi32.lib crypt32.lib
!ENDIF
PROGRAMS_OPENSSL = cryptoflex-tool.exe pkcs15-init.exe netkey-tool.exe piv-tool.exe \
westcos-tool.exe sc-hsm-tool.exe dnie-tool.exe gids-tool.exe npa-tool.exe
OPENSC_FEATURES = $(OPENSC_FEATURES) openssl
CANDLEFLAGS = -dOpenSSL="$(OPENSSL_DIR)" $(CANDLEFLAGS)
!ENDIF
# If you want support for zlib (Used for PIV, infocamere and actalis):
# - Download zlib-dll and
# - uncomment the line starting with ZLIB_DEF
# - set the ZLIB_INCL_DIR below to the zlib include lib proceeded by "/I"
# - set the ZLIB_LIB below to your zlib lib file
#ZLIB_DEF = /DENABLE_ZLIB
!IF "$(ZLIBSTATIC_DEF)" == "/DENABLE_ZLIB_STATIC"
ZLIB_DEF = /DENABLE_ZLIB
ZLIB_INCL_DIR = /IC:\zlib
ZLIB_LIB = C:\zlib\zlib.lib
OPENSC_FEATURES = $(OPENSC_FEATURES) zlib
!ELSE IF "$(ZLIB_DEF)" == "/DENABLE_ZLIB"
ZLIB_INCL_DIR = /IC:\zlib-dll\include
ZLIB_LIB = C:\zlib-dll\lib\zdll.lib
OPENSC_FEATURES = $(OPENSC_FEATURES) zlib
CANDLEFLAGS = -dzlib="C:\zlib-dll" $(CANDLEFLAGS)
!ENDIF
# If you want support for EAC:
# - Download OpenPACE and
# - uncomment the line starting with OPENPACE_DEF
# - set the OPENPACE_INCL_DIR below to the OpenPACE include directory preceeded by "/I"
# - set the OPENPACE_LIB below to your OpenPACE lib file
#OPENPACE_DEF= /DENABLE_OPENPACE
!IF "$(OPENPACE_DEF)" == "/DENABLE_OPENPACE"
OPENPACE_DIR = C:\openpace
OPENPACE_INCL_DIR = /I$(OPENPACE_DIR)\src
OPENPACE_LIB = $(OPENPACE_DIR)\src\libeac.lib
CANDLEFLAGS = -dOpenPACE="$(OPENPACE_DIR)" $(CANDLEFLAGS)
!ENDIF
# Used for MiniDriver
2016-01-22 14:18:58 +00:00
CNGSDK_INCL_DIR = "/I$(PROGRAMFILES_PATH)\Microsoft CNG Development Kit\Include"
# Mandatory path to 'ISO C9x compliant stdint.h and inttypes.h for Microsoft Visual Studio'
# http://msinttypes.googlecode.com/files/msinttypes-r26.zip
# INTTYPES_INCL_DIR = /IC:\opensc\dependencies\msys\local
# Code optimisation
# O1 - minimal code size
CODE_OPTIMIZATION = /O1
ALL_INCLUDES = /I$(TOPDIR)\win32 /I$(TOPDIR)\src $(OPENPACE_INCL_DIR) $(OPENSSL_INCL_DIR) $(OPENSSL_EXTRA_CFLAGS) $(ZLIB_INCL_DIR) $(LIBLTDL_INCL) $(INTTYPES_INCL_DIR) $(CNGSDK_INCL_DIR) $(WIX_INCL_DIR)
!IF "$(DEBUG_DEF)" == "/DDEBUG"
LINKDEBUGFLAGS = /NODEFAULTLIB:LIBCMT /DEBUG
CODE_OPTIMIZATION =
COPTS = /GS /W3 /D_CRT_SECURE_NO_DEPRECATE /MTd /nologo /DHAVE_CONFIG_H $(ALL_INCLUDES) /D_WIN32_WINNT=0x0502 /DWIN32_LEAN_AND_MEAN $(OPENPACE_DEF) $(OPENSSL_DEF) $(ZLIB_DEF) $(MINIDRIVER_DEF) $(SM_DEF) /DOPENSC_FEATURES="\"$(OPENSC_FEATURES)\"" /DDEBUG /Zi /Od
!ELSE
LINKDEBUGFLAGS = /NODEFAULTLIB:LIBCMTD
COPTS = /GS /W3 /D_CRT_SECURE_NO_DEPRECATE /MT /nologo /DHAVE_CONFIG_H $(ALL_INCLUDES) /D_WIN32_WINNT=0x0502 /DWIN32_LEAN_AND_MEAN $(OPENPACE_DEF) $(OPENSSL_DEF) $(ZLIB_DEF) $(MINIDRIVER_DEF) $(SM_DEF) /DOPENSC_FEATURES="\"$(OPENSC_FEATURES)\""
!ENDIF
!IF "$(BUILD_FOR)" == "WIN64"
2015-11-01 12:35:05 +00:00
LINKFLAGS = /NOLOGO /INCREMENTAL:NO /MACHINE:X64 /MANIFEST:NO /NODEFAULTLIB:MSVCRTD /NODEFAULTLIB:MSVCRT /NXCOMPAT /DYNAMICBASE $(LINKDEBUGFLAGS)
LIBFLAGS = /nologo /machine:x64
CANDLEFLAGS = -dPlatform=x64 $(CANDLEFLAGS)
!ELSE
2015-11-01 12:35:05 +00:00
LINKFLAGS = /NOLOGO /INCREMENTAL:NO /MACHINE:X86 /MANIFEST:NO /NODEFAULTLIB:MSVCRTD /NODEFAULTLIB:MSVCRT /NXCOMPAT /DYNAMICBASE /SAFESH $(LINKDEBUGFLAGS)
LIBFLAGS = /nologo /machine:x86
CANDLEFLAGS = -dPlatform=x86 $(CANDLEFLAGS)
!ENDIF
2016-06-22 14:35:17 +00:00
.c.obj::
cl $(CODE_OPTIMIZATION) $(COPTS) /c $<
.cpp.obj::
cl $(CODE_OPTIMIZATION) $(COPTS) /c $<
.rc.res::
rc /l 0x0409 $<
clean::
del /Q *.obj *.dll *.exe *.pdb *.lib *.def *.manifest *.res