case IdlHeader:
handler = new MingwIdlHeaderModuleHandler ( module );
break;
+ case Cabinet:
+ handler = new MingwCabinetModuleHandler ( module );
+ break;
case EmbeddedTypeLib:
handler = new MingwEmbeddedTypeLibModuleHandler ( module );
break;
Rule arHostRule2 ( "\t$(ECHO_AR)\n"
"\t${host_ar} -rc $@ $($(module_name)_OBJS)\n",
NULL );
-Rule gasRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o: $(source) ${$(module_name)_precondition}$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
+Rule gasRule ( "$(source): ${$(module_name)_precondition}\n"
+ "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o: $(source)$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_GAS)\n"
"\t${gcc} -x assembler-with-cpp -c $< -o $@ -D__ASM__ $($(module_name)_CFLAGS)\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL );
-Rule bootRule ( "$(module_output): $(source) ${$(module_name)_precondition}$(dependencies) | $(OUTPUT)$(SEP)$(source_dir)\n"
+Rule bootRule ( "$(source): ${$(module_name)_precondition}\n"
+ "$(module_output): $(source)$(dependencies) | $(OUTPUT)$(SEP)$(source_dir)\n"
"\t$(ECHO_NASM)\n"
"\t$(Q)${nasm} -f win32 $< -o $@ $($(module_name)_NASMFLAGS)\n",
"$(OUTPUT)$(SEP)$(source_dir)$(SEP)", NULL );
-Rule nasmRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o: $(source) ${$(module_name)_precondition}$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
+Rule nasmRule ( "$(source): ${$(module_name)_precondition}\n"
+ "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o: $(source)$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_NASM)\n"
"\t$(Q)${nasm} -f win32 $< -o $@ $($(module_name)_NASMFLAGS)\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL );
-Rule windresRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).coff: $(source) ${$(module_name)_precondition}$(dependencies) $(WRC_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir) $(TEMPORARY)\n"
+Rule windresRule ( "$(source): ${$(module_name)_precondition}\n"
+ "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).coff: $(source)$(dependencies) $(WRC_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir) $(TEMPORARY)\n"
"\t$(ECHO_WRC)\n"
"\t${gcc} -xc -E -DRC_INVOKED ${$(module_name)_RCFLAGS} $(source) > $(TEMPORARY)$(SEP)$(module_name).$(source_name_noext).rci.tmp\n"
"\t$(Q)$(WRC_TARGET) ${$(module_name)_RCFLAGS} $(TEMPORARY)$(SEP)$(module_name).$(source_name_noext).rci.tmp $(TEMPORARY)$(SEP)$(module_name).$(source_name_noext).res.tmp\n"
"\t$(ECHO_WMC)\n"
"\t$(Q)$(WMC_TARGET) -i -H $(INTERMEDIATE)$(SEP)include$(SEP)reactos$(SEP)$(source_name_noext).h -o $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).rc $(source)\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).rc", "$(INTERMEDIATE)$(SEP)include$(SEP)reactos$(SEP)$(source_name_noext).h", NULL );
-Rule winebuildRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source) ${$(module_name)_precondition}$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
+Rule winebuildRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).spec.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_WINEBLD)\n"
- "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(source_path)$(SEP)$(source_name_noext).spec\n"
+ "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).spec.def --def -E $(source)\n"
"$(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c: $(source_path)$(SEP)$(source_name_noext).spec $(WINEBUILD_TARGET)\n"
"\t$(ECHO_WINEBLD)\n"
"\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext).stubs.c --pedll $(source_path)$(SEP)$(source_name_noext).spec\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.c",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).stubs.o",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL );
-Rule widlHeaderRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).h: $(source) ${$(module_name)_precondition}$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
+Rule widlHeaderRule ( "$(source): ${$(module_name)_precondition}\n"
+ "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).h: $(source)$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_WIDL)\n"
"\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).h $(source)\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).h",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL );
-Rule widlServerRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.c $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.h: $(source) ${$(module_name)_precondition}$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
+Rule widlServerRule ( "$(source): ${$(module_name)_precondition}\n"
+ "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.c $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.h: $(source)$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_WIDL)\n"
"\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.h -s -S $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.c $(source)\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.c $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.h$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.c",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_s.o",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL );
-Rule widlClientRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.c $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.h: $(source) ${$(module_name)_precondition}$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
+Rule widlClientRule ( "$(source): ${$(module_name)_precondition}\n"
+ "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.c $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.h: $(source)$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_WIDL)\n"
"\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.h -c -C $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.c $(source)\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.c $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.h$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.c",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_c.o",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL );
-Rule widlProxyRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.h: $(source) ${$(module_name)_precondition}$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
+Rule widlProxyRule ( "$(source): ${$(module_name)_precondition}\n"
+ "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.h: $(source)$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_WIDL)\n"
"\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -h -H $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.h -p -P $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c $(source)\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.o: $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.h$(dependencies) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.c",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_p.o",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL );
-Rule widlTlbRule ( "$(OUTPUT)$(SEP)$(source_dir)$(SEP)$(module_name).tlb: $(source) ${$(module_name)_precondition}$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
+Rule widlTlbRule ( "$(source): ${$(module_name)_precondition}\n"
+ "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(module_name).tlb: $(source)$(dependencies) $(WIDL_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_WIDL)\n"
"\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -t -T $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).tlb $(source)\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL );
"\t$(ECHO_CC)\n"
"\t${host_gpp} -c $< -o $@ $($(module_name)_CFLAGS)$(compiler_flags)\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).o", NULL );
+Rule emptyRule ( "", NULL );
void
MingwModuleHandler::GenerateGccCommand (
{ HostFalse, TypeDontCare, ".cc", &gppRule },
{ HostFalse, TypeDontCare, ".cpp", &gppRule },
{ HostFalse, TypeDontCare, ".cxx", &gppRule },
+ { HostFalse, Cabinet, ".*", &emptyRule }
};
size_t i;
Rule *customRule = NULL;
continue;
if ( rules[i].type != TypeDontCare && rules[i].type != module.type )
continue;
- if ( rules[i].extension != extension )
+ if ( rules[i].extension != extension && rules[i].extension != ".*")
continue;
customRule = rules[i].rule;
break;
fprintf ( fMakefile,
"%s: %s %s $(RSYM_TARGET) $(PEFIXUP_TARGET) | %s\n",
target_macro.c_str (),
- backend->GetFullName ( *definitionFilename ).c_str (),
+ definitionFilename ? backend->GetFullName ( *definitionFilename ).c_str () : "",
dependencies.c_str (),
target_folder.c_str () );
fprintf ( fMakefile, "\t$(ECHO_LD)\n" );
fprintf ( fMakefile,
"\t${dlltool} --dllname %s --def %s --output-exp %s%s%s\n",
targetName.c_str (),
- backend->GetFullName ( *definitionFilename ).c_str (),
+ definitionFilename ? backend->GetFullName ( *definitionFilename ).c_str () : "",
backend->GetFullName ( temp_exp ).c_str (),
module.mangledSymbols ? "" : " --kill-at",
module.underscoreSymbols ? " --add-underscore" : "" );
GenerateRunStripCode ();
GenerateCleanObjectsAsYouGoCode ();
- delete definitionFilename;
+ if ( definitionFilename )
+ delete definitionFilename;
delete target_file;
}
MingwModuleHandler::GenerateArchiveTarget ()
{
const FileLocation *archiveFilename = GetModuleArchiveFilename ();
+ const FileLocation *definitionFilename = GetDefinitionFilename ();
arRule1.Execute ( fMakefile, backend, module, archiveFilename, clean_files );
- if ( IsStaticLibrary ( module ) && module.importLibrary )
+ if ( IsStaticLibrary ( module ) && definitionFilename )
{
- const FileLocation *definitionFilename = GetDefinitionFilename ();
-
fprintf ( fMakefile,
"\t${dlltool} --dllname %s --def %s --output-lib $@%s%s\n",
module.importLibrary->dllname.c_str (),
backend->GetFullName ( *definitionFilename ).c_str (),
module.mangledSymbols ? "" : " --kill-at",
module.underscoreSymbols ? " --add-underscore" : "" );
+ }
+ if ( definitionFilename )
delete definitionFilename;
- }
- if(module.type == HostStaticLibrary)
- arHostRule2.Execute ( fMakefile, backend, module, archiveFilename, clean_files );
- else
- arRule2.Execute ( fMakefile, backend, module, archiveFilename, clean_files );
+ if(module.type == HostStaticLibrary)
+ arHostRule2.Execute ( fMakefile, backend, module, archiveFilename, clean_files );
+ else
+ arRule2.Execute ( fMakefile, backend, module, archiveFilename, clean_files );
GenerateCleanObjectsAsYouGoCode ();
if ( module.host == HostTrue )
return;
- dependencies.push_back ( "$(INIT)" );
- if ( module.name != "psdk" )
+ if (module.name != "psdk" &&
+ module.name != "dxsdk")
+ {
dependencies.push_back ( "$(PSDK_TARGET) $(psdk_HEADERS)" );
+ dependencies.push_back ( "$(DXSDK_TARGET) $(dxsdk_HEADERS)" );
+ }
/* Check if any dependent library relies on the generated headers */
for ( size_t i = 0; i < module.project.modules.size (); i++ )
const FileLocation*
MingwModuleHandler::GetDefinitionFilename () const
{
- if ( module.importLibrary != NULL )
- {
- DirectoryLocation directory;
- if ( IsWineModule () )
- directory = IntermediateDirectory;
- else
- directory = SourceDirectory;
+ if ( module.importLibrary == NULL )
+ return NULL;
- return new FileLocation ( directory,
- module.importLibrary->source->relative_path,
- module.importLibrary->source->name );
- }
+ DirectoryLocation directory;
+ if ( IsWineModule () )
+ directory = IntermediateDirectory;
else
- return new FileLocation ( SourceDirectory, "tools" + sSep + "rbuild", "empty.def" );
+ directory = SourceDirectory;
+
+ return new FileLocation ( directory,
+ module.importLibrary->source->relative_path,
+ module.importLibrary->source->name );
}
void
{
const FileLocation *library_target = GetImportLibraryFilename ( module, &clean_files );
const FileLocation *defFilename = GetDefinitionFilename ();
+ string empty = "tools" + sSep + "rbuild" + sSep + "empty.def";
vector<FileLocation> deps;
GetDefinitionDependencies ( deps );
fprintf ( fMakefile, "# IMPORT LIBRARY RULE:\n" );
- fprintf ( fMakefile, "%s: %s",
- backend->GetFullName ( *library_target ).c_str (),
- backend->GetFullName ( *defFilename ).c_str () );
+ fprintf ( fMakefile, "%s:",
+ backend->GetFullName ( *library_target ).c_str () );
+
+ if ( defFilename )
+ {
+ fprintf ( fMakefile, " %s",
+ backend->GetFullName ( *defFilename ).c_str () );
+ }
size_t i, iend = deps.size();
for ( i = 0; i < iend; i++ )
fprintf ( fMakefile,
"\t${dlltool} --dllname %s --def %s --output-lib %s%s%s\n\n",
module.output->name.c_str (),
- backend->GetFullName ( *defFilename ).c_str (),
+ defFilename ? backend->GetFullName ( *defFilename ).c_str ()
+ : empty.c_str (),
backend->GetFullName ( *library_target ).c_str (),
module.mangledSymbols ? "" : " --kill-at",
module.underscoreSymbols ? " --add-underscore" : "" );
- delete defFilename;
+ if ( defFilename )
+ delete defFilename;
delete library_target;
}
}
FileLocation reactosInf ( bootcdReactos.directory,
bootcdReactos.relative_path,
"reactos.inf" );
- FileLocation vgafontsCab( bootcdReactos.directory,
- bootcdReactos.relative_path,
- "vgafonts.cab");
- FileLocation vgafontsDir( SourceDirectory,
- "media" + sSep + "vgafonts",
- "" );
vSourceFiles.push_back ( reactosDff );
sourceFiles.c_str (),
cdFiles.c_str (),
cdDirectories.c_str () );
- fprintf ( fMakefile, "\t$(ECHO_CABMAN)\n" );
- fprintf ( fMakefile,
- "\t$(Q)$(CABMAN_TARGET) -M raw -S %s %s\\*.bin\n", // Escape the asterisk for Make
- backend->GetFullName ( vgafontsCab ).c_str (),
- backend->GetFullName ( vgafontsDir ).c_str ());
fprintf ( fMakefile,
"\t$(Q)$(CABMAN_TARGET) -C %s -L %s -I -P $(OUTPUT)\n",
backend->GetFullName ( reactosDff ).c_str (),
GenerateRules ();
}
+MingwCabinetModuleHandler::MingwCabinetModuleHandler (
+ const Module& module_ )
+
+ : MingwModuleHandler ( module_ )
+{
+}
+
+void
+MingwCabinetModuleHandler::Process ()
+{
+ string targetMacro ( GetTargetMacro (module) );
+
+ GenerateRules ();
+
+ const FileLocation *target_file = GetTargetFilename ( module, NULL );
+ fprintf ( fMakefile, "%s: $(CABMAN_TARGET) | %s\n",
+ targetMacro.c_str (),
+ backend->GetFullPath ( *target_file ).c_str () );
+
+ fprintf ( fMakefile, "\t$(ECHO_CABMAN)\n" );
+ fprintf ( fMakefile,
+ "\t$(Q)$(CABMAN_TARGET) -M raw -S %s $(%s_SOURCES)\n", // Escape the asterisk for Make
+ targetMacro.c_str (),
+ module.name.c_str());
+}
+
MingwElfExecutableModuleHandler::MingwElfExecutableModuleHandler (
const Module& module_ )