Anonymous avatar Anonymous committed 7bc9148

gnumake4: #i117845#: LinkTarget.mk: fix dep-files for GenCxxObjects:
pass the dep-file target explicitly as a parameter to the Object__commands.
fixes the bug that for GenCxxObjects the dep-file of CxxObject is written.
remove some duplication in windows.mk/winmingw.mk.

Comments (0)

Files changed (7)

solenv/gbuild/LinkTarget.mk

 
 define gb_CObject__rules
 $$(call gb_CObject_get_target,%) : $$(call gb_CObject_get_source,$(1),%)
-	$$(call gb_CObject__command,$$@,$$*,$$<)
+	$$(call gb_CObject__command,$$@,$$*,$$<,$$(call gb_CObject_get_dep_target,$$*))
 
 ifeq ($(gb_FULLDEPS),$(true))
 $$(call gb_CObject_get_dep_target,%) : $$(call gb_CObject_get_source,$(1),%)
 define gb_CxxObject__rules
 $$(call gb_CxxObject_get_target,%) : $$(call gb_CxxObject_get_source,$(1),%)
 	$$(eval $$(gb_CxxObject__set_pchflags))
-	$$(call gb_CxxObject__command,$$@,$$*,$$<)
+	$$(call gb_CxxObject__command,$$@,$$*,$$<,$$(call gb_CxxObject_get_dep_target,$$*))
 
 ifeq ($(gb_FULLDEPS),$(true))
 $$(call gb_CxxObject_get_dep_target,%) : $$(call gb_CxxObject_get_source,$(1),%)
 endif
 
 $(call gb_GenCxxObject_get_target,%) : $(call gb_GenCxxObject_get_source,%)
-	$(call gb_CxxObject__command,$@,$*,$<)
+	$(call gb_CxxObject__command,$@,$*,$<,$(call gb_GenCxxObject_get_dep_target,$*))
 
 ifeq ($(gb_FULLDEPS),$(true))
 $(call gb_GenCxxObject_get_dep_target,%) : $(call gb_GenCxxObject_get_source,%)
 
 define gb_ObjCxxObject__rules
 $$(call gb_ObjCxxObject_get_target,%) : $$(call gb_ObjCxxObject_get_source,$(1),%)
-	$$(call gb_ObjCxxObject__command,$$@,$$*,$$<)
+	$$(call gb_ObjCxxObject__command,$$@,$$*,$$<,$$(call gb_ObjCxxObject_get_dep_target,$$*))
 
 ifeq ($(gb_FULLDEPS),$(true))
 $$(call gb_ObjCxxObject_get_dep_target,%) : $$(call gb_ObjCxxObject_get_source,$(1),%)

solenv/gbuild/TargetLocations.mk

 	CObject \
 	CxxObject \
 	ObjCxxObject \
+	GenCxxObject \
 	LinkTarget \
 	SrsPartTarget \
 	SrsTarget \
 ))
-# needs to use same dep target because we use gb_CxxObject__command
-gb_GenCxxObject_get_dep_target = $(gb_CxxObject_get_dep_target)
 
 # other getters
 

solenv/gbuild/platform/linux.mk

 
 # CObject class
 
+# $(call gb_CObject__command,object,relative-source,source,dep-file)
 define gb_CObject__command
 $(call gb_Output_announce,$(2),$(true),C  ,3)
 $(call gb_Helper_abbreviate_dirs,\
-	mkdir -p $(dir $(1)) && \
-	mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
+	mkdir -p $(dir $(1)) $(dir $(4)) && \
 	$(gb_CC) \
 		$(DEFS) \
 		$(T_CFLAGS) \
 		-c $(3) \
 		-o $(1) \
-		-MMD -MT $(call gb_CObject_get_target,$(2)) \
-		-MF $(call gb_CObject_get_dep_target,$(2)) \
+		-MMD -MT $(1) \
+		-MF $(4) \
 		-I$(dir $(3)) \
 		$(INCLUDE))
 endef
 
 # CxxObject class
 
+# $(call gb_CxxObject__command,object,relative-source,source,dep-file)
 define gb_CxxObject__command
 $(call gb_Output_announce,$(2),$(true),CXX,3)
 $(call gb_Helper_abbreviate_dirs,\
-	mkdir -p $(dir $(1)) && \
-	mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
+	mkdir -p $(dir $(1)) $(dir $(4)) && \
 	$(gb_CXX) \
 		$(DEFS) \
 		$(T_CXXFLAGS) \
 		-c $(3) \
 		-o $(1) \
-		-MMD -MT $(call gb_CxxObject_get_target,$(2)) \
-		-MF $(call gb_CxxObject_get_dep_target,$(2)) \
+		-MMD -MT $(1) \
+		-MF $(4) \
 		-I$(dir $(3)) \
 		$(INCLUDE_STL) $(INCLUDE))
 endef

solenv/gbuild/platform/macosx.mk

 define gb_CObject__command
 $(call gb_Output_announce,$(2),$(true),C  ,3)
 $(call gb_Helper_abbreviate_dirs,\
-	mkdir -p $(dir $(1)) && \
-	mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
+	mkdir -p $(dir $(1)) $(dir $(4)) && \
 	$(gb_CC) \
 		$(DEFS) \
 		$(T_CFLAGS) \
 		-c $(3) \
 		-o $(1) \
-		-MMD -MT $(call gb_CObject_get_target,$(2)) \
-		-MF $(call gb_CObject_get_dep_target,$(2)) \
+		-MMD -MT $(1) \
+		-MF $(4) \
 		-I$(dir $(3)) \
 		$(INCLUDE))
 endef
 define gb_CxxObject__command
 $(call gb_Output_announce,$(2),$(true),CXX,3)
 $(call gb_Helper_abbreviate_dirs,\
-	mkdir -p $(dir $(1)) && \
-	mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
+	mkdir -p $(dir $(1)) $(dir $(4)) && \
 	$(gb_CXX) \
 		$(DEFS) \
 		$(T_CXXFLAGS) \
 		-c $(3) \
 		-o $(1) \
-		-MMD -MT $(call gb_CxxObject_get_target,$(2)) \
-		-MF $(call gb_CxxObject_get_dep_target,$(2)) \
+		-MMD -MT $(1) \
+		-MF $(4) \
 		-I$(dir $(3)) \
 		$(INCLUDE_STL) $(INCLUDE))
 endef
 define gb_ObjCxxObject__command
 $(call gb_Output_announce,$(2),$(true),OCX,3)
 $(call gb_Helper_abbreviate_dirs,\
-	mkdir -p $(dir $(1)) && \
-	mkdir -p $(dir $(call gb_ObjCxxObject_get_dep_target,$(2))) && \
+	mkdir -p $(dir $(1)) $(dir $(4)) && \
 	$(gb_CXX) \
 		$(DEFS) \
 		$(T_OBJCXXFLAGS) \
 		-c $(3) \
 		-o $(1) \
-		-MMD -MT $(call gb_ObjCxxObject_get_target,$(2)) \
-		-MF $(call gb_ObjCxxObject_get_dep_target,$(2)) \
+		-MMD -MT $(1) \
+		-MF $(4) \
 		-I$(dir $(3)) \
 		$(INCLUDE_STL) $(INCLUDE))
 endef

solenv/gbuild/platform/solaris.mk

 define gb_CObject__command
 $(call gb_Output_announce,$(2),$(true),C  ,3)
 $(call gb_Helper_abbreviate_dirs,\
-	mkdir -p $(dir $(1)) && \
-	rm -f $(call gb_CObject_get_dep_target,$(2)) && \
-	mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
+	rm -f $(4) && \
+	mkdir -p $(dir $(1)) $(dir $(4)) && \
 	$(gb_CC) \
 		-c $(3) \
 		-o $(1) \
 		-xMMD \
-		-xMF $(call gb_CObject_get_dep_target,$(2)) \
+		-xMF $(4) \
 		$(DEFS) \
 		$(T_CFLAGS) \
 		-I$(dir $(3)) \
 define gb_CxxObject__command
 $(call gb_Output_announce,$(2),$(true),CXX,3)
 $(call gb_Helper_abbreviate_dirs,\
-	mkdir -p $(dir $(1)) && \
-	mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
+	mkdir -p $(dir $(1)) $(dir $(4)) && \
 	$(gb_CXX) \
 		$(DEFS) \
 		$(T_CXXFLAGS) \
 		-c $(3) \
 		-o $(1) \
 		-xMMD \
-		-xMF $(call gb_CxxObject_get_dep_target,$(2)) \
+		-xMF $(4) \
 		-I$(dir $(3)) \
 		$(INCLUDE_STL) $(INCLUDE))
 endef

solenv/gbuild/platform/windows.mk

 # CObject class
 
 ifeq ($(gb_FULLDEPS),$(true))
-define gb_CObject__command_deponcompile
+define gb_Object__command_deponcompile
 $(call gb_Helper_abbreviate_dirs_native,\
 	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
 		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
 		-v WORKDIR=$(WORKDIR)/ \
 		-v SRCDIR=$(SRCDIR)/ \
 		-v REPODIR=$(REPODIR)/ \
-	> $(call gb_CObject_get_dep_target,$(2)))
+	> $(2))
 endef
 else
