Generate registry hives on 'make install'

svn path=/branches/xmlbuildsystem/; revision=14507
This commit is contained in:
Casper Hornstrup 2005-04-05 17:22:02 +00:00
parent c8c43a85a3
commit 13fb77b90b
6 changed files with 128 additions and 6 deletions

View file

@ -90,6 +90,7 @@ ifeq ($(HALFVERBOSEECHO),yes)
ECHO_NCI =@echo [NCI] $@
ECHO_CABMAN =@echo [CABMAN] $<
ECHO_CDMAKE =@echo [CDMAKE] $@
ECHO_MKHIVE =@echo [MKHIVE] $@
ECHO_REGTESTS=@echo [REGTESTS] $@
ECHO_TEST =@echo [TEST] $@
else
@ -115,6 +116,7 @@ else
ECHO_NCI =
ECHO_CABMAN =
ECHO_CDMAKE =
ECHO_MKHIVE =
ECHO_REGTESTS=
ECHO_TEST =
endif
@ -139,7 +141,7 @@ ifeq ($(HOST),mingw32-linux)
objcopy = $(Q)mingw32-objcopy
dlltool = $(Q)mingw32-dlltool
windres = $(Q)mingw32-windres
rm = rm -f
rm = $(Q)rm -f
cp = $(Q)cp
NUL = /dev/null
else # mingw32-windows
@ -157,7 +159,7 @@ else # mingw32-windows
objcopy = $(Q)objcopy
dlltool = $(Q)dlltool
windres = $(Q)windres
rm = del /f /q
rm = $(Q)del /f /q
cp = $(Q)copy /y
NUL = NUL
endif

View file

@ -0,0 +1,66 @@
MKHIVE_BASE = $(TOOLS_BASE_)mkhive
MKHIVE_BASE_ = $(MKHIVE_BASE)$(SEP)
MKHIVE_INT = $(INTERMEDIATE_)$(MKHIVE_BASE)
MKHIVE_INT_ = $(MKHIVE_INT)$(SEP)
MKHIVE_OUT = $(OUTPUT_)$(MKHIVE_BASE)
MKHIVE_OUT_ = $(MKHIVE_OUT)$(SEP)
$(MKHIVE_INT): $(TOOLS_INT)
$(ECHO_MKDIR)
${mkdir} $@
ifneq ($(INTERMEDIATE),$(OUTPUT))
$(MKHIVE_OUT): $(TOOLS_OUT)
$(ECHO_MKDIR)
${mkdir} $@
endif
MKHIVE_TARGET = \
$(EXEPREFIX)$(MKHIVE_OUT_)mkhive$(EXEPOSTFIX)
MKHIVE_SOURCES = $(addprefix $(MKHIVE_BASE_), \
binhive.c \
infcache.c \
mkhive.c \
reginf.c \
registry.c \
)
MKHIVE_OBJECTS = \
$(addprefix $(INTERMEDIATE_), $(MKHIVE_SOURCES:.c=.o))
MKHIVE_HOST_CFLAGS = -g -Werror -Wall
MKHIVE_HOST_LFLAGS = -g
.PHONY: mkhive
mkhive: $(MKHIVE_TARGET)
$(MKHIVE_TARGET): $(MKHIVE_OBJECTS) $(MKHIVE_OUT)
$(ECHO_LD)
${host_gcc} $(MKHIVE_OBJECTS) $(MKHIVE_HOST_LFLAGS) -o $@
$(MKHIVE_INT_)binhive.o: $(MKHIVE_BASE_)binhive.c $(MKHIVE_INT)
$(ECHO_CC)
${host_gcc} $(MKHIVE_HOST_CFLAGS) -c $< -o $@
$(MKHIVE_INT_)infcache.o: $(MKHIVE_BASE_)infcache.c $(MKHIVE_INT)
$(ECHO_CC)
${host_gcc} $(MKHIVE_HOST_CFLAGS) -c $< -o $@
$(MKHIVE_INT_)mkhive.o: $(MKHIVE_BASE_)mkhive.c $(MKHIVE_INT)
$(ECHO_CC)
${host_gcc} $(MKHIVE_HOST_CFLAGS) -c $< -o $@
$(MKHIVE_INT_)reginf.o: $(MKHIVE_BASE_)reginf.c $(MKHIVE_INT)
$(ECHO_CC)
${host_gcc} $(MKHIVE_HOST_CFLAGS) -c $< -o $@
$(MKHIVE_INT_)registry.o: $(MKHIVE_BASE_)registry.c $(MKHIVE_INT)
$(ECHO_CC)
${host_gcc} $(MKHIVE_HOST_CFLAGS) -c $< -o $@
.PHONY: mkhive_clean
mkhive_clean: $(MKHIVE_TARGET)
-@$(rm) $(MKHIVE_TARGET) $(MKHIVE_OBJECTS) 2>$(NUL)
clean: mkhive_clean

