Author: hyperion
Date: Mon Jan 26 08:26:15 2009
New Revision: 39111
URL:
http://svn.reactos.org/svn/reactos?rev=39111&view=rev
Log:
Begin moving rules out of modulehandler.cpp and into makefile include rules.mak, where
they will be more readable and manageable. Currently implemented: target C compiler and
target C++ compiler rules. Please do a clean build if possible. Testing with unusual
output paths appreciated
Added:
trunk/reactos/tools/rbuild/backend/mingw/rules.mak (with props)
Modified:
trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] Mon Jan 26 08:26:15
2009
@@ -519,6 +519,8 @@
void
MingwBackend::GenerateGlobalVariables () const
{
+ fputs ( "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)rules.mak\n",
fMakefile );
+
if ( configuration.Dependencies == FullDependencies )
{
fprintf ( fMakefile,
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] Mon Jan 26
08:26:15 2009
@@ -1239,16 +1239,7 @@
"\t$(ECHO_WIDL)\n"
"\t$(Q)$(WIDL_TARGET) $($(module_name)_WIDLFLAGS) -t -T
$(intermediate_path_noext).tlb $(source)\n",
"$(intermediate_dir)$(SEP)", NULL );
-Rule gccRule ( "$(source): ${$(module_name)_precondition}\n"
- "ifeq ($(ROS_BUILDDEPS),full)\n"
- "$(intermediate_path_unique).o.d: $(source) |
$(intermediate_dir)\n"
- "\t$(ECHO_DEPENDS)\n"
- "\t${gcc} -MF $@ $($(module_name)_CFLAGS)$(compiler_flags) -M -MP -MT
$@ $<\n"
- "-include $(intermediate_path_unique).o.d\n"
- "endif\n"
- "$(intermediate_path_unique).o: $(source)$(if $(subst
_full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_unique).o.d) $(dependencies) |
$(intermediate_dir)\n"
- "\t$(ECHO_CC)\n"
- "\t${gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c
$<\n",
+Rule gccRule ( "$(eval $(call
RBUILD_GCC_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n",
"$(intermediate_path_unique).o",
"$(intermediate_path_unique).o.d", NULL );
Rule gccHostRule ( "$(source): ${$(module_name)_precondition}\n"
@@ -1256,16 +1247,7 @@
"\t$(ECHO_HOSTCC)\n"
"\t${host_gcc} -o $@ $($(module_name)_CFLAGS)$(compiler_flags) -c
$<\n",
"$(intermediate_path_unique).o", NULL );
-Rule gppRule ( "$(source): ${$(module_name)_precondition}\n"
- "ifeq ($(ROS_BUILDDEPS),full)\n"
- "$(intermediate_path_unique).o.d: $(source) |
$(intermediate_dir)\n"
- "\t$(ECHO_DEPENDS)\n"
- "\t${gpp} -MF $@ $($(module_name)_CXXFLAGS)$(compiler_flags) -M -MP
-MT $@ $<\n"
- "-include $(intermediate_path_unique).o.d\n"
- "endif\n"
- "$(intermediate_path_unique).o: $(source)$(if $(subst
_full,,_$(ROS_BUILDDEPS)),, $(intermediate_path_unique).o.d) $(dependencies) |
$(intermediate_dir)\n"
- "\t$(ECHO_CC)\n"
- "\t${gpp} -o $@ $($(module_name)_CXXFLAGS)$(compiler_flags) -c
$<\n",
+Rule gppRule ( "$(eval $(call
RBUILD_GPP_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n",
"$(intermediate_path_unique).o",
"$(intermediate_path_unique).o.d", NULL );
Rule gppHostRule ( "$(source): ${$(module_name)_precondition}\n"
Added: trunk/reactos/tools/rbuild/backend/mingw/rules.mak
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/rules.mak (added)
+++ trunk/reactos/tools/rbuild/backend/mingw/rules.mak [iso-8859-1] Mon Jan 26 08:26:15
2009
@@ -1,0 +1,67 @@
+RBUILD_fullpath=${subst <<<,,${subst $(SEP)<<<,,${subst
/,$(SEP),${subst \\,$(SEP),$(1)}}<<<}}
+
+RBUILD_compress_prefix=${subst >>>,,${subst
>>>$($(2)),$$($(2)),>>>$(1)}}
+
+RBUILD_compress_prefixes=${call RBUILD_compress_prefix,${call
RBUILD_compress_prefix,${call RBUILD_compress_prefix,${call RBUILD_compress_prefix,${call
RBUILD_compress_prefix,$(1),INTERMEDIATE},OUTPUT},CDOUTPUT},TEMPORARY},INSTALL}
+
+#(module, source)
+RBUILD_intermediate_path_unique=${call RBUILD_intermediate_dir,$(2)}$(SEP)$(basename
$(notdir $(2)))_$(1)
+
+#(source)
+RBUILD_intermediate_dir=${call RBUILD_fullpath,$(value INTERMEDIATE)$(SEP)$(dir ${call
RBUILD_compress_prefixes,$(1)})}
+
+#(module, source, dependencies, cflags)
+define RBUILD_GCC_RULE
+
+$(2): $${$(1)_precondition}
+
+ifeq ($(ROS_BUILDDEPS),full)
+
+${call RBUILD_intermediate_path_unique,$(1),$(2)}.o.d: $(2) | ${call
RBUILD_intermediate_dir,$(2)}
+ $$(ECHO_DEPENDS)
+ $${gcc} -MF $$@ $$($(1)_CFLAGS) $(4) -M -MP -MT $$@ $$<
+
+-include ${call RBUILD_intermediate_path_unique,$(1),$(2)}.o.d
+
+${call RBUILD_intermediate_path_unique,$(1),$(2)}.o: $(2) ${call
RBUILD_intermediate_path_unique,$(1),$(2)}.o.d $(3) | ${call
RBUILD_intermediate_dir,$(2)}
+ $$(ECHO_CC)
+ $${gcc} -o $$@ $$($(1)_CFLAGS) $(4) -c $$<
+
+else
+
+${call RBUILD_intermediate_path_unique,$(1),$(2)}.o: $(2) $(3) | ${call
RBUILD_intermediate_dir,$(2)}
+ $$(ECHO_CC)
+ $${gcc} -o $$@ $$($(1)_CFLAGS) $(4) -c $$<
+
+endif
+
+endef
+
+#(module, source, dependencies, cflags)
+define RBUILD_GPP_RULE
+
+$(2): $${$(1)_precondition}
+
+ifeq ($(ROS_BUILDDEPS),full)
+
+${call RBUILD_intermediate_path_unique,$(1),$(2)}.o.d: $(2) | ${call
RBUILD_intermediate_dir,$(2)}
+ $$(ECHO_DEPENDS)
+ $${gpp} -MF $$@ $$($(1)_CXXFLAGS) $(4) -M -MP -MT $$@ $$<
+
+-include ${call RBUILD_intermediate_path_unique,$(1),$(2)}.o.d
+
+${call RBUILD_intermediate_path_unique,$(1),$(2)}.o: $(2) ${call
RBUILD_intermediate_path_unique,$(1),$(2)}.o.d $(3) | ${call
RBUILD_intermediate_dir,$(2)}
+ $$(ECHO_CC)
+ $${gpp} -o $$@ $$($(1)_CXXFLAGS) $(4) -c $$<
+
+else
+
+${call RBUILD_intermediate_path_unique,$(1),$(2)}.o: $(2) $(3) | ${call
RBUILD_intermediate_dir,$(2)}
+ $$(ECHO_CC)
+ $${gpp} -o $$@ $$($(1)_CXXFLAGS) $(4) -c $$<
+
+endif
+
+endef
+
+# EOF
Propchange: trunk/reactos/tools/rbuild/backend/mingw/rules.mak
------------------------------------------------------------------------------
svn:eol-style = native