diff --git a/reactos/Makefile b/reactos/Makefile index f738f7cf9d1..5c8ca6cc5e5 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -61,9 +61,8 @@ PREAUTO := \ lib$(SEP)kernel32$(SEP)errcodes.rc Makefile.auto: $(RMKDIR_TARGET) $(BUILDNO_TARGET) $(NCI_SERVICE_FILES) $(WMC_TARGET) $(WRC_TARGET) \ - $(CDMAKE_TARGET) $(RBUILD_TARGET) $(PREAUTO) + $(RSYM_TARGET) $(CDMAKE_TARGET) $(RBUILD_TARGET) $(PREAUTO) tools$(SEP)rbuild$(SEP)rbuild$(EXEPOSTFIX) mingw -# $(MAKE) $(MAKECMDGOALS) include$(SEP)reactos$(SEP)bugcodes.h ntoskrnl$(SEP)bugcodes.rc: $(WMC_TARGET) ntoskrnl$(SEP)ntoskrnl.mc diff --git a/reactos/tools/Makefile b/reactos/tools/Makefile index e121ae18829..8d28d8d87a4 100644 --- a/reactos/tools/Makefile +++ b/reactos/tools/Makefile @@ -24,6 +24,33 @@ rmkdir_clean: -@$(rm) $(RMKDIR_TARGET) $(RMKDIR_OBJECTS) 2>$(NUL) clean: rmkdir_clean + +RSYM_BASE = tools + +RSYM_TARGET = \ + $(ROS_INTERMEDIATE)$(RSYM_BASE)$(SEP)rsym$(EXEPOSTFIX) + +RSYM_SOURCES = \ + $(RSYM_BASE)$(SEP)rsym.c + +RSYM_OBJECTS = \ + $(RSYM_SOURCES:.c=.o) + +RSYM_HOST_CFLAGS = -g -Werror -Wall + +RSYM_HOST_LFLAGS = -g + +$(RSYM_TARGET): $(RSYM_OBJECTS) + ${host_gcc} $(RSYM_OBJECTS) $(RSYM_HOST_LFLAGS) -o $(RSYM_TARGET) + +$(RSYM_OBJECTS): %.o : %.c + ${host_gcc} $(RSYM_HOST_CFLAGS) -c $< -o $@ + +.PHONY: rsym_clean +rsym_clean: + -@$(rm) $(RSYM_TARGET) $(RSYM_OBJECTS) 2>$(NUL) +clean: rsym_clean + include tools/buildno/Makefile include tools/cdmake/makefile include tools/nci/makefile diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp index fa848a54958..2eb4de21187 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.cpp +++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp @@ -167,6 +167,7 @@ MingwBackend::GenerateGlobalVariables () const fprintf ( fMakefile, "bin2res = tools" SSEP "bin2res" SSEP "bin2res" EXEPOSTFIX "\n" ); fprintf ( fMakefile, "cabman = tools" SSEP "cabman" SSEP "cabman" EXEPOSTFIX "\n" ); fprintf ( fMakefile, "cdmake = tools" SSEP "cdmake" SSEP "cdmake" EXEPOSTFIX "\n" ); + fprintf ( fMakefile, "rsym = tools" SSEP "rsym" EXEPOSTFIX "\n" ); fprintf ( fMakefile, "wrc = tools" SSEP "wrc" SSEP "wrc" EXEPOSTFIX "\n" ); fprintf ( fMakefile, "\n" ); GenerateGlobalCFlagsAndProperties ( diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 03aa066f52b..e669bb6b53c 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -865,6 +865,11 @@ MingwModuleHandler::GenerateLinkerCommand ( const Module& module, importLibraryDependencies.c_str (), GetLinkerMacro ( module ).c_str () ); } + + fprintf ( fMakefile, + "\t${rsym} %s %s\n", + target.c_str (), + target.c_str () ); } void @@ -1402,6 +1407,10 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module ) fprintf ( fMakefile, "\t${rm} %s\n\n", temp_exp.c_str () ); + fprintf ( fMakefile, + "\t${rsym} %s %s\n", + target.c_str (), + target.c_str () ); }