View file

@ -680,7 +680,7 @@ MingwBackend::OutputInstallTarget ( const string& installDirectory,
fprintf ( fMakefile,
"\t$(ECHO_CP)\n" );
fprintf ( fMakefile,
"\t${cp} %s %s\n",
"\t${cp} %s %s 1>$(NUL)\n",
sourceFilename.c_str (),
normalizedTargetFilename.c_str () );
}
@ -717,6 +717,55 @@ MingwBackend::OutputModuleInstallTargets ( const string& installDirectory )
}
}
string
MingwBackend::GetRegistrySourceFiles ()
{
return "bootdata" SSEP "hivecls.inf "
"bootdata" SSEP "hivedef.inf "
"bootdata" SSEP "hiveinst.inf "
"bootdata" SSEP "hivesft.inf "
"bootdata" SSEP "hivesys.inf";
}
string
MingwBackend::GetRegistryTargetFiles ( const string& installDirectory )
{
string system32ConfigDirectory = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( installDirectory + SSEP + "system32" + SSEP "config" ),
true );
return system32ConfigDirectory + SSEP "default " +
system32ConfigDirectory + SSEP "sam " +
system32ConfigDirectory + SSEP "security " +
system32ConfigDirectory + SSEP "software " +
system32ConfigDirectory + SSEP "system";
}
void
MingwBackend::OutputRegistryInstallTarget ( const string& installDirectory )
{
string system32ConfigDirectory = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( installDirectory + SSEP + "system32" + SSEP "config" ),
true );
string registrySourceFiles = GetRegistrySourceFiles ();
string registryTargetFiles = GetRegistryTargetFiles ( installDirectory );
fprintf ( fMakefile,
"install_registry: %s\n",
registryTargetFiles.c_str () );
fprintf ( fMakefile,
"%s: %s %s $(MKHIVE_TARGET)\n",
registryTargetFiles.c_str (),
registrySourceFiles.c_str (),
system32ConfigDirectory.c_str () );
fprintf ( fMakefile,
"\t$(ECHO_MKHIVE)\n" );
fprintf ( fMakefile,
"\t$(MKHIVE_TARGET) bootdata %s bootdata" SSEP "hiveinst.inf\n",
system32ConfigDirectory.c_str () );
fprintf ( fMakefile,
"\n" );
}
void
MingwBackend::GenerateInstallTarget ()
{
@ -730,11 +779,12 @@ MingwBackend::GenerateInstallTarget ()
string installTargetFiles = v2s ( vInstallTargetFiles, 5 );
fprintf ( fMakefile,
"install: %s %s\n",
"install: %s %s install_registry\n",
installDirectory.c_str (),
installTargetFiles.c_str () );
OutputNonModuleInstallTargets ( installDirectoryNoFixup );
OutputModuleInstallTargets ( installDirectoryNoFixup );
OutputRegistryInstallTarget ( installDirectoryNoFixup );
fprintf ( fMakefile,
"\n" );
}

View file

@ -60,6 +60,9 @@ private:
const std::string& targetDirectory );
void OutputNonModuleInstallTargets ( const std::string& installDirectory );
void OutputModuleInstallTargets ( const std::string& installDirectory );
std::string GetRegistrySourceFiles ();
std::string GetRegistryTargetFiles ( const std::string& installDirectory );
void OutputRegistryInstallTarget ( const std::string& installDirectory );
void GenerateInstallTarget ();
FILE* fMakefile;
bool use_pch;

View file

@ -2189,7 +2189,7 @@ MingwIsoModuleHandler::OutputBootstrapfileCopyCommands (
fprintf ( fMakefile,
"\t$(ECHO_CP)\n" );
fprintf ( fMakefile,
"\t${cp} %s %s\n",
"\t${cp} %s %s 1>$(NUL)\n",
m.GetPath ().c_str (),
targetFilename.c_str () );
}
@ -2210,7 +2210,7 @@ MingwIsoModuleHandler::OutputCdfileCopyCommands (
fprintf ( fMakefile,
"\t$(ECHO_CP)\n" );
fprintf ( fMakefile,
"\t${cp} %s %s\n",
"\t${cp} %s %s 1>$(NUL)\n",
cdfile.GetPath ().c_str (),
targetFilename.c_str () );
}

View file

@ -57,6 +57,7 @@ include tools/bin2res/bin2res.mak
include tools/buildno/buildno.mak
include tools/cabman/cabman.mak
include tools/cdmake/cdmake.mak
include tools/mkhive/mkhive.mak
include tools/nci/nci.mak
include tools/rbuild/rbuild.mak
include tools/unicode/unicode.mak