-CObject__command_deponcompile =
+gb_Object__command_deponcompile =
 endif
 
 define gb_CObject__command
 		$(INCLUDE) \
 		-c $(3) \
 		-Fo$(1))
-$(call gb_CObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(T_CFLAGS),$(INCLUDE))
+$(call gb_Object__command_deponcompile,$(1),$(4),$(3),$(DEFS),$(T_CFLAGS),$(INCLUDE))
 endef
 
 
 # CxxObject class
 
-ifeq ($(gb_FULLDEPS),$(true))
-define gb_CxxObject__command_deponcompile
-$(call gb_Helper_abbreviate_dirs_native,\
-	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
-		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
-		-I$(dir $(3)) \
-		$(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME)%,$(6)) \
-		$(3) \
-		-f - \
-	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
-		-v OBJECTFILE=$(1) \
-		-v OUTDIR=$(OUTDIR)/ \
-		-v WORKDIR=$(WORKDIR)/ \
-		-v SRCDIR=$(SRCDIR)/ \
-		-v REPODIR=$(REPODIR)/ \
-	> $(call gb_CxxObject_get_dep_target,$(2)))
- endef
-else
-gb_CxxObject__command_deponcompile =
-endif
-
 define gb_CxxObject__command
 $(call gb_Output_announce,$(2),$(true),CXX,3)
 $(call gb_Helper_abbreviate_dirs_native,\
 		$(INCLUDE_STL) $(INCLUDE) \
 		-c $(3) \
 		-Fo$(1))
-$(call gb_CxxObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CFLAGS),$(INCLUDE))
+$(call gb_Object__command_deponcompile,$(1),$(4),$(3),$(DEFS),$(T_CXXFLAGS),$(INCLUDE))
 endef
 
 

solenv/gbuild/platform/winmingw.mk

 # CObject class
 
 ifeq ($(gb_FULLDEPS),$(true))
-define gb_CObject__command_deponcompile
+define gb_Object__command_deponcompile
 $(call gb_Helper_abbreviate_dirs_native,\
 	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
 		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
 		-v WORKDIR=$(WORKDIR)/ \
 		-v SRCDIR=$(SRCDIR)/ \
 		-v REPODIR=$(REPODIR)/ \
-	> $(call gb_CObject_get_dep_target,$(2)))
+	> $(2))
 endef
 else
-CObject__command_deponcompile =
+gb_Object__command_deponcompile =
 endif
 
 define gb_CObject__command
 		-o $(1) \
 		-I$(dir $(3)) \
 		$(INCLUDE))
-$(call gb_CObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(T_CFLAGS),$(INCLUDE))
+$(call gb_Object__command_deponcompile,$(1),$(4),$(3),$(DEFS),$(T_CFLAGS),$(INCLUDE))
 endef
 
 
 
 # CxxObject class
 
-ifeq ($(gb_FULLDEPS),$(true))
-define gb_CxxObject__command_deponcompile
-$(call gb_Helper_abbreviate_dirs_native,\
-	$(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
-		$(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
-		-I$(dir $(3)) \
-		$(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
-		$(3) \
-		-f - \
-	| $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
-		-v OBJECTFILE=$(1) \
-		-v OUTDIR=$(OUTDIR)/ \
-		-v WORKDIR=$(WORKDIR)/ \
-		-v SRCDIR=$(SRCDIR)/ \
-		-v REPODIR=$(REPODIR)/ \
-	> $(call gb_CxxObject_get_dep_target,$(2)))
-endef
-else
-gb_CxxObject__command_deponcompile =
-endif
-
 define gb_CxxObject__command
 $(call gb_Output_announce,$(2),$(true),CXX,3)
 $(call gb_Helper_abbreviate_dirs_native,\
 		-o $(1) \
 		-I$(dir $(3)) \
 		$(INCLUDE_STL) $(INCLUDE))
-$(call gb_CxxObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(T_CXXFLAGS),$(INCLUDE_STL) $(INCLUDE))
+$(call gb_Object__command_deponcompile,$(1),$(4),$(3),$(DEFS),$(T_CXXFLAGS),$(INCLUDE_STL) $(INCLUDE))
 endef
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.