From 8e60110bef68af6cb02725ed7fbc820e9f313d52 Mon Sep 17 00:00:00 2001 From: "KJK::Hyperion" Date: Mon, 14 Dec 2009 23:02:28 +0000 Subject: [PATCH] modified Makefile New ${checkpoint} command to create an empty "checkpoint" file, to store the last modified date of a make target modified tools/rbuild/backend/mingw/rules.mak Rules that output more than one file at once don't mix well with parallel builds: serialize dependency checks through the use of checkpoint files. Fixes intermittent widl issues in highly parallel builds Bonus internal rbuild function that I had to commit one day or another See issue #4994 for more details. svn path=/trunk/; revision=44594 --- reactos/Makefile | 2 ++ reactos/tools/rbuild/backend/mingw/rules.mak | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/reactos/Makefile b/reactos/Makefile index 6a159e360fc..9a8acc0c880 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -353,6 +353,7 @@ ifeq ($(HOST),mingw32-linux) endif export SEP = / mkdir = -$(Q)mkdir -p + checkpoint = $(Q)touch rm = $(Q)rm -f cp = $(Q)cp NUL = /dev/null @@ -361,6 +362,7 @@ else # mingw32-windows ROS_EMPTY = export SEP = \$(ROS_EMPTY) mkdir = -$(Q)mkdir + checkpoint = $(Q)copy /y NUL rm = $(Q)del /f /q cp = $(Q)copy /y NUL = NUL diff --git a/reactos/tools/rbuild/backend/mingw/rules.mak b/reactos/tools/rbuild/backend/mingw/rules.mak index 40e30f7bdcd..13da68a5c77 100644 --- a/reactos/tools/rbuild/backend/mingw/rules.mak +++ b/reactos/tools/rbuild/backend/mingw/rules.mak @@ -20,6 +20,7 @@ RBUILD_output_dir=${call RBUILD_fullpath,$(value OUTPUT)$(SEP)$(dir ${call RBUIL #(source) RBUILD_name=$(basename $(notdir $(1))) +RBUILD_noext=$(dir $(1))$(basename $(notdir $(1))) #(source) RBUILD_dir=${call RBUILD_fullpath,$(dir ${call RBUILD_compress_prefixes,$(1)})} @@ -255,9 +256,12 @@ define RBUILD_WIDL_CLIENT_RULE $(2): $${$(1)_precondition} -${call RBUILD_intermediate_path_noext,$(2)}_c.c ${call RBUILD_intermediate_path_noext,$(2)}_c.h: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} +${call RBUILD_intermediate_path_noext,$(2)}_c.c ${call RBUILD_intermediate_path_noext,$(2)}_c.h: ${call RBUILD_intermediate_path_noext,$(2)}_c + +${call RBUILD_intermediate_path_noext,$(2)}_c: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} $$(ECHO_WIDL) $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_c.h -c -C ${call RBUILD_intermediate_path_noext,$(2)}_c.c $(2) + $${checkpoint} $$@>$(NUL) ${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_c.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_c.o} @@ -268,9 +272,12 @@ define RBUILD_WIDL_SERVER_RULE $(2): $${$(1)_precondition} -${call RBUILD_intermediate_path_noext,$(2)}_s.c ${call RBUILD_intermediate_path_noext,$(2)}_s.h: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} +${call RBUILD_intermediate_path_noext,$(2)}_s.c ${call RBUILD_intermediate_path_noext,$(2)}_s.h: ${call RBUILD_intermediate_path_noext,$(2)}_s + +${call RBUILD_intermediate_path_noext,$(2)}_s: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} $$(ECHO_WIDL) $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_s.h -s -S ${call RBUILD_intermediate_path_noext,$(2)}_s.c $(2) + $${checkpoint} $$@>$(NUL) ${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_s.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_s.o} @@ -281,9 +288,12 @@ define RBUILD_WIDL_PROXY_RULE $(2): $${$(1)_precondition} -${call RBUILD_intermediate_path_noext,$(2)}_p.c ${call RBUILD_intermediate_path_noext,$(2)}_p.h: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} +${call RBUILD_intermediate_path_noext,$(2)}_p.c ${call RBUILD_intermediate_path_noext,$(2)}_p.h: ${call RBUILD_intermediate_path_noext,$(2)}_p + +${call RBUILD_intermediate_path_noext,$(2)}_p: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} $$(ECHO_WIDL) $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_p.h -p -P ${call RBUILD_intermediate_path_noext,$(2)}_p.c $(2) + $${checkpoint} $$@>$(NUL) ${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_p.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_p.o}