Update recipes for Nmake file
parent
72ce467f23
commit
1709d5dc65
|
|
@ -1,8 +1,37 @@
|
||||||
// dump2def.cxx - Written and placed in public domain by Jeffrey Walton
|
// dump2def.cxx - Written and placed in public domain by Jeffrey Walton
|
||||||
// Create a module definitions file from a dumpbin file/
|
// Create a module definitions file from a dumpbin file.
|
||||||
// dump2def can be used to create a list of exports from
|
// dump2def can be used to create a list of exports from
|
||||||
// a static library. Then, the exports can used to build
|
// a static library. Then, the exports can used to build
|
||||||
// a dynamic link library with the same exports.
|
// a dynamic link library with the same exports.
|
||||||
|
//
|
||||||
|
// The workflow for Crypto++ is:
|
||||||
|
//
|
||||||
|
// 1. Open a Developer Prompt
|
||||||
|
// 2. CD to cryptopp/ directory
|
||||||
|
// 3. nmake /f cryptest.nmake cryptopp.dll
|
||||||
|
//
|
||||||
|
// The cryptopp.dll recipe first builds cryptlib.lib. Then it calls
|
||||||
|
// dumpbin.exe to export all symbols from cryptlib.lib and writes them
|
||||||
|
// to cryptopp.dump. The recipe then calls dump2def.exe to create a
|
||||||
|
// module definition file. Finally, the recipe builds cryptopp.dll
|
||||||
|
// using the module definition file cryptopp.def. The linker creates
|
||||||
|
// the import lib cryptopp.lib and export cryptopp.exp automatically.
|
||||||
|
//
|
||||||
|
// This is only "half the problem solved" for those who wish to use
|
||||||
|
// a DLL. The program must import the import lib cryptopp.lib. Then
|
||||||
|
// the program must ensure the library headers export the symbol or
|
||||||
|
// class with CRYPTOPP_DLL. CRYPTOPP_DLL is only present on some classes
|
||||||
|
// because the FIPS module only allowed approved algorithms like AES and
|
||||||
|
// SHA. Other classes like Base64Encoder and HexEncoder lack CRYPTOPP_DLL.
|
||||||
|
//
|
||||||
|
// CRYPTOPP_DLL simply adds declspec(dllimport) when CRYPTOPP_IMPORTS is
|
||||||
|
// defined. The limitation of requiring declspec(dllimport) is imposed by
|
||||||
|
// Microsoft. Microsoft does not allow a program to "import everything".
|
||||||
|
//
|
||||||
|
// If you would like to read more about the FIPS module and the pain it
|
||||||
|
// causes then see https://www.cryptopp.com/wiki/FIPS_DLL. In fact we
|
||||||
|
// recommend you delete the CryptDll and DllTest projects from the
|
||||||
|
// Visual Studio solution file.
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,26 @@ cryptest.exe: pch.pch cryptlib.lib $(TEST_OBJS)
|
||||||
cryptlib.lib: $(LIB_OBJS)
|
cryptlib.lib: $(LIB_OBJS)
|
||||||
$(AR) $(ARFLAGS) $(LIB_OBJS) /out:$@
|
$(AR) $(ARFLAGS) $(LIB_OBJS) /out:$@
|
||||||
|
|
||||||
|
#map2def source code available in TestPrograms/
|
||||||
|
# map2def.exe: map2def.obj
|
||||||
|
# $(LD) map2def.obj kernel32.lib /out:$@
|
||||||
|
|
||||||
|
#dump2def source code available in TestPrograms/
|
||||||
|
#dump2def.exe: dump2def.obj
|
||||||
|
# $(LD) dump2def.obj kernel32.lib /out:$@
|
||||||
|
|
||||||
|
cryptopp.map:
|
||||||
|
$(LD) $(LDFLAGS) /DLL /MAP /MAPINFO:EXPORTS $(LIB_OBJS) $(LDLIBS) /out:cryptopp.dll
|
||||||
|
|
||||||
|
cryptopp.dump: cryptlib.lib
|
||||||
|
dumpbin /LINKERMEMBER cryptlib.lib > cryptopp.dump
|
||||||
|
|
||||||
|
cryptopp.def: cryptlib.lib cryptopp.dump
|
||||||
|
dump2def.exe cryptopp.dump cryptopp.def
|
||||||
|
|
||||||
|
cryptopp.dll: $(LIB_OBJS) cryptopp.def
|
||||||
|
$(LD) $(LDFLAGS) /DLL /DEF:cryptopp.def /IGNORE:4102 $(LIB_OBJS) $(LDLIBS) /out:$@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) /F /Q pch.pch $(LIB_OBJS) pch.obj rdrand-x86.obj rdrand-x64.obj x64masm.obj x64dll.obj cryptlib.lib $(TEST_OBJS) cryptest.exe *.pdb
|
$(RM) /F /Q pch.pch $(LIB_OBJS) pch.obj rdrand-x86.obj rdrand-x64.obj x64masm.obj x64dll.obj cryptlib.lib $(TEST_OBJS) cryptest.exe *.pdb
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue