4 #include "../../rbuild.h"
6 #include "modulehandler.h"
11 #define CLEAN_FILE(f) clean_files.push_back ( f ); /*if ( module.name == "crt" ) printf ( "%s(%i): clean: %s\n", __FILE__, __LINE__, f.c_str() )*/
13 static string ros_temp
= "$(TEMPORARY)";
15 MingwModuleHandler::backend
= NULL
;
17 MingwModuleHandler::fMakefile
= NULL
;
19 MingwModuleHandler::use_pch
= false;
23 const string
& filename
,
24 const string
& prefix
)
26 if ( !prefix
.length() )
29 const char* pfilename
= filename
.c_str();
30 const char* p1
= strrchr ( pfilename
, '/' );
31 const char* p2
= strrchr ( pfilename
, '\\' );
36 out
+= string(pfilename
,p1
-pfilename
) + CSEP
;
39 out
+= prefix
+ pfilename
;
44 GetTargetMacro ( const Module
& module
, bool with_dollar
)
46 string
s ( module
.name
);
50 return ssprintf ( "$(%s)", s
.c_str() );
54 MingwModuleHandler::MingwModuleHandler (
55 const Module
& module_
)
61 MingwModuleHandler::~MingwModuleHandler()
66 MingwModuleHandler::SetBackend ( MingwBackend
* backend_
)
72 MingwModuleHandler::SetMakefile ( FILE* f
)
78 MingwModuleHandler::SetUsePch ( bool b
)
84 MingwModuleHandler::RemoveVariables ( string path
)
86 size_t i
= path
.find ( '$' );
87 if ( i
!= string::npos
)
89 size_t j
= path
.find ( ')', i
);
90 if ( j
!= string::npos
)
92 if ( j
+ 2 < path
.length () && path
[j
+ 1] == CSEP
)
93 return path
.substr ( j
+ 2);
95 return path
.substr ( j
+ 1);
102 MingwModuleHandler::PassThruCacheDirectory (
104 Directory
* directoryTree
)
106 string
directory ( GetDirectory ( RemoveVariables ( file
) ) );
107 string generatedFilesDirectory
= backend
->AddDirectoryTarget ( directory
,
109 if ( directory
.find ( generatedFilesDirectory
) != string::npos
)
110 /* This path already includes the generated files directory variable */
113 return generatedFilesDirectory
+ SSEP
+ file
;
117 MingwModuleHandler::GetTargetFilename (
118 const Module
& module
,
119 string_list
* pclean_files
)
121 string target
= PassThruCacheDirectory (
122 NormalizeFilename ( module
.GetPath () ),
123 backend
->outputDirectory
);
126 string_list
& clean_files
= *pclean_files
;
127 CLEAN_FILE ( target
);
133 MingwModuleHandler::GetImportLibraryFilename (
134 const Module
& module
,
135 string_list
* pclean_files
)
137 string target
= PassThruCacheDirectory (
138 NormalizeFilename ( module
.GetDependencyPath () ),
139 backend
->outputDirectory
);
142 string_list
& clean_files
= *pclean_files
;
143 CLEAN_FILE ( target
);
148 /*static*/ MingwModuleHandler
*
149 MingwModuleHandler::InstanciateHandler (
150 const Module
& module
,
151 MingwBackend
* backend
)
153 MingwModuleHandler
* handler
;
154 switch ( module
.type
)
157 handler
= new MingwBuildToolModuleHandler ( module
);
160 handler
= new MingwStaticLibraryModuleHandler ( module
);
163 handler
= new MingwObjectLibraryModuleHandler ( module
);
166 handler
= new MingwKernelModuleHandler ( module
);
169 handler
= new MingwNativeCUIModuleHandler ( module
);
172 handler
= new MingwWin32CUIModuleHandler ( module
);
175 handler
= new MingwWin32GUIModuleHandler ( module
);
178 handler
= new MingwKernelModeDLLModuleHandler ( module
);
181 handler
= new MingwNativeDLLModuleHandler ( module
);
184 handler
= new MingwWin32DLLModuleHandler ( module
);
186 case KernelModeDriver
:
187 handler
= new MingwKernelModeDriverModuleHandler ( module
);
190 handler
= new MingwBootLoaderModuleHandler ( module
);
193 handler
= new MingwBootSectorModuleHandler ( module
);
196 handler
= new MingwIsoModuleHandler ( module
);
199 handler
= new MingwTestModuleHandler ( module
);
202 handler
= new MingwRpcServerModuleHandler ( module
);
205 handler
= new MingwRpcClientModuleHandler ( module
);
208 throw UnknownModuleTypeException (
209 module
.node
.location
,
217 MingwModuleHandler::GetWorkingDirectory () const
223 MingwModuleHandler::GetBasename ( const string
& filename
) const
225 size_t index
= filename
.find_last_of ( '.' );
226 if ( index
!= string::npos
)
227 return filename
.substr ( 0, index
);
232 MingwModuleHandler::GetActualSourceFilename (
233 const string
& filename
) const
235 string extension
= GetExtension ( filename
);
236 if ( extension
== ".spec" || extension
== ".SPEC" )
238 string basename
= GetBasename ( filename
);
239 return PassThruCacheDirectory ( NormalizeFilename ( basename
+ ".stubs.c" ),
240 backend
->intermediateDirectory
);
242 else if ( extension
== ".idl" || extension
== ".IDL" )
244 string basename
= GetBasename ( filename
);
246 if ( module
.type
== RpcServer
)
247 newname
= basename
+ "_s.c";
249 newname
= basename
+ "_c.c";
250 return PassThruCacheDirectory ( NormalizeFilename ( newname
),
251 backend
->intermediateDirectory
);
258 MingwModuleHandler::GetModuleArchiveFilename () const
260 if ( module
.type
== StaticLibrary
)
261 return GetTargetFilename ( module
, NULL
);
262 return PassThruCacheDirectory ( ReplaceExtension (
263 NormalizeFilename ( module
.GetPath () ),
265 backend
->intermediateDirectory
);
269 MingwModuleHandler::IsGeneratedFile ( const File
& file
) const
271 string extension
= GetExtension ( file
.name
);
272 return ( extension
== ".spec" || extension
== ".SPEC" );
276 MingwModuleHandler::ReferenceObjects (
277 const Module
& module
)
279 if ( module
.type
== ObjectLibrary
)
281 if ( module
.type
== RpcServer
)
283 if ( module
.type
== RpcClient
)
289 MingwModuleHandler::GetImportLibraryDependency (
290 const Module
& importedModule
)
293 if ( ReferenceObjects ( importedModule
) )
294 dep
= GetTargetMacro ( importedModule
);
296 dep
= GetImportLibraryFilename ( importedModule
, NULL
);
301 MingwModuleHandler::GetTargets ( const Module
& dependencyModule
,
302 string_list
& targets
)
304 if ( dependencyModule
.invocations
.size () > 0 )
306 for ( size_t i
= 0; i
< dependencyModule
.invocations
.size (); i
++ )
308 Invoke
& invoke
= *dependencyModule
.invocations
[i
];
309 invoke
.GetTargets ( targets
);
313 targets
.push_back ( GetImportLibraryDependency ( dependencyModule
) );
317 MingwModuleHandler::GetModuleDependencies (
318 string_list
& dependencies
)
320 size_t iend
= module
.dependencies
.size ();
325 for ( size_t i
= 0; i
< iend
; i
++ )
327 const Dependency
& dependency
= *module
.dependencies
[i
];
328 const Module
& dependencyModule
= *dependency
.dependencyModule
;
329 GetTargets ( dependencyModule
,
332 GetDefinitionDependencies ( dependencies
);
336 MingwModuleHandler::GetSourceFilenames (
338 bool includeGeneratedFiles
) const
342 const vector
<File
*>& files
= module
.non_if_data
.files
;
343 for ( i
= 0; i
< files
.size (); i
++ )
345 if ( includeGeneratedFiles
|| !IsGeneratedFile ( *files
[i
] ) )
348 GetActualSourceFilename ( files
[i
]->name
) );
351 // intentionally make a copy so that we can append more work in
352 // the middle of processing without having to go recursive
353 vector
<If
*> v
= module
.non_if_data
.ifs
;
354 for ( i
= 0; i
< v
.size (); i
++ )
358 // check for sub-ifs to add to list
359 const vector
<If
*>& ifs
= rIf
.data
.ifs
;
360 for ( j
= 0; j
< ifs
.size (); j
++ )
361 v
.push_back ( ifs
[j
] );
362 const vector
<File
*>& files
= rIf
.data
.files
;
363 for ( j
= 0; j
< files
.size (); j
++ )
365 File
& file
= *files
[j
];
366 if ( includeGeneratedFiles
|| !IsGeneratedFile ( file
) )
369 GetActualSourceFilename ( file
.name
) );
376 MingwModuleHandler::GetSourceFilenamesWithoutGeneratedFiles (
377 string_list
& list
) const
379 GetSourceFilenames ( list
, false );
383 MingwModuleHandler::GetObjectFilename (
384 const string
& sourceFilename
,
385 string_list
* pclean_files
) const
387 Directory
* directoryTree
;
390 string extension
= GetExtension ( sourceFilename
);
391 if ( extension
== ".rc" || extension
== ".RC" )
392 newExtension
= ".coff";
393 else if ( extension
== ".spec" || extension
== ".SPEC" )
394 newExtension
= ".stubs.o";
395 else if ( extension
== ".idl" || extension
== ".IDL" )
397 if ( module
.type
== RpcServer
)
398 newExtension
= "_s.o";
400 newExtension
= "_c.o";
405 if ( module
.type
== BootSector
)
406 directoryTree
= backend
->outputDirectory
;
408 directoryTree
= backend
->intermediateDirectory
;
410 string obj_file
= PassThruCacheDirectory (
411 NormalizeFilename ( ReplaceExtension (
412 RemoveVariables ( sourceFilename
),
417 string_list
& clean_files
= *pclean_files
;
418 CLEAN_FILE ( obj_file
);
424 MingwModuleHandler::GenerateCleanTarget () const
426 if ( 0 == clean_files
.size() )
428 fprintf ( fMakefile
, ".PHONY: %s_clean\n", module
.name
.c_str() );
429 fprintf ( fMakefile
, "%s_clean:\n\t-@$(rm)", module
.name
.c_str() );
430 for ( size_t i
= 0; i
< clean_files
.size(); i
++ )
433 fprintf ( fMakefile
, " 2>$(NUL)\n\t-@$(rm)" );
434 fprintf ( fMakefile
, " %s", clean_files
[i
].c_str() );
436 fprintf ( fMakefile
, " 2>$(NUL)\n" );
437 fprintf ( fMakefile
, "clean: %s_clean\n\n", module
.name
.c_str() );
441 MingwModuleHandler::GetObjectFilenames ()
443 const vector
<File
*>& files
= module
.non_if_data
.files
;
444 if ( files
.size () == 0 )
447 string
objectFilenames ( "" );
448 for ( size_t i
= 0; i
< files
.size (); i
++ )
450 if ( objectFilenames
.size () > 0 )
451 objectFilenames
+= " ";
453 GetObjectFilename ( files
[i
]->name
, NULL
);
455 return objectFilenames
;
459 MingwModuleHandler::GenerateGccDefineParametersFromVector (
460 const vector
<Define
*>& defines
) const
463 for ( size_t i
= 0; i
< defines
.size (); i
++ )
465 Define
& define
= *defines
[i
];
466 if (parameters
.length () > 0)
469 parameters
+= define
.name
;
470 if (define
.value
.length () > 0)
473 parameters
+= define
.value
;
480 MingwModuleHandler::GenerateGccDefineParameters () const
482 string parameters
= GenerateGccDefineParametersFromVector ( module
.project
.non_if_data
.defines
);
483 string s
= GenerateGccDefineParametersFromVector ( module
.non_if_data
.defines
);
484 if ( s
.length () > 0 )
493 MingwModuleHandler::ConcatenatePaths (
495 const string
& path2
) const
497 if ( ( path1
.length () == 0 ) || ( path1
== "." ) || ( path1
== "./" ) )
499 if ( path1
[path1
.length ()] == CSEP
)
500 return path1
+ path2
;
502 return path1
+ CSEP
+ path2
;
506 MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector
<Include
*>& includes
) const
509 for ( size_t i
= 0; i
< includes
.size (); i
++ )
511 Include
& include
= *includes
[i
];
512 if ( parameters
.length () > 0 )
514 parameters
+= "-I" + include
.directory
;
520 MingwModuleHandler::GenerateGccIncludeParameters () const
522 string parameters
= GenerateGccIncludeParametersFromVector ( module
.non_if_data
.includes
);
523 string s
= GenerateGccIncludeParametersFromVector ( module
.project
.non_if_data
.includes
);
524 if ( s
.length () > 0 )
534 MingwModuleHandler::GenerateCompilerParametersFromVector ( const vector
<CompilerFlag
*>& compilerFlags
) const
537 for ( size_t i
= 0; i
< compilerFlags
.size (); i
++ )
539 CompilerFlag
& compilerFlag
= *compilerFlags
[i
];
540 if ( parameters
.length () > 0 )
542 parameters
+= compilerFlag
.flag
;
548 MingwModuleHandler::GenerateLinkerParametersFromVector ( const vector
<LinkerFlag
*>& linkerFlags
) const
551 for ( size_t i
= 0; i
< linkerFlags
.size (); i
++ )
553 LinkerFlag
& linkerFlag
= *linkerFlags
[i
];
554 if ( parameters
.length () > 0 )
556 parameters
+= linkerFlag
.flag
;
562 MingwModuleHandler::GenerateImportLibraryDependenciesFromVector (
563 const vector
<Library
*>& libraries
)
565 string
dependencies ( "" );
567 for ( size_t i
= 0; i
< libraries
.size (); i
++ )
569 if ( wrap_count
++ == 5 )
570 dependencies
+= " \\\n\t\t", wrap_count
= 0;
571 else if ( dependencies
.size () > 0 )
573 dependencies
+= GetImportLibraryDependency ( *libraries
[i
]->imported_module
);
579 MingwModuleHandler::GenerateLinkerParameters () const
581 return GenerateLinkerParametersFromVector ( module
.linkerFlags
);
585 MingwModuleHandler::GenerateMacro (
586 const char* assignmentOperation
,
588 const IfableData
& data
,
589 const vector
<CompilerFlag
*>* compilerFlags
)
597 assignmentOperation
);
599 if ( compilerFlags
!= NULL
)
601 string compilerParameters
= GenerateCompilerParametersFromVector ( *compilerFlags
);
602 if ( compilerParameters
.size () > 0 )
607 compilerParameters
.c_str () );
611 for ( i
= 0; i
< data
.includes
.size(); i
++ )
616 data
.includes
[i
]->directory
.c_str() );
618 for ( i
= 0; i
< data
.defines
.size(); i
++ )
620 Define
& d
= *data
.defines
[i
];
625 if ( d
.value
.size() )
631 fprintf ( fMakefile
, "\n" );
635 MingwModuleHandler::GenerateMacros (
636 const char* assignmentOperation
,
637 const IfableData
& data
,
638 const vector
<CompilerFlag
*>* compilerFlags
,
639 const vector
<LinkerFlag
*>* linkerFlags
)
643 if ( data
.includes
.size () > 0 || data
.defines
.size () > 0 )
645 GenerateMacro ( assignmentOperation
,
649 GenerateMacro ( assignmentOperation
,
655 if ( linkerFlags
!= NULL
)
657 string linkerParameters
= GenerateLinkerParametersFromVector ( *linkerFlags
);
658 if ( linkerParameters
.size () > 0 )
663 linkerflagsMacro
.c_str (),
665 linkerParameters
.c_str() );
669 if ( data
.libraries
.size () > 0 )
671 string deps
= GenerateImportLibraryDependenciesFromVector ( data
.libraries
);
672 if ( deps
.size () > 0 )
683 const vector
<If
*>& ifs
= data
.ifs
;
684 for ( i
= 0; i
< ifs
.size(); i
++ )
687 if ( rIf
.data
.defines
.size()
688 || rIf
.data
.includes
.size()
689 || rIf
.data
.libraries
.size()
690 || rIf
.data
.files
.size()
691 || rIf
.data
.ifs
.size() )
695 "ifeq (\"$(%s)\",\"%s\")\n",
696 rIf
.property
.c_str(),
711 MingwModuleHandler::GenerateObjectMacros (
712 const char* assignmentOperation
,
713 const IfableData
& data
,
714 const vector
<CompilerFlag
*>* compilerFlags
,
715 const vector
<LinkerFlag
*>* linkerFlags
)
719 const vector
<File
*>& files
= data
.files
;
720 if ( files
.size () > 0 )
722 for ( i
= 0; i
< files
.size (); i
++ )
724 File
& file
= *files
[i
];
729 objectsMacro
.c_str(),
731 file
.name
, NULL
).c_str (),
732 objectsMacro
.c_str() );
738 objectsMacro
.c_str (),
739 assignmentOperation
);
740 for ( i
= 0; i
< files
.size(); i
++ )
742 File
& file
= *files
[i
];
748 ( i
%10 == 9 ? " \\\n\t" : " " ),
750 file
.name
, NULL
).c_str () );
753 fprintf ( fMakefile
, "\n" );
756 const vector
<If
*>& ifs
= data
.ifs
;
757 for ( i
= 0; i
< ifs
.size(); i
++ )
760 if ( rIf
.data
.defines
.size()
761 || rIf
.data
.includes
.size()
762 || rIf
.data
.libraries
.size()
763 || rIf
.data
.files
.size()
764 || rIf
.data
.ifs
.size() )
768 "ifeq (\"$(%s)\",\"%s\")\n",
769 rIf
.property
.c_str(),
771 GenerateObjectMacros (
784 MingwModuleHandler::GenerateGccCommand (
785 const string
& sourceFilename
,
787 const string
& cflagsMacro
)
789 string deps
= sourceFilename
;
790 if ( module
.pch
&& use_pch
)
791 deps
+= " " + module
.pch
->header
+ ".gch";
793 /* WIDL generated headers may be used */
794 deps
+= " " + GetLinkingDependenciesMacro ();
796 string objectFilename
= GetObjectFilename (
797 sourceFilename
, &clean_files
);
800 objectFilename
.c_str (),
802 GetDirectory ( objectFilename
).c_str () );
803 fprintf ( fMakefile
, "\t$(ECHO_CC)\n" );
805 "\t%s -c $< -o $@ %s\n",
807 cflagsMacro
.c_str () );
811 MingwModuleHandler::GenerateGccAssemblerCommand (
812 const string
& sourceFilename
,
814 const string
& cflagsMacro
)
816 string objectFilename
= GetObjectFilename (
817 sourceFilename
, &clean_files
);
820 objectFilename
.c_str (),
821 sourceFilename
.c_str (),
822 GetDirectory ( objectFilename
).c_str () );
823 fprintf ( fMakefile
, "\t$(ECHO_GAS)\n" );
825 "\t%s -x assembler-with-cpp -c $< -o $@ -D__ASM__ %s\n",
827 cflagsMacro
.c_str () );
831 MingwModuleHandler::GenerateNasmCommand (
832 const string
& sourceFilename
,
833 const string
& nasmflagsMacro
)
835 string objectFilename
= GetObjectFilename (
836 sourceFilename
, &clean_files
);
839 objectFilename
.c_str (),
840 sourceFilename
.c_str (),
841 GetDirectory ( objectFilename
).c_str () );
842 fprintf ( fMakefile
, "\t$(ECHO_NASM)\n" );
844 "\t%s -f win32 $< -o $@ %s\n",
846 nasmflagsMacro
.c_str () );
850 MingwModuleHandler::GenerateWindresCommand (
851 const string
& sourceFilename
,
852 const string
& windresflagsMacro
)
854 string objectFilename
=
855 GetObjectFilename ( sourceFilename
, &clean_files
);
856 string rciFilename
= ros_temp
+
857 ReplaceExtension ( sourceFilename
, ".rci" );
858 string resFilename
= ros_temp
+
859 ReplaceExtension ( sourceFilename
, ".res" );
863 "%s: %s $(WRC_TARGET) | %s\n",
864 objectFilename
.c_str (),
865 sourceFilename
.c_str (),
866 GetDirectory ( objectFilename
).c_str () );
867 fprintf ( fMakefile
, "\t$(ECHO_WRC)\n" );
869 "\t${gcc} -xc -E -DRC_INVOKED ${%s} %s > %s\n",
870 windresflagsMacro
.c_str (),
871 sourceFilename
.c_str (),
872 rciFilename
.c_str () );
874 "\t$(Q)$(WRC_TARGET) ${%s} %s %s\n",
875 windresflagsMacro
.c_str (),
876 rciFilename
.c_str (),
877 resFilename
.c_str () );
879 "\t-@${rm} %s 2>$(NUL)\n",
880 rciFilename
.c_str () );
882 "\t${windres} %s -o $@\n",
883 resFilename
.c_str () );
885 "\t-@${rm} %s 2>$(NUL)\n",
886 resFilename
.c_str () );
891 "%s: %s $(WRC_TARGET) | %s\n",
892 objectFilename
.c_str (),
893 sourceFilename
.c_str (),
894 GetDirectory ( objectFilename
).c_str () );
895 fprintf ( fMakefile
, "\t$(ECHO_WRC)\n" );
897 "\t${windres} $(%s) %s -o $@\n",
898 windresflagsMacro
.c_str (),
899 sourceFilename
.c_str () );
904 MingwModuleHandler::GenerateWinebuildCommands (
905 const string
& sourceFilename
)
907 string basename
= GetBasename ( sourceFilename
);
909 string def_file
= PassThruCacheDirectory (
910 basename
+ ".spec.def",
911 backend
->intermediateDirectory
);
912 CLEAN_FILE(def_file
);
914 string stub_file
= PassThruCacheDirectory (
915 basename
+ ".stubs.c",
916 backend
->intermediateDirectory
);
917 CLEAN_FILE(stub_file
)
920 "%s: %s $(WINEBUILD_TARGET)\n",
922 sourceFilename
.c_str () );
923 fprintf ( fMakefile
, "\t$(ECHO_WINEBLD)\n" );
925 "\t%s --def=%s -o %s\n",
926 "$(Q)$(WINEBUILD_TARGET)",
927 sourceFilename
.c_str (),
931 "%s: %s $(WINEBUILD_TARGET)\n",
933 sourceFilename
.c_str () );
934 fprintf ( fMakefile
, "\t$(ECHO_WINEBLD)\n" );
936 "\t%s --pedll=%s -o %s\n",
937 "$(Q)$(WINEBUILD_TARGET)",
938 sourceFilename
.c_str (),
939 stub_file
.c_str () );
943 MingwModuleHandler::GenerateWidlCommandsServer (
944 const string
& sourceFilename
,
945 const string
& widlflagsMacro
)
947 string basename
= GetBasename ( sourceFilename
);
949 /*string generatedHeaderFilename = PassThruCacheDirectory (
951 backend->intermediateDirectory );
952 CLEAN_FILE(generatedHeaderFilename);
954 string generatedHeaderFilename
= basename
+ "_s.h";
955 CLEAN_FILE(generatedHeaderFilename
);
957 string generatedServerFilename
= PassThruCacheDirectory (
959 backend
->intermediateDirectory
);
960 CLEAN_FILE(generatedServerFilename
);
963 "%s %s: %s $(WIDL_TARGET) | %s\n",
964 generatedServerFilename
.c_str (),
965 generatedHeaderFilename
.c_str (),
966 sourceFilename
.c_str (),
967 GetDirectory ( generatedServerFilename
).c_str () );
968 fprintf ( fMakefile
, "\t$(ECHO_WIDL)\n" );
970 "\t%s %s -h -H %s -s -S %s %s\n",
971 "$(Q)$(WIDL_TARGET)",
972 widlflagsMacro
.c_str (),
973 generatedHeaderFilename
.c_str (),
974 generatedServerFilename
.c_str (),
975 sourceFilename
.c_str () );
979 MingwModuleHandler::GenerateWidlCommandsClient (
980 const string
& sourceFilename
,
981 const string
& widlflagsMacro
)
983 string basename
= GetBasename ( sourceFilename
);
985 /*string generatedHeaderFilename = PassThruCacheDirectory (
987 backend->intermediateDirectory );
988 CLEAN_FILE(generatedHeaderFilename);
990 string generatedHeaderFilename
= basename
+ "_c.h";
991 CLEAN_FILE(generatedHeaderFilename
);
993 string generatedClientFilename
= PassThruCacheDirectory (
995 backend
->intermediateDirectory
);
996 CLEAN_FILE(generatedClientFilename
);
999 "%s %s: %s $(WIDL_TARGET) | %s\n",
1000 generatedClientFilename
.c_str (),
1001 generatedHeaderFilename
.c_str (),
1002 sourceFilename
.c_str (),
1003 GetDirectory ( generatedClientFilename
).c_str () );
1004 fprintf ( fMakefile
, "\t$(ECHO_WIDL)\n" );
1005 fprintf ( fMakefile
,
1006 "\t%s %s -h -H %s -c -C %s %s\n",
1007 "$(Q)$(WIDL_TARGET)",
1008 widlflagsMacro
.c_str (),
1009 generatedHeaderFilename
.c_str (),
1010 generatedClientFilename
.c_str (),
1011 sourceFilename
.c_str () );
1015 MingwModuleHandler::GenerateWidlCommands (
1016 const string
& sourceFilename
,
1017 const string
& widlflagsMacro
)
1019 if ( module
.type
== RpcServer
)
1020 GenerateWidlCommandsServer ( sourceFilename
,
1023 GenerateWidlCommandsClient ( sourceFilename
,
1028 MingwModuleHandler::GenerateCommands (
1029 const string
& sourceFilename
,
1032 const string
& cflagsMacro
,
1033 const string
& nasmflagsMacro
,
1034 const string
& windresflagsMacro
,
1035 const string
& widlflagsMacro
)
1037 string extension
= GetExtension ( sourceFilename
);
1038 if ( extension
== ".c" || extension
== ".C" )
1040 GenerateGccCommand ( sourceFilename
,
1045 else if ( extension
== ".cc" || extension
== ".CC" ||
1046 extension
== ".cpp" || extension
== ".CPP" ||
1047 extension
== ".cxx" || extension
== ".CXX" )
1049 GenerateGccCommand ( sourceFilename
,
1054 else if ( extension
== ".s" || extension
== ".S" )
1056 GenerateGccAssemblerCommand ( sourceFilename
,
1061 else if ( extension
== ".asm" || extension
== ".ASM" )
1063 GenerateNasmCommand ( sourceFilename
,
1067 else if ( extension
== ".rc" || extension
== ".RC" )
1069 GenerateWindresCommand ( sourceFilename
,
1070 windresflagsMacro
);
1073 else if ( extension
== ".spec" || extension
== ".SPEC" )
1075 GenerateWinebuildCommands ( sourceFilename
);
1076 GenerateGccCommand ( GetActualSourceFilename ( sourceFilename
),
1081 else if ( extension
== ".idl" || extension
== ".IDL" )
1083 GenerateWidlCommands ( sourceFilename
,
1085 GenerateGccCommand ( GetActualSourceFilename ( sourceFilename
),
1091 throw InvalidOperationException ( __FILE__
,
1093 "Unsupported filename extension '%s' in file '%s'",
1095 sourceFilename
.c_str () );
1099 MingwModuleHandler::GenerateBuildMapCode ()
1101 fprintf ( fMakefile
,
1102 "ifeq ($(ROS_BUILDMAP),full)\n" );
1104 string mapFilename
= PassThruCacheDirectory (
1105 GetBasename ( module
.GetPath () ) + ".map",
1106 backend
->outputDirectory
);
1107 CLEAN_FILE ( mapFilename
);
1109 fprintf ( fMakefile
,
1110 "\t$(ECHO_OBJDUMP)\n" );
1111 fprintf ( fMakefile
,
1112 "\t$(Q)${objdump} -d -S $@ > %s\n",
1113 mapFilename
.c_str () );
1115 fprintf ( fMakefile
,
1117 fprintf ( fMakefile
,
1118 "ifeq ($(ROS_BUILDMAP),yes)\n" );
1120 fprintf ( fMakefile
,
1122 fprintf ( fMakefile
,
1123 "\t$(Q)${nm} --numeric-sort $@ > %s\n",
1124 mapFilename
.c_str () );
1126 fprintf ( fMakefile
,
1129 fprintf ( fMakefile
,
1134 MingwModuleHandler::GenerateLinkerCommand (
1135 const string
& dependencies
,
1136 const string
& linker
,
1137 const string
& linkerParameters
,
1138 const string
& objectsMacro
,
1139 const string
& libsMacro
)
1141 string
target ( GetTargetMacro ( module
) );
1142 string
target_folder ( GetDirectory ( GetTargetFilename ( module
, NULL
) ) );
1144 fprintf ( fMakefile
,
1145 "%s: %s $(RSYM_TARGET) | %s\n",
1147 dependencies
.c_str (),
1148 target_folder
.c_str () );
1149 fprintf ( fMakefile
, "\t$(ECHO_LD)\n" );
1150 string
targetName ( module
.GetTargetName () );
1151 if ( module
.importLibrary
!= NULL
)
1153 string base_tmp
= ros_temp
+ module
.name
+ ".base.tmp";
1154 CLEAN_FILE ( base_tmp
);
1155 string junk_tmp
= ros_temp
+ module
.name
+ ".junk.tmp";
1156 CLEAN_FILE ( junk_tmp
);
1157 string temp_exp
= ros_temp
+ module
.name
+ ".temp.exp";
1158 CLEAN_FILE ( temp_exp
);
1159 string def_file
= GetDefinitionFilename ();
1161 fprintf ( fMakefile
,
1162 "\t%s %s -Wl,--base-file,%s -o %s %s %s %s\n",
1164 linkerParameters
.c_str (),
1167 objectsMacro
.c_str (),
1169 GetLinkerMacro ().c_str () );
1171 fprintf ( fMakefile
,
1172 "\t-@${rm} %s 2>$(NUL)\n",
1173 junk_tmp
.c_str () );
1175 string killAt
= module
.mangledSymbols
? "" : "--kill-at";
1176 fprintf ( fMakefile
,
1177 "\t${dlltool} --dllname %s --base-file %s --def %s --output-exp %s %s\n",
1178 targetName
.c_str (),
1184 fprintf ( fMakefile
,
1185 "\t-@${rm} %s 2>$(NUL)\n",
1186 base_tmp
.c_str () );
1188 fprintf ( fMakefile
,
1189 "\t%s %s %s -o %s %s %s %s\n",
1191 linkerParameters
.c_str (),
1194 objectsMacro
.c_str (),
1196 GetLinkerMacro ().c_str () );
1198 fprintf ( fMakefile
,
1199 "\t-@${rm} %s 2>$(NUL)\n",
1200 temp_exp
.c_str () );
1204 fprintf ( fMakefile
,
1205 "\t%s %s -o %s %s %s %s\n",
1207 linkerParameters
.c_str (),
1209 objectsMacro
.c_str (),
1211 GetLinkerMacro ().c_str () );
1214 GenerateBuildMapCode ();
1216 fprintf ( fMakefile
,
1217 "\t$(ECHO_RSYM)\n" );
1218 fprintf ( fMakefile
,
1219 "\t$(Q)$(RSYM_TARGET) $@ $@\n\n" );
1223 MingwModuleHandler::GeneratePhonyTarget() const
1225 string
targetMacro ( GetTargetMacro(module
) );
1226 fprintf ( fMakefile
, ".PHONY: %s\n\n",
1227 targetMacro
.c_str ());
1228 fprintf ( fMakefile
, "%s: | %s\n",
1229 targetMacro
.c_str (),
1230 GetDirectory(GetTargetFilename(module
,NULL
)).c_str () );
1234 MingwModuleHandler::GenerateObjectFileTargets (
1235 const IfableData
& data
,
1238 const string
& cflagsMacro
,
1239 const string
& nasmflagsMacro
,
1240 const string
& windresflagsMacro
,
1241 const string
& widlflagsMacro
)
1245 const vector
<File
*>& files
= data
.files
;
1246 for ( i
= 0; i
< files
.size (); i
++ )
1248 string sourceFilename
= files
[i
]->name
;
1249 GenerateCommands ( sourceFilename
,
1256 fprintf ( fMakefile
,
1260 const vector
<If
*>& ifs
= data
.ifs
;
1261 for ( i
= 0; i
< ifs
.size(); i
++ )
1263 GenerateObjectFileTargets ( ifs
[i
]->data
,
1274 MingwModuleHandler::GenerateObjectFileTargets (
1277 const string
& cflagsMacro
,
1278 const string
& nasmflagsMacro
,
1279 const string
& windresflagsMacro
,
1280 const string
& widlflagsMacro
)
1284 const string
& pch_file
= module
.pch
->header
;
1285 string gch_file
= pch_file
+ ".gch";
1286 CLEAN_FILE(gch_file
);
1294 fprintf ( fMakefile
, "\t$(ECHO_PCH)\n" );
1297 "\t%s -o %s %s -g %s\n\n",
1298 ( module
.cplusplus
? cppc
.c_str() : cc
.c_str() ),
1300 cflagsMacro
.c_str(),
1305 GenerateObjectFileTargets ( module
.non_if_data
,
1312 fprintf ( fMakefile
, "\n" );
1316 MingwModuleHandler::GenerateArchiveTarget ( const string
& ar
,
1317 const string
& objs_macro
) const
1319 string
archiveFilename ( GetModuleArchiveFilename () );
1321 fprintf ( fMakefile
,
1323 archiveFilename
.c_str (),
1324 objs_macro
.c_str (),
1325 GetDirectory(archiveFilename
).c_str() );
1327 fprintf ( fMakefile
, "\t$(ECHO_AR)\n" );
1329 fprintf ( fMakefile
,
1330 "\t%s -rc $@ %s\n\n",
1332 objs_macro
.c_str ());
1334 return archiveFilename
;
1338 MingwModuleHandler::GetCFlagsMacro () const
1340 return ssprintf ( "$(%s_CFLAGS)",
1341 module
.name
.c_str () );
1345 MingwModuleHandler::GetObjectsMacro ( const Module
& module
)
1347 return ssprintf ( "$(%s_OBJS)",
1348 module
.name
.c_str () );
1352 MingwModuleHandler::GetLinkingDependenciesMacro () const
1354 return ssprintf ( "$(%s_LINKDEPS)", module
.name
.c_str () );
1358 MingwModuleHandler::GetLibsMacro () const
1360 return ssprintf ( "$(%s_LIBS)", module
.name
.c_str () );
1364 MingwModuleHandler::GetLinkerMacro () const
1366 return ssprintf ( "$(%s_LFLAGS)",
1367 module
.name
.c_str () );
1371 MingwModuleHandler::GetModuleTargets ( const Module
& module
)
1373 if ( ReferenceObjects ( module
) )
1374 return GetObjectsMacro ( module
);
1376 return GetTargetFilename ( module
, NULL
);
1380 MingwModuleHandler::GenerateObjectMacro ()
1382 objectsMacro
= ssprintf ("%s_OBJS", module
.name
.c_str ());
1384 GenerateObjectMacros (
1387 &module
.compilerFlags
,
1388 &module
.linkerFlags
);
1390 // future references to the macro will be to get its values
1391 objectsMacro
= ssprintf ("$(%s)", objectsMacro
.c_str ());
1395 MingwModuleHandler::GenerateTargetMacro ()
1397 fprintf ( fMakefile
,
1399 GetTargetMacro ( module
, false ).c_str (),
1400 GetModuleTargets ( module
).c_str () );
1404 MingwModuleHandler::GenerateOtherMacros ()
1406 cflagsMacro
= ssprintf ("%s_CFLAGS", module
.name
.c_str ());
1407 nasmflagsMacro
= ssprintf ("%s_NASMFLAGS", module
.name
.c_str ());
1408 windresflagsMacro
= ssprintf ("%s_RCFLAGS", module
.name
.c_str ());
1409 widlflagsMacro
= ssprintf ("%s_WIDLFLAGS", module
.name
.c_str ());
1410 linkerflagsMacro
= ssprintf ("%s_LFLAGS", module
.name
.c_str ());
1411 libsMacro
= ssprintf("%s_LIBS", module
.name
.c_str ());
1412 linkDepsMacro
= ssprintf ("%s_LINKDEPS", module
.name
.c_str ());
1417 &module
.compilerFlags
,
1418 &module
.linkerFlags
);
1420 if ( module
.importLibrary
)
1423 const vector
<File
*>& files
= module
.non_if_data
.files
;
1424 for ( size_t i
= 0; i
< files
.size (); i
++ )
1426 File
& file
= *files
[i
];
1427 string extension
= GetExtension ( file
.name
);
1428 if ( extension
== ".spec" || extension
== ".SPEC" )
1429 GetSpecObjectDependencies ( s
, file
.name
);
1431 if ( s
.size () > 0 )
1436 linkDepsMacro
.c_str() );
1437 for ( size_t i
= 0; i
< s
.size(); i
++ )
1438 fprintf ( fMakefile
,
1441 fprintf ( fMakefile
, "\n" );
1445 string globalCflags
= "-g";
1446 if ( backend
->usePipe
)
1447 globalCflags
+= " -pipe";
1451 "%s += $(PROJECT_CFLAGS) %s\n",
1452 cflagsMacro
.c_str (),
1453 globalCflags
.c_str () );
1457 "%s += $(PROJECT_RCFLAGS)\n",
1458 windresflagsMacro
.c_str () );
1462 "%s += $(PROJECT_WIDLFLAGS)\n",
1463 widlflagsMacro
.c_str () );
1467 "%s_LFLAGS += $(PROJECT_LFLAGS) -g\n",
1468 module
.name
.c_str () );
1473 linkDepsMacro
.c_str (),
1474 libsMacro
.c_str () );
1476 string cflags
= TypeSpecificCFlags();
1477 if ( cflags
.size() > 0 )
1479 fprintf ( fMakefile
,
1481 cflagsMacro
.c_str (),
1485 string nasmflags
= TypeSpecificNasmFlags();
1486 if ( nasmflags
.size () > 0 )
1488 fprintf ( fMakefile
,
1490 nasmflagsMacro
.c_str (),
1491 nasmflags
.c_str () );
1494 fprintf ( fMakefile
, "\n\n" );
1496 // future references to the macros will be to get their values
1497 cflagsMacro
= ssprintf ("$(%s)", cflagsMacro
.c_str ());
1498 nasmflagsMacro
= ssprintf ("$(%s)", nasmflagsMacro
.c_str ());
1499 widlflagsMacro
= ssprintf ("$(%s)", widlflagsMacro
.c_str ());
1503 MingwModuleHandler::GenerateRules ()
1505 string cc
= ( module
.host
== HostTrue
? "${host_gcc}" : "${gcc}" );
1506 string cppc
= ( module
.host
== HostTrue
? "${host_gpp}" : "${gpp}" );
1507 string ar
= ( module
.host
== HostTrue
? "${host_ar}" : "${ar}" );
1509 string targetMacro
= GetTargetMacro ( module
);
1511 CLEAN_FILE ( targetMacro
);
1513 // generate phony target for module name
1514 fprintf ( fMakefile
, ".PHONY: %s\n",
1515 module
.name
.c_str () );
1516 fprintf ( fMakefile
, "%s: %s\n\n",
1517 module
.name
.c_str (),
1518 GetTargetMacro ( module
).c_str () );
1520 if ( !ReferenceObjects ( module
) )
1522 string
ar_target ( GenerateArchiveTarget ( ar
, objectsMacro
) );
1523 if ( targetMacro
!= ar_target
)
1525 CLEAN_FILE ( ar_target
);
1529 GenerateObjectFileTargets ( cc
,
1538 MingwModuleHandler::GetInvocationDependencies (
1539 const Module
& module
,
1540 string_list
& dependencies
)
1542 for ( size_t i
= 0; i
< module
.invocations
.size (); i
++ )
1544 Invoke
& invoke
= *module
.invocations
[i
];
1545 if ( invoke
.invokeModule
== &module
)
1546 /* Protect against circular dependencies */
1548 invoke
.GetTargets ( dependencies
);
1553 MingwModuleHandler::GenerateInvocations () const
1555 if ( module
.invocations
.size () == 0 )
1558 size_t iend
= module
.invocations
.size ();
1559 for ( size_t i
= 0; i
< iend
; i
++ )
1561 const Invoke
& invoke
= *module
.invocations
[i
];
1563 if ( invoke
.invokeModule
->type
!= BuildTool
)
1565 throw InvalidBuildFileException ( module
.node
.location
,
1566 "Only modules of type buildtool can be invoked." );
1569 string invokeTarget
= module
.GetInvocationTarget ( i
);
1570 string_list invoke_targets
;
1571 assert ( invoke_targets
.size() );
1572 invoke
.GetTargets ( invoke_targets
);
1573 fprintf ( fMakefile
,
1575 invokeTarget
.c_str () );
1576 fprintf ( fMakefile
,
1578 invokeTarget
.c_str () );
1579 size_t j
, jend
= invoke_targets
.size();
1580 for ( j
= 0; j
< jend
; j
++ )
1582 fprintf ( fMakefile
,
1584 invoke_targets
[i
].c_str () );
1586 fprintf ( fMakefile
, "\n\n%s", invoke_targets
[0].c_str () );
1587 for ( j
= 1; j
< jend
; j
++ )
1588 fprintf ( fMakefile
,
1590 invoke_targets
[i
].c_str () );
1591 fprintf ( fMakefile
,
1593 NormalizeFilename ( invoke
.invokeModule
->GetPath () ).c_str () );
1594 fprintf ( fMakefile
, "\t$(ECHO_INVOKE)\n" );
1595 fprintf ( fMakefile
,
1597 NormalizeFilename ( invoke
.invokeModule
->GetPath () ).c_str (),
1598 invoke
.GetParameters ().c_str () );
1603 MingwModuleHandler::GetPreconditionDependenciesName () const
1605 return module
.name
+ "_precondition";
1609 MingwModuleHandler::GetDefaultDependencies (
1610 string_list
& dependencies
) const
1612 /* Avoid circular dependency */
1613 if ( module
.type
!= BuildTool
1614 && module
.name
!= "zlib"
1615 && module
.name
!= "hostzlib" )
1617 dependencies
.push_back ( "$(INIT)" );
1621 MingwModuleHandler::GeneratePreconditionDependencies ()
1623 string preconditionDependenciesName
= GetPreconditionDependenciesName ();
1624 string_list sourceFilenames
;
1625 GetSourceFilenamesWithoutGeneratedFiles ( sourceFilenames
);
1626 string_list dependencies
;
1627 GetDefaultDependencies ( dependencies
);
1628 GetModuleDependencies ( dependencies
);
1630 GetInvocationDependencies ( module
, dependencies
);
1632 if ( dependencies
.size() )
1634 fprintf ( fMakefile
,
1636 preconditionDependenciesName
.c_str () );
1637 for ( size_t i
= 0; i
< dependencies
.size(); i
++ )
1638 fprintf ( fMakefile
,
1640 dependencies
[i
].c_str () );
1641 fprintf ( fMakefile
, "\n\n" );
1644 for ( size_t i
= 0; i
< sourceFilenames
.size(); i
++ )
1646 fprintf ( fMakefile
,
1648 sourceFilenames
[i
].c_str(),
1649 preconditionDependenciesName
.c_str ());
1651 fprintf ( fMakefile
, "\n" );
1655 MingwModuleHandler::IsWineModule () const
1657 if ( module
.importLibrary
== NULL
)
1660 size_t index
= module
.importLibrary
->definition
.rfind ( ".spec.def" );
1661 return ( index
!= string::npos
);
1665 MingwModuleHandler::GetDefinitionFilename () const
1667 string defFilename
= module
.GetBasePath () + SSEP
+ module
.importLibrary
->definition
;
1668 if ( IsWineModule () )
1669 return PassThruCacheDirectory ( NormalizeFilename ( defFilename
),
1670 backend
->intermediateDirectory
);
1676 MingwModuleHandler::GenerateImportLibraryTargetIfNeeded ()
1678 if ( module
.importLibrary
!= NULL
)
1680 string
library_target (
1681 GetImportLibraryFilename ( module
, &clean_files
) );
1684 GetDefinitionDependencies ( deps
);
1686 fprintf ( fMakefile
, "# IMPORT LIBRARY RULE:\n" );
1688 fprintf ( fMakefile
, "%s:",
1689 library_target
.c_str () );
1691 size_t i
, iend
= deps
.size();
1692 for ( i
= 0; i
< iend
; i
++ )
1693 fprintf ( fMakefile
, " %s",
1696 fprintf ( fMakefile
, " | %s\n",
1697 GetDirectory ( GetTargetFilename ( module
, NULL
) ).c_str () );
1699 fprintf ( fMakefile
, "\t$(ECHO_DLLTOOL)\n" );
1701 string killAt
= module
.mangledSymbols
? "" : "--kill-at";
1702 fprintf ( fMakefile
,
1703 "\t${dlltool} --dllname %s --def %s --output-lib %s %s\n\n",
1704 module
.GetTargetName ().c_str (),
1705 GetDefinitionFilename ().c_str (),
1706 library_target
.c_str (),
1712 MingwModuleHandler::GetSpecObjectDependencies (
1713 string_list
& dependencies
,
1714 const string
& filename
) const
1716 string basename
= GetBasename ( filename
);
1717 string defDependency
= PassThruCacheDirectory (
1718 NormalizeFilename ( basename
+ ".spec.def" ),
1719 backend
->intermediateDirectory
);
1720 dependencies
.push_back ( defDependency
);
1721 string stubsDependency
= PassThruCacheDirectory (
1722 NormalizeFilename ( basename
+ ".stubs.c" ),
1723 backend
->intermediateDirectory
);
1724 dependencies
.push_back ( stubsDependency
);
1728 MingwModuleHandler::GetWidlObjectDependencies (
1729 string_list
& dependencies
,
1730 const string
& filename
) const
1732 string basename
= GetBasename ( filename
);
1733 string serverDependency
= PassThruCacheDirectory (
1734 NormalizeFilename ( basename
+ "_s.c" ),
1735 backend
->intermediateDirectory
);
1736 dependencies
.push_back ( serverDependency
);
1740 MingwModuleHandler::GetDefinitionDependencies (
1741 string_list
& dependencies
) const
1743 string dkNkmLibNoFixup
= "dk/nkm/lib";
1744 const vector
<File
*>& files
= module
.non_if_data
.files
;
1745 for ( size_t i
= 0; i
< files
.size (); i
++ )
1747 File
& file
= *files
[i
];
1748 string extension
= GetExtension ( file
.name
);
1749 if ( extension
== ".spec" || extension
== ".SPEC" )
1751 GetSpecObjectDependencies ( dependencies
, file
.name
);
1753 if ( extension
== ".idl" || extension
== ".IDL" )
1755 GetWidlObjectDependencies ( dependencies
, file
.name
);
1761 MingwBuildToolModuleHandler::MingwBuildToolModuleHandler ( const Module
& module_
)
1762 : MingwModuleHandler ( module_
)
1767 MingwBuildToolModuleHandler::Process ()
1769 GenerateBuildToolModuleTarget ();
1773 MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget ()
1775 string
targetMacro ( GetTargetMacro (module
) );
1776 string objectsMacro
= GetObjectsMacro ( module
);
1777 string linkDepsMacro
= GetLinkingDependenciesMacro ();
1778 string libsMacro
= GetLibsMacro ();
1783 if ( module
.cplusplus
)
1784 linker
= "${host_gpp}";
1786 linker
= "${host_gcc}";
1788 fprintf ( fMakefile
, "%s: %s %s | %s\n",
1789 targetMacro
.c_str (),
1790 objectsMacro
.c_str (),
1791 linkDepsMacro
.c_str (),
1792 GetDirectory(GetTargetFilename(module
,NULL
)).c_str () );
1793 fprintf ( fMakefile
, "\t$(ECHO_LD)\n" );
1794 fprintf ( fMakefile
,
1795 "\t%s %s -o $@ %s %s\n\n",
1797 GetLinkerMacro ().c_str (),
1798 objectsMacro
.c_str (),
1799 libsMacro
.c_str () );
1803 MingwKernelModuleHandler::MingwKernelModuleHandler (
1804 const Module
& module_
)
1806 : MingwModuleHandler ( module_
)
1811 MingwKernelModuleHandler::Process ()
1813 GenerateKernelModuleTarget ();
1817 MingwKernelModuleHandler::GenerateKernelModuleTarget ()
1819 string
targetName ( module
.GetTargetName () ); // i.e. "ntoskrnl.exe"
1820 string
targetMacro ( GetTargetMacro ( module
) ); // i.e. "$(NTOSKRNL_TARGET)"
1821 string workingDirectory
= GetWorkingDirectory ();
1822 string objectsMacro
= GetObjectsMacro ( module
);
1823 string linkDepsMacro
= GetLinkingDependenciesMacro ();
1824 string libsMacro
= GetLibsMacro ();
1825 string base_tmp
= ros_temp
+ module
.name
+ ".base.tmp";
1826 CLEAN_FILE ( base_tmp
);
1827 string junk_tmp
= ros_temp
+ module
.name
+ ".junk.tmp";
1828 CLEAN_FILE ( junk_tmp
);
1829 string temp_exp
= ros_temp
+ module
.name
+ ".temp.exp";
1830 CLEAN_FILE ( temp_exp
);
1831 string gccOptions
= ssprintf ("-Wl,-T,%s" SSEP
"ntoskrnl.lnk -Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll",
1832 module
.GetBasePath ().c_str (),
1833 module
.entrypoint
.c_str (),
1834 module
.baseaddress
.c_str () );
1838 GenerateImportLibraryTargetIfNeeded ();
1840 fprintf ( fMakefile
, "%s: %s %s $(RSYM_TARGET) | %s\n",
1841 targetMacro
.c_str (),
1842 objectsMacro
.c_str (),
1843 linkDepsMacro
.c_str (),
1844 GetDirectory(GetTargetFilename(module
,NULL
)).c_str () );
1845 fprintf ( fMakefile
, "\t$(ECHO_LD)\n" );
1846 fprintf ( fMakefile
,
1847 "\t${gcc} %s %s -Wl,--base-file,%s -o %s %s %s\n",
1848 GetLinkerMacro ().c_str (),
1849 gccOptions
.c_str (),
1852 objectsMacro
.c_str (),
1853 linkDepsMacro
.c_str () );
1854 fprintf ( fMakefile
,
1855 "\t-@${rm} %s 2>$(NUL)\n",
1856 junk_tmp
.c_str () );
1857 string killAt
= module
.mangledSymbols
? "" : "--kill-at";
1858 fprintf ( fMakefile
,
1859 "\t${dlltool} --dllname %s --base-file %s --def ntoskrnl/ntoskrnl.def --output-exp %s %s\n",
1860 targetName
.c_str (),
1864 fprintf ( fMakefile
,
1865 "\t-@${rm} %s 2>$(NUL)\n",
1866 base_tmp
.c_str () );
1867 fprintf ( fMakefile
,
1868 "\t${gcc} %s %s -Wl,%s -o $@ %s %s\n",
1869 GetLinkerMacro ().c_str (),
1870 gccOptions
.c_str (),
1872 objectsMacro
.c_str (),
1873 linkDepsMacro
.c_str () );
1874 fprintf ( fMakefile
,
1875 "\t-@${rm} %s 2>$(NUL)\n",
1876 temp_exp
.c_str () );
1877 fprintf ( fMakefile
, "\t$(ECHO_RSYM)\n" );
1878 fprintf ( fMakefile
,
1879 "\t$(Q)$(RSYM_TARGET) $@ $@\n\n" );
1883 MingwStaticLibraryModuleHandler::MingwStaticLibraryModuleHandler (
1884 const Module
& module_
)
1886 : MingwModuleHandler ( module_
)
1891 MingwStaticLibraryModuleHandler::Process ()
1893 GenerateStaticLibraryModuleTarget ();
1897 MingwStaticLibraryModuleHandler::GenerateStaticLibraryModuleTarget ()
1903 MingwObjectLibraryModuleHandler::MingwObjectLibraryModuleHandler (
1904 const Module
& module_
)
1906 : MingwModuleHandler ( module_
)
1911 MingwObjectLibraryModuleHandler::Process ()
1913 GenerateObjectLibraryModuleTarget ();
1917 MingwObjectLibraryModuleHandler::GenerateObjectLibraryModuleTarget ()
1923 MingwKernelModeDLLModuleHandler::MingwKernelModeDLLModuleHandler (
1924 const Module
& module_
)
1926 : MingwModuleHandler ( module_
)
1931 MingwKernelModeDLLModuleHandler::Process ()
1933 GenerateKernelModeDLLModuleTarget ();
1937 MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ()
1939 string
targetMacro ( GetTargetMacro ( module
) );
1940 string workingDirectory
= GetWorkingDirectory ( );
1941 string objectsMacro
= GetObjectsMacro ( module
);
1942 string linkDepsMacro
= GetLinkingDependenciesMacro ();
1943 string libsMacro
= GetLibsMacro ();
1945 GenerateImportLibraryTargetIfNeeded ();
1947 if ( module
.non_if_data
.files
.size () > 0 )
1951 string dependencies
=
1952 objectsMacro
+ " " + linkDepsMacro
;
1954 string linkerParameters
= ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll",
1955 module
.entrypoint
.c_str (),
1956 module
.baseaddress
.c_str () );
1957 GenerateLinkerCommand ( dependencies
,
1965 GeneratePhonyTarget();
1970 MingwKernelModeDriverModuleHandler::MingwKernelModeDriverModuleHandler (
1971 const Module
& module_
)
1973 : MingwModuleHandler ( module_
)
1978 MingwKernelModeDriverModuleHandler::Process ()
1980 GenerateKernelModeDriverModuleTarget ();
1985 MingwKernelModeDriverModuleHandler::GenerateKernelModeDriverModuleTarget ()
1987 string
targetMacro ( GetTargetMacro (module
) );
1988 string workingDirectory
= GetWorkingDirectory ();
1989 string objectsMacro
= GetObjectsMacro ( module
);
1990 string linkDepsMacro
= GetLinkingDependenciesMacro ();
1991 string libsMacro
= GetLibsMacro ();
1993 GenerateImportLibraryTargetIfNeeded ();
1995 if ( module
.non_if_data
.files
.size () > 0 )
1999 string dependencies
= objectsMacro
+ " " + linkDepsMacro
;
2001 string linkerParameters
= ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll",
2002 module
.entrypoint
.c_str (),
2003 module
.baseaddress
.c_str () );
2004 GenerateLinkerCommand ( dependencies
,
2012 GeneratePhonyTarget();
2017 MingwNativeDLLModuleHandler::MingwNativeDLLModuleHandler (
2018 const Module
& module_
)
2020 : MingwModuleHandler ( module_
)
2025 MingwNativeDLLModuleHandler::Process ()
2027 GenerateNativeDLLModuleTarget ();
2031 MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ()
2033 string
targetMacro ( GetTargetMacro (module
) );
2034 string workingDirectory
= GetWorkingDirectory ( );
2035 string objectsMacro
= GetObjectsMacro ( module
);
2036 string linkDepsMacro
= GetLinkingDependenciesMacro ();
2037 string libsMacro
= GetLibsMacro ();
2039 GenerateImportLibraryTargetIfNeeded ();
2041 if ( module
.non_if_data
.files
.size () > 0 )
2045 string dependencies
=
2046 objectsMacro
+ " " + linkDepsMacro
;
2048 string linkerParameters
= ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib -mdll",
2049 module
.entrypoint
.c_str (),
2050 module
.baseaddress
.c_str () );
2051 GenerateLinkerCommand ( dependencies
,
2059 GeneratePhonyTarget();
2064 MingwNativeCUIModuleHandler::MingwNativeCUIModuleHandler (
2065 const Module
& module_
)
2067 : MingwModuleHandler ( module_
)
2072 MingwNativeCUIModuleHandler::Process ()
2074 GenerateNativeCUIModuleTarget ();
2078 MingwNativeCUIModuleHandler::GenerateNativeCUIModuleTarget ()
2080 string
targetMacro ( GetTargetMacro (module
) );
2081 string workingDirectory
= GetWorkingDirectory ( );
2082 string objectsMacro
= GetObjectsMacro ( module
);
2083 string linkDepsMacro
= GetLinkingDependenciesMacro ();
2084 string libsMacro
= GetLibsMacro ();
2086 GenerateImportLibraryTargetIfNeeded ();
2088 if ( module
.non_if_data
.files
.size () > 0 )
2092 string dependencies
=
2093 objectsMacro
+ " " + linkDepsMacro
;
2095 string linkerParameters
= ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib",
2096 module
.entrypoint
.c_str (),
2097 module
.baseaddress
.c_str () );
2098 GenerateLinkerCommand ( dependencies
,
2106 GeneratePhonyTarget();
2111 MingwWin32DLLModuleHandler::MingwWin32DLLModuleHandler (
2112 const Module
& module_
)
2114 : MingwModuleHandler ( module_
)
2119 MingwWin32DLLModuleHandler::Process ()
2121 GenerateExtractWineDLLResourcesTarget ();
2122 GenerateWin32DLLModuleTarget ();
2126 MingwWin32DLLModuleHandler::GenerateExtractWineDLLResourcesTarget ()
2128 fprintf ( fMakefile
, ".PHONY: %s_extractresources\n\n",
2129 module
.name
.c_str () );
2130 fprintf ( fMakefile
, "%s_extractresources: $(BIN2RES_TARGET)\n",
2131 module
.name
.c_str () );
2132 const vector
<File
*>& files
= module
.non_if_data
.files
;
2133 for ( size_t i
= 0; i
< files
.size (); i
++ )
2135 File
& file
= *files
[i
];
2136 string extension
= GetExtension ( file
.name
);
2137 if ( extension
== ".rc" || extension
== ".RC" )
2139 string resource
= NormalizeFilename ( file
.name
);
2140 fprintf ( fMakefile
, "\t$(ECHO_BIN2RES)\n" );
2141 fprintf ( fMakefile
, "\t@:echo ${bin2res} -f -x %s\n",
2142 resource
.c_str () );
2145 fprintf ( fMakefile
, "\n");
2149 MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ()
2151 string
targetMacro ( GetTargetMacro (module
) );
2152 string workingDirectory
= GetWorkingDirectory ( );
2153 string objectsMacro
= GetObjectsMacro ( module
);
2154 string linkDepsMacro
= GetLinkingDependenciesMacro ();
2155 string libsMacro
= GetLibsMacro ();
2157 GenerateImportLibraryTargetIfNeeded ();
2159 if ( module
.non_if_data
.files
.size () > 0 )
2163 string dependencies
= objectsMacro
+ " " + linkDepsMacro
;
2166 if ( module
.cplusplus
)
2171 string linkerParameters
= ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -mdll",
2172 module
.entrypoint
.c_str (),
2173 module
.baseaddress
.c_str () );
2174 GenerateLinkerCommand ( dependencies
,
2182 GeneratePhonyTarget();
2187 MingwWin32CUIModuleHandler::MingwWin32CUIModuleHandler (
2188 const Module
& module_
)
2190 : MingwModuleHandler ( module_
)
2195 MingwWin32CUIModuleHandler::Process ()
2197 GenerateWin32CUIModuleTarget ();
2201 MingwWin32CUIModuleHandler::GenerateWin32CUIModuleTarget ()
2203 string
targetMacro ( GetTargetMacro (module
) );
2204 string workingDirectory
= GetWorkingDirectory ( );
2205 string objectsMacro
= GetObjectsMacro ( module
);
2206 string linkDepsMacro
= GetLinkingDependenciesMacro ();
2207 string libsMacro
= GetLibsMacro ();
2209 GenerateImportLibraryTargetIfNeeded ();
2211 if ( module
.non_if_data
.files
.size () > 0 )
2215 string dependencies
=
2216 objectsMacro
+ " " + linkDepsMacro
;
2219 if ( module
.cplusplus
)
2224 string linkerParameters
= ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000",
2225 module
.entrypoint
.c_str (),
2226 module
.baseaddress
.c_str () );
2227 GenerateLinkerCommand ( dependencies
,
2235 GeneratePhonyTarget();
2240 MingwWin32GUIModuleHandler::MingwWin32GUIModuleHandler (
2241 const Module
& module_
)
2243 : MingwModuleHandler ( module_
)
2248 MingwWin32GUIModuleHandler::Process ()
2250 GenerateWin32GUIModuleTarget ();
2254 MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget ()
2256 string
targetMacro ( GetTargetMacro (module
) );
2257 string workingDirectory
= GetWorkingDirectory ( );
2258 string objectsMacro
= GetObjectsMacro ( module
);
2259 string linkDepsMacro
= GetLinkingDependenciesMacro ();
2260 string libsMacro
= GetLibsMacro ();
2262 GenerateImportLibraryTargetIfNeeded ();
2264 if ( module
.non_if_data
.files
.size () > 0 )
2268 string dependencies
=
2269 objectsMacro
+ " " + linkDepsMacro
;
2272 if ( module
.cplusplus
)
2277 string linkerParameters
= ssprintf ( "-Wl,--subsystem,windows -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000",
2278 module
.entrypoint
.c_str (),
2279 module
.baseaddress
.c_str () );
2280 GenerateLinkerCommand ( dependencies
,
2288 GeneratePhonyTarget();
2293 MingwBootLoaderModuleHandler::MingwBootLoaderModuleHandler (
2294 const Module
& module_
)
2296 : MingwModuleHandler ( module_
)
2301 MingwBootLoaderModuleHandler::Process ()
2303 GenerateBootLoaderModuleTarget ();
2307 MingwBootLoaderModuleHandler::GenerateBootLoaderModuleTarget ()
2309 string
targetName ( module
.GetTargetName () );
2310 string
targetMacro ( GetTargetMacro (module
) );
2311 string workingDirectory
= GetWorkingDirectory ();
2312 string junk_tmp
= ros_temp
+ module
.name
+ ".junk.tmp";
2313 CLEAN_FILE ( junk_tmp
);
2314 string objectsMacro
= GetObjectsMacro ( module
);
2315 string linkDepsMacro
= GetLinkingDependenciesMacro ();
2316 string libsMacro
= GetLibsMacro ();
2320 fprintf ( fMakefile
, "%s: %s %s | %s\n",
2321 targetMacro
.c_str (),
2322 objectsMacro
.c_str (),
2323 linkDepsMacro
.c_str (),
2324 GetDirectory(GetTargetFilename(module
,NULL
)).c_str () );
2326 fprintf ( fMakefile
, "\t$(ECHO_LD)\n" );
2328 fprintf ( fMakefile
,
2329 "\t${ld} %s -N -Ttext=0x8000 -o %s %s %s\n",
2330 GetLinkerMacro ().c_str (),
2332 objectsMacro
.c_str (),
2333 linkDepsMacro
.c_str () );
2334 fprintf ( fMakefile
,
2335 "\t${objcopy} -O binary %s $@\n",
2336 junk_tmp
.c_str () );
2337 fprintf ( fMakefile
,
2338 "\t-@${rm} %s 2>$(NUL)\n",
2339 junk_tmp
.c_str () );
2343 MingwBootSectorModuleHandler::MingwBootSectorModuleHandler (
2344 const Module
& module_
)
2346 : MingwModuleHandler ( module_
)
2351 MingwBootSectorModuleHandler::Process ()
2353 GenerateBootSectorModuleTarget ();
2357 MingwBootSectorModuleHandler::GenerateBootSectorModuleTarget ()
2359 string objectsMacro
= GetObjectsMacro ( module
);
2363 fprintf ( fMakefile
, ".PHONY: %s\n\n",
2364 module
.name
.c_str ());
2365 fprintf ( fMakefile
,
2367 module
.name
.c_str (),
2368 objectsMacro
.c_str () );
2372 MingwIsoModuleHandler::MingwIsoModuleHandler (
2373 const Module
& module_
)
2375 : MingwModuleHandler ( module_
)
2380 MingwIsoModuleHandler::Process ()
2382 GenerateIsoModuleTarget ();
2386 MingwIsoModuleHandler::OutputBootstrapfileCopyCommands (
2387 const string
& bootcdDirectory
)
2389 for ( size_t i
= 0; i
< module
.project
.modules
.size (); i
++ )
2391 const Module
& m
= *module
.project
.modules
[i
];
2392 if ( m
.bootstrap
!= NULL
)
2394 string sourceFilename
= PassThruCacheDirectory (
2395 NormalizeFilename ( m
.GetPath () ),
2396 backend
->outputDirectory
);
2397 string
targetFilenameNoFixup ( bootcdDirectory
+ SSEP
+ m
.bootstrap
->base
+ SSEP
+ m
.bootstrap
->nameoncd
);
2398 string targetFilename
= MingwModuleHandler::PassThruCacheDirectory (
2399 NormalizeFilename ( targetFilenameNoFixup
),
2400 backend
->outputDirectory
);
2401 fprintf ( fMakefile
,
2403 fprintf ( fMakefile
,
2404 "\t${cp} %s %s 1>$(NUL)\n",
2405 sourceFilename
.c_str (),
2406 targetFilename
.c_str () );
2412 MingwIsoModuleHandler::OutputCdfileCopyCommands (
2413 const string
& bootcdDirectory
)
2415 for ( size_t i
= 0; i
< module
.project
.cdfiles
.size (); i
++ )
2417 const CDFile
& cdfile
= *module
.project
.cdfiles
[i
];
2418 string targetFilenameNoFixup
= bootcdDirectory
+ SSEP
+ cdfile
.base
+ SSEP
+ cdfile
.nameoncd
;
2419 string targetFilename
= MingwModuleHandler::PassThruCacheDirectory (
2420 NormalizeFilename ( targetFilenameNoFixup
),
2421 backend
->outputDirectory
);
2422 fprintf ( fMakefile
,
2424 fprintf ( fMakefile
,
2425 "\t${cp} %s %s 1>$(NUL)\n",
2426 cdfile
.GetPath ().c_str (),
2427 targetFilename
.c_str () );
2432 MingwIsoModuleHandler::GetBootstrapCdDirectories ( const string
& bootcdDirectory
)
2435 for ( size_t i
= 0; i
< module
.project
.modules
.size (); i
++ )
2437 const Module
& m
= *module
.project
.modules
[i
];
2438 if ( m
.bootstrap
!= NULL
)
2440 string
targetDirectory ( bootcdDirectory
+ SSEP
+ m
.bootstrap
->base
);
2441 if ( directories
.size () > 0 )
2443 directories
+= PassThruCacheDirectory (
2444 NormalizeFilename ( targetDirectory
),
2445 backend
->outputDirectory
);
2452 MingwIsoModuleHandler::GetNonModuleCdDirectories ( const string
& bootcdDirectory
)
2455 for ( size_t i
= 0; i
< module
.project
.cdfiles
.size (); i
++ )
2457 const CDFile
& cdfile
= *module
.project
.cdfiles
[i
];
2458 string
targetDirectory ( bootcdDirectory
+ SSEP
+ cdfile
.base
);
2459 if ( directories
.size () > 0 )
2461 directories
+= PassThruCacheDirectory (
2462 NormalizeFilename ( targetDirectory
),
2463 backend
->outputDirectory
);
2469 MingwIsoModuleHandler::GetCdDirectories ( const string
& bootcdDirectory
)
2471 string directories
= GetBootstrapCdDirectories ( bootcdDirectory
);
2472 directories
+= " " + GetNonModuleCdDirectories ( bootcdDirectory
);
2477 MingwIsoModuleHandler::GetBootstrapCdFiles (
2478 vector
<string
>& out
) const
2480 for ( size_t i
= 0; i
< module
.project
.modules
.size (); i
++ )
2482 const Module
& m
= *module
.project
.modules
[i
];
2483 if ( m
.bootstrap
!= NULL
)
2485 string filename
= PassThruCacheDirectory (
2486 NormalizeFilename ( m
.GetPath () ),
2487 backend
->outputDirectory
);
2488 out
.push_back ( filename
);
2494 MingwIsoModuleHandler::GetNonModuleCdFiles (
2495 vector
<string
>& out
) const
2497 for ( size_t i
= 0; i
< module
.project
.cdfiles
.size (); i
++ )
2499 const CDFile
& cdfile
= *module
.project
.cdfiles
[i
];
2500 out
.push_back ( cdfile
.GetPath () );
2505 MingwIsoModuleHandler::GetCdFiles (
2506 vector
<string
>& out
) const
2508 GetBootstrapCdFiles ( out
);
2509 GetNonModuleCdFiles ( out
);
2513 MingwIsoModuleHandler::GenerateIsoModuleTarget ()
2515 string bootcdDirectory
= "cd";
2516 string bootcd
= PassThruCacheDirectory (
2517 NormalizeFilename ( bootcdDirectory
+ SSEP
),
2518 backend
->outputDirectory
);
2519 string isoboot
= PassThruCacheDirectory (
2520 NormalizeFilename ( "boot" SSEP
"freeldr" SSEP
"bootsect" SSEP
"isoboot.o" ),
2521 backend
->outputDirectory
);
2522 string bootcdReactosNoFixup
= bootcdDirectory
+ SSEP
"reactos";
2523 string bootcdReactos
= PassThruCacheDirectory (
2524 NormalizeFilename ( bootcdReactosNoFixup
),
2525 backend
->outputDirectory
);
2526 CLEAN_FILE ( bootcdReactos
);
2527 string reactosInf
= PassThruCacheDirectory (
2528 NormalizeFilename ( bootcdReactosNoFixup
+ SSEP
"reactos.inf" ),
2529 backend
->outputDirectory
);
2530 string reactosDff
= NormalizeFilename ( "bootdata" SSEP
"packages" SSEP
"reactos.dff" );
2531 string cdDirectories
= GetCdDirectories ( bootcdDirectory
);
2532 vector
<string
> vCdFiles
;
2533 GetCdFiles ( vCdFiles
);
2534 string cdFiles
= v2s ( vCdFiles
, 5 );
2536 fprintf ( fMakefile
, ".PHONY: %s\n\n",
2537 module
.name
.c_str ());
2538 fprintf ( fMakefile
,
2539 "%s: all %s %s %s %s $(CABMAN_TARGET) $(CDMAKE_TARGET)\n",
2540 module
.name
.c_str (),
2542 bootcdReactos
.c_str (),
2543 cdDirectories
.c_str (),
2545 fprintf ( fMakefile
, "\t$(ECHO_CABMAN)\n" );
2546 fprintf ( fMakefile
,
2547 "\t$(Q)$(CABMAN_TARGET) -C %s -L %s -I -P $(OUTPUT)\n",
2548 reactosDff
.c_str (),
2549 bootcdReactos
.c_str () );
2550 fprintf ( fMakefile
,
2551 "\t$(Q)$(CABMAN_TARGET) -C %s -RC %s -L %s -N -P $(OUTPUT)\n",
2552 reactosDff
.c_str (),
2553 reactosInf
.c_str (),
2554 bootcdReactos
.c_str ());
2555 fprintf ( fMakefile
,
2556 "\t-@${rm} %s 2>$(NUL)\n",
2557 reactosInf
.c_str () );
2558 OutputBootstrapfileCopyCommands ( bootcdDirectory
);
2559 OutputCdfileCopyCommands ( bootcdDirectory
);
2560 fprintf ( fMakefile
, "\t$(ECHO_CDMAKE)\n" );
2561 fprintf ( fMakefile
,
2562 "\t$(Q)$(CDMAKE_TARGET) -v -m -b %s %s REACTOS ReactOS.iso\n",
2565 fprintf ( fMakefile
,
2570 MingwTestModuleHandler::MingwTestModuleHandler (
2571 const Module
& module_
)
2573 : MingwModuleHandler ( module_
)
2578 MingwTestModuleHandler::Process ()
2580 GenerateTestModuleTarget ();
2584 MingwTestModuleHandler::GenerateTestModuleTarget ()
2586 string
targetMacro ( GetTargetMacro ( module
) );
2587 string workingDirectory
= GetWorkingDirectory ( );
2588 string objectsMacro
= GetObjectsMacro ( module
);
2589 string linkDepsMacro
= GetLinkingDependenciesMacro ();
2590 string libsMacro
= GetLibsMacro ();
2592 GenerateImportLibraryTargetIfNeeded ();
2594 if ( module
.non_if_data
.files
.size () > 0 )
2598 string dependencies
= objectsMacro
+ " " + linkDepsMacro
;
2601 if ( module
.cplusplus
)
2606 string linkerParameters
= ssprintf ( "-Wl,--subsystem,console -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000",
2607 module
.entrypoint
.c_str (),
2608 module
.baseaddress
.c_str () );
2609 GenerateLinkerCommand ( dependencies
,
2617 GeneratePhonyTarget();
2622 MingwRpcServerModuleHandler::MingwRpcServerModuleHandler (
2623 const Module
& module_
)
2625 : MingwModuleHandler ( module_
)
2630 MingwRpcServerModuleHandler::Process ()
2635 MingwRpcClientModuleHandler::MingwRpcClientModuleHandler (
2636 const Module
& module_
)
2638 : MingwModuleHandler ( module_
)
2643 MingwRpcClientModuleHandler::Process ()