From 5d00b7966d3e6323341b0e74f01c91fdeb65d9f0 Mon Sep 17 00:00:00 2001 From: cherierm Date: Fri, 12 Sep 2008 13:11:37 +0000 Subject: [PATCH] the Windows make file used to built the SimGrid dynamic link library. This make file permits to store in the same library the C++ Msg Wrappers and the C code of the SimGrid API (mix of C code and C++ code) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5919 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- build/vc7/simgrid/w32_makefile | 322 +++++++++++++++++++++++++++++++++ 1 file changed, 322 insertions(+) create mode 100644 build/vc7/simgrid/w32_makefile diff --git a/build/vc7/simgrid/w32_makefile b/build/vc7/simgrid/w32_makefile new file mode 100644 index 0000000000..ef08f42ca5 --- /dev/null +++ b/build/vc7/simgrid/w32_makefile @@ -0,0 +1,322 @@ +######################################################################################################################## +# +# Project : w32_makefile +# +# Description : it's the make file used to build the Windows SimGrid dynamic link library (DLL) and the files +# that come with (the static library SimGrid.lib, the program database (PDB) file that holds +# debugging information used to display the Windows backtrace. +# +# Note : [(1) the manifest of the SimGrid is directly embeded in the DLL ] +# : [(2) both C code and C++ (the MSG wrappers) code are linked in the same library ] +# +# Compiler (CL.EXE) version :Microsoft Compiler (R) 32 bits C/C++ version 14.00.50727.42 for 80x86 +# +# Command line : nmake -f w32_makefile [all] +# +# Author : Abdelmalek CHERIER +######################################################################################################################## + +# The name of the libray +LIBRARY=simgrid.dll + +# The default global goal +all: $(LIBRARY) + +######################################################################################################################## +# +# C source files section +# +# Note : [(1) This section contains all the names of the C source file of the project. ] +# [ (2) All new C source files must be added in this section. ] +# +######################################################################################################################## + +CSRC= ..\..\..\src\xbt\xbt_virtu.c \ +..\..\..\src\xbt\xbt_strbuff.c \ +..\..\..\src\xbt\xbt_str.c \ +..\..\..\src\xbt\xbt_sg_time.c \ +..\..\..\src\xbt\xbt_sg_synchro.c \ +..\..\..\src\xbt\xbt_queue.c \ +..\..\..\src\xbt\xbt_peer.c \ +..\..\..\src\xbt\xbt_os_time.c \ +..\..\..\src\xbt\xbt_os_thread.c \ +..\..\..\src\xbt\xbt_matrix.c \ +..\..\..\src\xbt\xbt_main.c \ +..\..\..\src\xbt\xbt_log_layout_simple.c \ +..\..\..\src\xbt\xbt_log_layout_format.c \ +..\..\..\src\xbt\xbt_log_appender_file.c \ +..\..\..\src\xbt\xbt_context_thread.c \ +..\..\..\src\xbt\xbt_context_java.c \ +..\..\..\src\xbt\xbt_context.c \ +..\..\..\src\surf\workstation_ptask_L07.c \ +..\..\..\src\surf\workstation.c \ +..\..\..\src\gras\Transport\transport_plugin_sg.c \ +..\..\..\src\gras\Transport\transport.c \ +..\..\..\src\surf\trace_mgr.c \ +..\..\..\src\gras\Msg\timer.c \ +..\..\..\src\msg\task.c \ +..\..\..\src\xbt\swag.c \ +..\..\..\src\surf\surfxml_parse.c \ +..\..\..\src\surf\surf_timer.c \ +..\..\..\src\surf\surf.c \ +..\..\..\src\xbt\snprintf.c \ +..\..\..\src\simix\smx_synchro.c \ +..\..\..\src\simix\smx_process.c \ +..\..\..\src\simix\smx_host.c \ +..\..\..\src\simix\smx_global.c \ +..\..\..\src\simix\smx_environment.c \ +..\..\..\src\simix\smx_deployment.c \ +..\..\..\src\simix\smx_config.c \ +..\..\..\src\simix\smx_action.c \ +simgrid.c \ +..\..\..\src\gras\Transport\sg_transport.c \ +..\..\..\src\gras\Virtu\sg_process.c \ +..\..\..\src\gras\Msg\sg_msg.c \ +..\..\..\src\gras\Virtu\sg_emul.c \ +..\..\..\src\gras\Virtu\sg_dns.c \ +..\..\..\src\xbt\set.c \ +..\..\..\src\simdag\sd_workstation.c \ +..\..\..\src\simdag\sd_task.c \ +..\..\..\src\simdag\sd_link.c \ +..\..\..\src\simdag\sd_global.c \ +..\..\..\src\amok\Bandwidth\saturate.c \ +..\..\..\src\gras\Msg\rpc.c \ +..\..\..\src\surf\random_mgr.c \ +..\..\..\src\gras\Virtu\process.c \ +..\..\..\src\amok\PeerManagement\peermanagement.c \ +..\..\..\src\surf\network_constant.c \ +..\..\..\src\surf\network.c \ +..\..\..\src\msg\msg_mailbox.c \ +..\..\..\src\msg\msg_config.c \ +..\..\..\src\surf\maxmin.c \ +..\..\..\src\xbt\mallocator.c \ +..\..\..\src\msg\m_process.c \ +..\..\..\src\xbt\log.c \ +..\..\..\src\surf\lagrange.c \ +..\..\..\src\java\jxbt_utilities.c \ +..\..\..\src\java\jmsg_task.c \ +..\..\..\src\java\jmsg_process.c \ +..\..\..\src\java\jmsg_host.c \ +..\..\..\src\java\jmsg_channel.c \ +..\..\..\src\java\jmsg_application_handler.c \ +..\..\..\src\java\jmsg.c \ +..\..\..\src\msg\host.c \ +..\..\..\src\xbt\heap.c \ +..\..\..\src\gras\Msg\gras_msg_types.c \ +..\..\..\src\gras\Msg\gras_msg_mod.c \ +..\..\..\src\gras\Msg\gras_msg_listener.c \ +..\..\..\src\gras\Msg\gras_msg_exchange.c \ +..\..\..\src\gras\Virtu\gras_module.c \ +..\..\..\src\gras\gras.c \ +..\..\..\src\xbt\graphxml_parse.c \ +..\..\..\src\xbt\graph.c \ +..\..\..\src\msg\gos.c \ +..\..\..\src\msg\global.c \ +..\..\..\src\xbt\fifo.c \ +..\..\..\src\surf\fair_bottleneck.c \ +..\..\..\src\xbt\ex.c \ +..\..\..\src\msg\environment.c \ +..\..\..\src\xbt\dynar.c \ +..\..\..\src\xbt\dict_multi.c \ +..\..\..\src\xbt\dict_elm.c \ +..\..\..\src\xbt\dict_cursor.c \ +..\..\..\src\xbt\dict.c \ +..\..\..\src\msg\deployment.c \ +..\..\..\src\gras\DataDesc\ddt_parse.yy.c \ +..\..\..\src\gras\DataDesc\ddt_parse.c \ +..\..\..\src\gras\DataDesc\ddt_exchange.c \ +..\..\..\src\gras\DataDesc\ddt_create.c \ +..\..\..\src\gras\DataDesc\ddt_convert.c \ +..\..\..\src\gras\DataDesc\datadesc.c \ +..\..\..\src\xbt\cunit.c \ +..\..\..\src\surf\cpu.c \ +..\..\..\src\xbt\config.c \ +..\..\..\src\gras\DataDesc\cbps.c \ +..\..\..\src\amok\Bandwidth\bandwidth.c \ +..\..\..\src\xbt\asserts.c \ +..\..\..\src\amok\amok_base.c + +######################################################################################################################## +# +# C++ source files (Wrappers) section +# +# Note : [(1) This section contains all the names of the C++ source file of the project. ] +# [ (2) All new C++ source files must be added in this section. ] +# +######################################################################################################################## + + +CXXSRC = ..\..\..\src\cxx\MsgApplication.cxx \ +..\..\..\src\cxx\MsgApplicationHandler.cxx \ +..\..\..\src\cxx\BadAllocException.cxx \ +..\..\..\src\cxx\ClassNotFoundException.cxx \ +..\..\..\src\cxx\MsgEnvironment.cxx \ +..\..\..\src\cxx\Exception.cxx \ +..\..\..\src\cxx\FileNotFoundException.cxx \ +..\..\..\src\cxx\HostNotFoundException.cxx \ +..\..\..\src\cxx\InvalidArgumentException.cxx \ +..\..\..\src\cxx\LogicException.cxx \ +..\..\..\src\cxx\Msg.cxx \ +..\..\..\src\cxx\MsgException.cxx \ +..\..\..\src\cxx\NullPointerException.cxx \ +..\..\..\src\cxx\Object.cxx \ +..\..\..\src\cxx\OutOfBoundsException.cxx \ +..\..\..\src\cxx\MsgProcess.cxx \ +..\..\..\src\cxx\ProcessNotFoundException.cxx \ +..\..\..\src\cxx\MsgSimulation.cxx \ +..\..\..\src\cxx\StringHelper.cxx \ +..\..\..\src\cxx\MsgTask.cxx \ +..\..\..\src\cxx\MsgHost.cxx + +######################################################################################################################## +# C compiler flags section +# +# Flags descriptions : +# +# -> Od : disable the compiler optimisations +# -> Gd : __cdecl calling convention usage +# -> RTC1 : enable a run-time check +# -> MD : defines _MT and _DLL so that both multithread- and DLL-specific versions of the run-time routines +# are selected from the standard header files. This option also causes the compiler to place the library +# name MSVCRT.LIB into the object file. +# -> Fp : specify precompiled header file name +# -> Fo : create an object file +# -> Fd : the path of program database file (PDB) +# -> FR : generate the browser file (in Debug directory) +# -> W3 : warning level (3) +# -> c : compile without linking (cl.exe only generate the object file, link.exe do the rest) +# -> ZI : include debug information in the program database compatible with Edit and Continue (used by backtrace) +# -> TC : it's a C source file (use the C compilation) +# +# Disable warnings : +# +# -> 4996 : usage of functions declaraed as deprecated +# -> 4244 : conversion from 'type1' to 'type2', possible loss of data +# -> 4715 : not all control paths of a function return a value +# -> 4090 : different 'modifier' qualifiers in the operation +# -> 4018 : signed/unsigned mismatch in an expression +# +# Preprocessor macro descriptions : +# +# -> _CRT_SECURE_NO_DEPRECATE : disable deprecation +# -> WIN32 : it's a WIN32 DLL +# -> _WINDOWS : Windows protected-mode is selected with /GA, /Gw, /GW, /Mq, or /GD +# -> _USRDLL : it's a regulare DLL +# -> DLL_EXPORT : export all the SimGrid API (__declspec(dllexport) usage) +# -> _VC80_UPGRADE=0x0600 : it was a Visual C++ 6 project +# -> _WINDLL : Windows protected-mode dynamic-link library is selected with /GD +# -> _STATIC_CPPLIB : A VOIR +# +# +######################################################################################################################## + +CFLAGS = /Gd /Od /D "_CRT_SECURE_NO_DEPRECATE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "SIMGRID_EXPORTS" /D "DLL_EXPORT" /D "_VC80_UPGRADE=0x0600" /D "_WINDLL" /RTC1 /D "_STATIC_CPPLIB" /MD /Fp".\Debug/simgrid.pch" /Fo /Fd".\Debug/" /FR".\Debug\\" /W3 /c /ZI /TC /wd4127 /wd4996 /wd4244 /wd4715 /wd4090 /wd4018 /errorReport:prompt + +######################################################################################################################## +# C++ compiler flags section +# +# Flags descriptions : +# +# -> Ge : activate stack probes +# -> Gd : __cdecl calling convention usage +# -> Od : disable the compiler optimisations +# -> Gm : enable minimal rebuild +# -> EHsc : specify the synchronous exception handling model +# -> RTC1 : enable a run-time check +# -> MD : defines _MT and _DLL so that both multithread- and DLL-specific versions of the run-time routines +# are selected from the standard header files. This option also causes the compiler to place the library +# name MSVCRT.LIB into the object file. +# -> Fp : specify precompiled header file name +# -> Fo : create an object file +# -> Fd : the path of program database file (PDB) +# -> FR : generate the browser file (in Debug directory) +# -> W3 : warning level (3) +# -> c : compile without linking (cl.exe only generate the object file, link.exe do the rest) +# -> ZI : include debug information in the program database compatible with Edit and Continue (used by backtrace) +# -> TP : it's a C++ source file (use the C++ compilation) +# -> Wp64 : portability problem detection on 64 bits architecture +# +# Disable warnings : +# +# -> 4290 : disable the warning thows when a function is declared using exception specification +# +# Preprocessor macro descriptions : +# +# -> _CRT_SECURE_NO_DEPRECATE : disable deprecation +# -> _WIN32/WIN32 : it's a WIN32 DLL +# -> _WINDOWS : Windows protected-mode is selected with /GA, /Gw, /GW, /Mq, or /GD +# -> _USRDLL : it's a regulare DLL +# -> DLL_EXPORT : export all the SimGrid API (__declspec(dllexport) usage) +# -> _VC80_UPGRADE=0x0600 : it was a Visual C++ 6 project +# -> _WINDLL : Windows protected-mode dynamic-link library is selected with /GD +# -> _STATIC_CPPLIB : use libcpmt.lib instead msvcprt.lib : +# -> DLL_STATIC : avoid to export a another time the functions of the SimGrid API +# -> SIMGRIDX_EXPORTS : export the C++ Wrapper classes +# +######################################################################################################################## +CXXFLAGS = /Ge /Gd /Od /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "DLL_STATIC" /D "SIMGRID_EXPORTS" /D "SIMGRIDX_EXPORTS" /D "_WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_WINDLL" /Gm /EHsc /RTC1 /D "_STATIC_CPPLIB" /MD /Fo /Fd"Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP /wd4290 + + + +# Include directories +# +# Note : [ the environment variable INCLUDE must contains the value of the paths of the include directories +# of Microsoft Visual C++. Normaly, the installer do that during the installation of Microsoft Visual +# C++] + +INCLUDES = /I..\..\..\include /I..\..\..\src /I..\..\..\src\include /I..\..\..\src\cxx + + +# Libraries to link with + +LIBS = odbc32.lib odbccp32.lib WSOCK32.LIB kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib + + +######################################################################################################################## +# +# Linker flags to link with. +# +# The linker build the DLL store it in the Windows system32 directory +# It produce the manifest of the DLL, the PDB file and the static library. +# +# Note : [(1) The static library and the PDB file is stored in the Debug directory ] +# [(2) The manifest file is produced and embeded in the DLL by using the tool Mt.exe (see below) ] +# +######################################################################################################################## + +#LINKFLAGS = "/OUT:$(SYSTEMROOT)\system32\simgrid.dll" /INCREMENTAL /DLL /MANIFEST "/MANIFESTFILE:.\Debug\simgrid.dll.intermediate.manifest" /DEBUG "/PDB:.\Debug/simgrid.pdb" "/IMPLIB:.\Debug/simgrid.lib" /MACHINE:X86 +LINKFLAGS = "/OUT:$(SYSTEMROOT)\system32\simgrid.dll" /INCREMENTAL /DLL /MANIFEST "/MANIFESTFILE:$(SYSTEMROOT)\system32\simgrid.dll.manifest" /DEBUG "/PDB:.\Debug/simgrid.pdb" "/IMPLIB:.\Debug/simgrid.lib" /MACHINE:X86 + + +# The list of all .obj files to create. + +OBJS= $(CSRC:.c=.obj) $(CXXSRC:.cxx=.obj) + + + +# Link .obj files to create an executable. +# +# Note : [ the commande : mt /manifest $(SYSTEMROOT)\system32\simgrid.dll.manifest /outputresource:$(SYSTEMROOT)\system32\simgrid.dll;#2 +# insert the manifest in a section of the dll (this is used to locate the appropriate crt library] + +$(LIBRARY): $(OBJS) + link -out:$@ $(**F) "/OUT:$(SYSTEMROOT)\system32\simgrid.dll" /INCREMENTAL /DLL /DEBUG /PDB:".\Debug/simgrid.pdb" /IMPLIB:".\Debug/simgrid.lib" /MACHINE:X86 /ERRORREPORT:PROMPT odbc32.lib odbccp32.lib WSOCK32.LIB kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib + mt /manifest $(SYSTEMROOT)\system32\simgrid.dll.manifest /outputresource:$(SYSTEMROOT)\system32\simgrid.dll;#2 + +# link -out:$@ $(**F) $(LIBS) $(LINKFLAGS) + + + +# Create .obj files from .cpp files (ANSI C++) + +.cxx.obj: + cl $(CXXFLAGS) $(INCLUDES) $*.cxx + + +# Create .obj files from .c files (ANSI C) + + +.c.obj: + cl $(CFLAGS) $(INCLUDES) $*.c + + -- 2.20.1