# HG changeset patch # User Mike Shal # Date 1568051087 0 # Node ID b2e49b3d407e3e716596cc07c98fbc75523f2ecf # Parent e16411b0a19fec7568266310f8f221161a4e580b Bug 1496746 - Remove VPATH; r=glandium Having a full VPATH for the srcdir sometimes causes make to grab the wrong prerequisite for a rule, in particular if we have a file in the srcdir and also generate a file of the same name in the objdir. We don't really need VPATH anymore though, since most of the information comes from mozbuild, where we can explicitly list the path to the srcdir or objdir as necessary. Differential Revision: https://phabricator.services.mozilla.com/D42968 diff --git a/accessible/interfaces/gecko/Makefile.in b/accessible/interfaces/gecko/Makefile.in --- a/accessible/interfaces/gecko/Makefile.in +++ b/accessible/interfaces/gecko/Makefile.in @@ -11,17 +11,17 @@ MIDL_GENERATED_FILES = \ IGeckoCustom_i.c \ IGeckoCustom.tlb \ $(NULL) # Bug 1420119: We need the trailing semicolon here to generate a recipe for the # midl targets to avoid timestamp caching issues. $(MIDL_GENERATED_FILES): done_gen ; -done_gen: IGeckoCustom.idl +done_gen: $(srcdir)/IGeckoCustom.idl $(MIDL) $(MIDL_FLAGS) -I $(srcdir) -Oicf $(srcdir)/IGeckoCustom.idl touch $@ export:: done_gen midl_exports := \ IGeckoCustom.h \ IGeckoCustom_i.c \ diff --git a/accessible/interfaces/msaa/Makefile.in b/accessible/interfaces/msaa/Makefile.in --- a/accessible/interfaces/msaa/Makefile.in +++ b/accessible/interfaces/msaa/Makefile.in @@ -11,20 +11,20 @@ MIDL_GENERATED_FILES = \ ISimpleDOM_p.c \ ISimpleDOM.tlb \ $(NULL) # Bug 1420119: We need the trailing semicolon here to generate a recipe for the # midl targets to avoid timestamp caching issues. $(MIDL_GENERATED_FILES): done_gen ; -done_gen: ISimpleDOM.idl \ - ISimpleDOMNode.idl \ - ISimpleDOMDocument.idl \ - ISimpleDOMText.idl +done_gen: $(srcdir)/ISimpleDOM.idl \ + $(srcdir)/ISimpleDOMNode.idl \ + $(srcdir)/ISimpleDOMDocument.idl \ + $(srcdir)/ISimpleDOMText.idl $(MIDL) $(MIDL_FLAGS) -I $(srcdir) -robust -Oicf $(srcdir)/ISimpleDOM.idl touch $@ export:: done_gen # This marshall dll is also registered in the installer register:: diff --git a/accessible/ipc/win/handler/Makefile.in b/accessible/ipc/win/handler/Makefile.in --- a/accessible/ipc/win/handler/Makefile.in +++ b/accessible/ipc/win/handler/Makefile.in @@ -16,17 +16,17 @@ MIDL_GENERATED_FILES = \ $(NULL) export:: $(MIDL_GENERATED_FILES) # Bug 1420119: We need the trailing semicolon here to generate a recipe for the # midl targets to avoid timestamp caching issues. $(MIDL_GENERATED_FILES): midl_done ; -midl_done: HandlerData.acf HandlerData.idl +midl_done: $(srcdir)/HandlerData.acf $(srcdir)/HandlerData.idl $(MIDL) $(MIDL_FLAGS) $(DEFINES) -I $(topobjdir) -I $(DIST)/include -I $(IA2DIR) -I $(MSAADIR) -Oicf -acf $(srcdir)/HandlerData.acf $(srcdir)/HandlerData.idl touch $@ INSTALL_TARGETS += midl midl_FILES := HandlerData.h \ HandlerData_i.c \ $(NULL) midl_DEST := $(DIST)/include diff --git a/accessible/ipc/win/typelib/Makefile.in b/accessible/ipc/win/typelib/Makefile.in --- a/accessible/ipc/win/typelib/Makefile.in +++ b/accessible/ipc/win/typelib/Makefile.in @@ -10,17 +10,17 @@ MIDL_GENERATED_FILES = \ Accessible_p.c \ Accessible.tlb \ $(NULL) # Bug 1420119: We need the trailing semicolon here to generate a recipe for the # midl targets to avoid timestamp caching issues. $(MIDL_GENERATED_FILES): done_gen ; -done_gen: Accessible.idl +done_gen: $(srcdir)/Accessible.idl $(MIDL) $(MIDL_FLAGS) -Oicf $(srcdir)/Accessible.idl touch $@ export:: done_gen midl_exports := \ Accessible.tlb \ $(NULL) diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in --- a/browser/app/Makefile.in +++ b/browser/app/Makefile.in @@ -26,17 +26,17 @@ CXX := $(filter-out -march=% -msse -msse CXX += -march=pentiumpro endif ifeq ($(OS_ARCH),WINNT) # Rebuild firefox.exe if the manifest changes - it's included by splash.rc. # (this dependency should really be just for firefox.exe, not other targets) # Note the manifest file exists in the tree, so we use the explicit filename # here. -EXTRA_DEPS += firefox.exe.manifest +EXTRA_DEPS += $(srcdir)/firefox.exe.manifest endif PROGRAMS_DEST = $(DIST)/bin include $(topsrcdir)/config/rules.mk ifneq (,$(filter-out WINNT,$(OS_ARCH))) diff --git a/config/rules.mk b/config/rules.mk --- a/config/rules.mk +++ b/config/rules.mk @@ -38,18 +38,16 @@ REPORT_BUILD_VERBOSE = $(REPORT_BUILD) else REPORT_BUILD_VERBOSE = $(call BUILDSTATUS,BUILD_VERBOSE $(relativesrcdir)) endif endif EXEC = exec -_VPATH_SRCS = $(abspath $<) - ################################################################################ # Testing frameworks support ################################################################################ testxpcobjdir = $(DEPTH)/_tests/xpcshell ifdef ENABLE_TESTS ifdef CPP_UNIT_TESTS @@ -685,41 +683,41 @@ crate_src_libdep = $(call mk_global_crat $(foreach f,$(RSSRCS),$(eval $(call src_libdep,$(f)))) $(foreach f,$(RS_STATICLIB_CRATE_SRC),$(eval $(call crate_src_libdep,$(f)))) $(OBJS) $(HOST_OBJS) $(PROGOBJS) $(HOST_PROGOBJS): $(GLOBAL_DEPS) # Rules for building native targets must come first because of the host_ prefix $(HOST_COBJS): $(REPORT_BUILD_VERBOSE) - $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CFLAGS) $(NSPR_CFLAGS) $(_VPATH_SRCS) + $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CFLAGS) $(NSPR_CFLAGS) $< $(HOST_CPPOBJS): $(REPORT_BUILD_VERBOSE) $(call BUILDSTATUS,OBJECT_FILE $@) - $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CXXFLAGS) $(NSPR_CFLAGS) $(_VPATH_SRCS) + $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CXXFLAGS) $(NSPR_CFLAGS) $< $(HOST_CMOBJS): $(REPORT_BUILD_VERBOSE) - $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CFLAGS) $(HOST_CMFLAGS) $(NSPR_CFLAGS) $(_VPATH_SRCS) + $(HOST_CC) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CFLAGS) $(HOST_CMFLAGS) $(NSPR_CFLAGS) $< $(HOST_CMMOBJS): $(REPORT_BUILD_VERBOSE) - $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CXXFLAGS) $(HOST_CMMFLAGS) $(NSPR_CFLAGS) $(_VPATH_SRCS) + $(HOST_CXX) $(HOST_OUTOPTION)$@ -c $(HOST_CPPFLAGS) $(HOST_CXXFLAGS) $(HOST_CMMFLAGS) $(NSPR_CFLAGS) $< $(COBJS): $(REPORT_BUILD_VERBOSE) - $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS) + $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $($(notdir $<)_FLAGS) $< ifdef ASFILES # The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept # a '-c' flag. $(ASOBJS): $(REPORT_BUILD_VERBOSE) - $(AS) $(ASOUTOPTION)$@ $(ASFLAGS) $($(notdir $<)_FLAGS) $(AS_DASH_C_FLAG) $(_VPATH_SRCS) + $(AS) $(ASOUTOPTION)$@ $(ASFLAGS) $($(notdir $<)_FLAGS) $(AS_DASH_C_FLAG) $< endif define syms_template syms:: $(2) $(2): $(1) ifdef MOZ_CRASHREPORTER $$(call py_action,dumpsymbols,$$(abspath $$<) $$(abspath $$@)) endif @@ -752,41 +750,41 @@ endif $(SOBJS): $(REPORT_BUILD) $(AS) $(ASOUTOPTION)$@ $(SFLAGS) $($(notdir $<)_FLAGS) -c $< $(CPPOBJS): $(REPORT_BUILD_VERBOSE) $(call BUILDSTATUS,OBJECT_FILE $@) - $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS) + $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $< $(CMMOBJS): $(REPORT_BUILD_VERBOSE) - $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS) + $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $($(notdir $<)_FLAGS) $< $(CMOBJS): $(REPORT_BUILD_VERBOSE) - $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS) + $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $($(notdir $<)_FLAGS) $< $(filter %.s,$(CPPSRCS:%.cpp=%.s)): %.s: %.cpp $(call mkdir_deps,$(MDDEPDIR)) $(REPORT_BUILD_VERBOSE) - $(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS) + $(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $< $(filter %.s,$(CPPSRCS:%.cc=%.s)): %.s: %.cc $(call mkdir_deps,$(MDDEPDIR)) $(REPORT_BUILD_VERBOSE) - $(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS) + $(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $< $(filter %.s,$(CPPSRCS:%.cxx=%.s)): %.s: %.cpp $(call mkdir_deps,$(MDDEPDIR)) $(REPORT_BUILD_VERBOSE) - $(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS) + $(CCC) -S $(COMPILE_CXXFLAGS) $($(notdir $<)_FLAGS) $< $(filter %.s,$(CSRCS:%.c=%.s)): %.s: %.c $(call mkdir_deps,$(MDDEPDIR)) $(REPORT_BUILD_VERBOSE) - $(CC) -S $(COMPILE_CFLAGS) $($(notdir $<)_FLAGS) $(_VPATH_SRCS) + $(CC) -S $(COMPILE_CFLAGS) $($(notdir $<)_FLAGS) $< ifneq (,$(filter %.i,$(MAKECMDGOALS))) # Call as $(call _group_srcs,extension,$(SRCS)) - this will create a list # of the full sources, as well as the $(notdir) version. So: # foo.cpp sub/bar.cpp # becomes: # foo.cpp sub/bar.cpp bar.cpp # @@ -803,17 +801,17 @@ define PREPROCESS_RULES # reach $(srcdir)/frontend/Parser.i vpath %.$1 $$(addprefix $$(srcdir)/,$$(sort $$(dir $$($2)))) vpath %.$1 $$(addprefix $$(CURDIR)/,$$(sort $$(dir $$($2)))) $$(_PREPROCESSED_$1_FILES): _DEPEND_CFLAGS= $$(_PREPROCESSED_$1_FILES): %.i: %.$1 $$(REPORT_BUILD_VERBOSE) $$(addprefix $$(MKDIR) -p ,$$(filter-out .,$$(@D))) - $$($3) -C $$(PREPROCESS_OPTION)$$@ $(foreach var,$4,$$($(var))) $$($$(notdir $$<)_FLAGS) $$(_VPATH_SRCS) + $$($3) -C $$(PREPROCESS_OPTION)$$@ $(foreach var,$4,$$($(var))) $$($$(notdir $$<)_FLAGS) $$< endef $(eval $(call PREPROCESS_RULES,cpp,CPPSRCS,CCC,COMPILE_CXXFLAGS)) $(eval $(call PREPROCESS_RULES,cc,CPPSRCS,CCC,COMPILE_CXXFLAGS)) $(eval $(call PREPROCESS_RULES,cxx,CPPSRCS,CCC,COMPILE_CXXFLAGS)) $(eval $(call PREPROCESS_RULES,c,CSRCS,CC,COMPILE_CFLAGS)) $(eval $(call PREPROCESS_RULES,mm,CMMSRCS,CCC,COMPILE_CXXFLAGS COMPILE_CMMFLAGS)) @@ -865,23 +863,23 @@ else @$(MAKE) PP_REINVOKE=1 $@ \ $(foreach type,c cpp mm,$(UPPER_$(type))SRCS="$(all_$(type)_sources)") endif endif endif -$(RESFILE): %.res: %.rc +$(RESFILE): %.res: $(RCFILE) $(REPORT_BUILD) @echo Creating Resource file: $@ ifdef GNU_CC - $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) $(OUTOPTION)$@ $(_VPATH_SRCS) -else - $(RC) $(RCFLAGS) -r $(DEFINES) $(INCLUDES) $(OUTOPTION)$@ $(_VPATH_SRCS) + $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) $(OUTOPTION)$@ $< +else + $(RC) $(RCFLAGS) -r $(DEFINES) $(INCLUDES) $(OUTOPTION)$@ $< endif # Cancel GNU make built-in implicit rules MAKEFLAGS += -r ifneq (,$(filter WINNT,$(OS_ARCH))) SEP := ; else diff --git a/config/version.mk b/config/version.mk --- a/config/version.mk +++ b/config/version.mk @@ -29,17 +29,17 @@ ifdef _PROGRAM _RC_STRING += -BINARY $(notdir $(_PROGRAM)) else ifdef SHARED_LIBRARY _RC_STRING += -BINARY $(notdir $(SHARED_LIBRARY)) endif endif endif ifdef RCINCLUDE -_RC_STRING += -RCINCLUDE $(srcdir)/$(RCINCLUDE) +_RC_STRING += -RCINCLUDE $(RCINCLUDE) endif GARBAGE += $(RESFILE) $(RCFILE) #dummy target so $(RCFILE) doesn't become the default =P all:: $(RCFILE): $(RCINCLUDE) $(MOZILLA_DIR)/config/version_win.pl diff --git a/media/libopus/Makefile.in b/media/libopus/Makefile.in --- a/media/libopus/Makefile.in +++ b/media/libopus/Makefile.in @@ -6,16 +6,16 @@ include $(topsrcdir)/config/rules.mk ifdef GNU_AS ifeq ($(CPU_ARCH),arm) celt_pitch_xcorr_arm-gnu.s: celt/arm/armopts-gnu.S # armopts needs a specific rule, because arm2gnu.pl will always add the .S # suffix when translating the files that include it. -celt/arm/armopts-gnu.S: celt/arm/armopts.s $(call mkdir_deps,celt/arm) $(GLOBAL_DEPS) +celt/arm/armopts-gnu.S: $(srcdir)/celt/arm/armopts.s $(call mkdir_deps,celt/arm) $(GLOBAL_DEPS) $(PERL) $(srcdir)/celt/arm/arm2gnu.pl < $< > $@ # For all others, we can use an implicit rule -%-gnu.s: celt/arm/%.s $(GLOBAL_DEPS) +%-gnu.s: $(srcdir)/celt/arm/%.s $(GLOBAL_DEPS) $(PERL) $(srcdir)/celt/arm/arm2gnu.pl < $< > $@ endif endif diff --git a/media/libtheora/Makefile.in b/media/libtheora/Makefile.in --- a/media/libtheora/Makefile.in +++ b/media/libtheora/Makefile.in @@ -7,18 +7,18 @@ ifdef GNU_AS ifeq ($(CPU_ARCH),arm) armfrag-gnu.s: armopts-gnu.S armidct-gnu.s: armopts-gnu.S armloop-gnu.s: armopts-gnu.S # armopts needs a specific rule, because arm2gnu.pl will always add the .S # suffix when translating the files that include it. -armopts-gnu.S: lib/arm/armopts.s +armopts-gnu.S: $(srcdir)/lib/arm/armopts.s $(PERL) $(srcdir)/lib/arm/arm2gnu.pl < $< > $@ # For all others, we can use an implicit rule -%-gnu.s: lib/arm/%.s +%-gnu.s: $(srcdir)/lib/arm/%.s $(PERL) $(srcdir)/lib/arm/arm2gnu.pl < $< > $@ endif endif include $(topsrcdir)/config/rules.mk diff --git a/media/libvpx/Makefile.in b/media/libvpx/Makefile.in --- a/media/libvpx/Makefile.in +++ b/media/libvpx/Makefile.in @@ -11,14 +11,14 @@ ifdef GNU_AS # The ARM asm is written in ARM RVCT syntax, but we actually build it with # gas using GNU syntax. Add some rules to perform the conversion. # Previously used $(dir $(ASFILES)) to figure out which directories to generate. # However, .S (as opposed to .s) files are not added to ASFILES. There is only # one directory with arm assembly currently so enumerate it manually. GENERATED_DIRS += libvpx/vpx_dsp/arm -%.asm.S: %.asm $(ASM_OFFSETS) $(call mkdir_deps,libvpx/vpx_dsp/arm) +libvpx/vpx_dsp/arm/%.asm.S: $(srcdir)/libvpx/vpx_dsp/arm/%.asm $(call mkdir_deps,libvpx/vpx_dsp/arm) $(PERL) $(topsrcdir)/media/libvpx/libvpx/build/make/ads2gas.pl < $< > $@ $(addsuffix .$(OBJ_SUFFIX), idct4x4_add_neon.asm idct8x8_add_neon.asm idct16x16_add_neon.asm): libvpx/vpx_dsp/arm/idct_neon.asm.S endif endif diff --git a/mozglue/build/Makefile.in b/mozglue/build/Makefile.in --- a/mozglue/build/Makefile.in +++ b/mozglue/build/Makefile.in @@ -2,15 +2,15 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # For FORCE_SHARED_LIB include $(topsrcdir)/config/config.mk ifeq (WINNT,$(OS_TARGET)) -mozglue.def: mozglue.def.in $(GLOBAL_DEPS) +mozglue.def: $(srcdir)/mozglue.def.in $(GLOBAL_DEPS) $(call py_action,preprocessor,$(if $(MOZ_REPLACE_MALLOC),-DMOZ_REPLACE_MALLOC) $(ACDEFINES) $< -o $@) GARBAGE += mozglue.def endif include $(topsrcdir)/mozglue/build/replace_malloc.mk diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py --- a/python/mozbuild/mozbuild/backend/recursivemake.py +++ b/python/mozbuild/mozbuild/backend/recursivemake.py @@ -468,51 +468,68 @@ class RecursiveMakeBackend(CommonBackend '.cpp': 'CPPSRCS', '.rs': 'RSSRCS', '.S': 'SSRCS', } variables = [suffix_map[obj.canonical_suffix]] if isinstance(obj, GeneratedSources): variables.append('GARBAGE') base = backend_file.objdir + cls = ObjDirPath + prefix = '!' else: base = backend_file.srcdir + cls = SourcePath + prefix = '' for f in sorted(obj.files): - f = mozpath.relpath(f, base) + p = self._pretty_path( + cls(obj._context, prefix + mozpath.relpath(f, base)), + backend_file, + ) for var in variables: - backend_file.write('%s += %s\n' % (var, f)) + backend_file.write('%s += %s\n' % (var, p)) elif isinstance(obj, (HostSources, HostGeneratedSources)): suffix_map = { '.c': 'HOST_CSRCS', '.mm': 'HOST_CMMSRCS', '.cpp': 'HOST_CPPSRCS', } variables = [suffix_map[obj.canonical_suffix]] if isinstance(obj, HostGeneratedSources): variables.append('GARBAGE') base = backend_file.objdir + cls = ObjDirPath + prefix = '!' else: base = backend_file.srcdir + cls = SourcePath + prefix = '' for f in sorted(obj.files): - f = mozpath.relpath(f, base) + p = self._pretty_path( + cls(obj._context, prefix + mozpath.relpath(f, base)), + backend_file, + ) for var in variables: - backend_file.write('%s += %s\n' % (var, f)) + backend_file.write('%s += %s\n' % (var, p)) elif isinstance(obj, VariablePassthru): # Sorted so output is consistent and we don't bump mtimes. for k, v in sorted(obj.variables.items()): if k == 'HAS_MISC_RULE': self._no_skip['misc'].add(backend_file.relobjdir) continue if isinstance(v, list): for item in v: backend_file.write( '%s += %s\n' % (k, make_quote(shell_quote(item)))) elif isinstance(v, bool): if v: backend_file.write('%s := 1\n' % k) + elif isinstance(v, Path): + path = self._pretty_path(Path(obj._context, v), backend_file) + backend_file.write('%s := %s\n' % (k, path)) else: backend_file.write('%s := %s\n' % (k, v)) elif isinstance(obj, HostDefines): self._process_defines(obj, backend_file, which='HOST_DEFINES') elif isinstance(obj, Defines): self._process_defines(obj, backend_file) elif isinstance(obj, GeneratedFile): @@ -1707,17 +1724,16 @@ class RecursiveMakeBackend(CommonBackend if not pp.context.get('autoconfmk', ''): pp.context['autoconfmk'] = 'autoconf.mk' pp.handleLine(b'# THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT MODIFY BY HAND.\n') pp.handleLine(b'DEPTH := @DEPTH@\n') pp.handleLine(b'topobjdir := @topobjdir@\n') pp.handleLine(b'topsrcdir := @top_srcdir@\n') pp.handleLine(b'srcdir := @srcdir@\n') pp.handleLine(b'srcdir_rel := @srcdir_rel@\n') - pp.handleLine(b'VPATH := @srcdir@\n') pp.handleLine(b'relativesrcdir := @relativesrcdir@\n') pp.handleLine(b'include $(DEPTH)/config/@autoconfmk@\n') if not stub: pp.do_include(obj.input_path) # Empty line to avoid failures when last line in Makefile.in ends # with a backslash. pp.handleLine(b'\n') pp.handleLine(b'include $(topsrcdir)/config/recurse.mk\n') diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py --- a/python/mozbuild/mozbuild/frontend/context.py +++ b/python/mozbuild/mozbuild/frontend/context.py @@ -1657,29 +1657,29 @@ VARIABLES = { """Whether profile-guided optimization is disable in this directory. """), 'OS_LIBS': (List, list, """System link libraries. This variable contains a list of system libaries to link against. """), - 'RCFILE': (unicode, unicode, + 'RCFILE': (Path, unicode, """The program .rc file. This variable can only be used on Windows. """), 'RESFILE': (unicode, unicode, """The program .res file. This variable can only be used on Windows. """), - 'RCINCLUDE': (unicode, unicode, + 'RCINCLUDE': (Path, unicode, """The resource script file to be included in the default .res file. This variable can only be used on Windows. """), 'DEFFILE': (Path, unicode, """The program .def (module definition) file. diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py --- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py +++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py @@ -222,34 +222,33 @@ class TestRecursiveMakeBackend(BackendTe lines = [l.strip() for l in open(p, 'rt').readlines()[1:] if not l.startswith('#')] self.assertEqual(lines, [ 'DEPTH := .', 'topobjdir := %s' % env.topobjdir, 'topsrcdir := %s' % env.topsrcdir, 'srcdir := %s' % env.topsrcdir, 'srcdir_rel := %s' % mozpath.relpath(env.topsrcdir, env.topobjdir), - 'VPATH := %s' % env.topsrcdir, 'relativesrcdir := .', 'include $(DEPTH)/config/autoconf.mk', '', 'FOO := foo', '', 'include $(topsrcdir)/config/recurse.mk', ]) def test_missing_makefile_in(self): """Ensure missing Makefile.in results in Makefile creation.""" env = self._consume('stub0', RecursiveMakeBackend) p = mozpath.join(env.topobjdir, 'dir2', 'Makefile') self.assertTrue(os.path.exists(p)) lines = [l.strip() for l in open(p, 'rt').readlines()] - self.assertEqual(len(lines), 11) + self.assertEqual(len(lines), 10) self.assertTrue(lines[0].startswith('# THIS FILE WAS AUTOMATICALLY')) def test_backend_mk(self): """Ensure backend.mk file is written out properly.""" env = self._consume('stub0', RecursiveMakeBackend) p = mozpath.join(env.topobjdir, 'backend.mk') @@ -314,23 +313,23 @@ class TestRecursiveMakeBackend(BackendTe """Ensure variable passthru is written out correctly.""" env = self._consume('variable_passthru', RecursiveMakeBackend) backend_path = mozpath.join(env.topobjdir, 'backend.mk') lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]] expected = { 'RCFILE': [ - 'RCFILE := foo.rc', + 'RCFILE := $(srcdir)/foo.rc', ], 'RESFILE': [ 'RESFILE := bar.res', ], 'RCINCLUDE': [ - 'RCINCLUDE := bar.rc', + 'RCINCLUDE := $(srcdir)/bar.rc', ], 'EXTRA_DEPS': [ 'EXTRA_DEPS += %s' % mozpath.join(mozpath.relpath(env.topsrcdir, env.topobjdir), 'baz.def'), ], 'WIN32_EXE_LDFLAGS': [ 'WIN32_EXE_LDFLAGS += -subsystem:console', @@ -346,38 +345,38 @@ class TestRecursiveMakeBackend(BackendTe """Ensure SOURCES and HOST_SOURCES are handled properly.""" env = self._consume('sources', RecursiveMakeBackend) backend_path = mozpath.join(env.topobjdir, 'backend.mk') lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]] expected = { 'ASFILES': [ - 'ASFILES += bar.s', - 'ASFILES += foo.asm', + 'ASFILES += $(srcdir)/bar.s', + 'ASFILES += $(srcdir)/foo.asm', ], 'CMMSRCS': [ - 'CMMSRCS += bar.mm', - 'CMMSRCS += foo.mm', + 'CMMSRCS += $(srcdir)/bar.mm', + 'CMMSRCS += $(srcdir)/foo.mm', ], 'CSRCS': [ - 'CSRCS += bar.c', - 'CSRCS += foo.c', + 'CSRCS += $(srcdir)/bar.c', + 'CSRCS += $(srcdir)/foo.c', ], 'HOST_CPPSRCS': [ - 'HOST_CPPSRCS += bar.cpp', - 'HOST_CPPSRCS += foo.cpp', + 'HOST_CPPSRCS += $(srcdir)/bar.cpp', + 'HOST_CPPSRCS += $(srcdir)/foo.cpp', ], 'HOST_CSRCS': [ - 'HOST_CSRCS += bar.c', - 'HOST_CSRCS += foo.c', + 'HOST_CSRCS += $(srcdir)/bar.c', + 'HOST_CSRCS += $(srcdir)/foo.c', ], 'SSRCS': [ - 'SSRCS += baz.S', - 'SSRCS += foo.S', + 'SSRCS += $(srcdir)/baz.S', + 'SSRCS += $(srcdir)/foo.S', ], } for var, val in expected.items(): found = [str for str in lines if str.startswith(var)] self.assertEqual(found, val) def test_exports(self): diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -45,21 +45,17 @@ def Libxul(name, output_category=None): if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['ACCESSIBILITY']: LOCAL_INCLUDES += ['!/accessible/interfaces/gecko/'] if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['CC_TYPE'] not in ('clang', 'gcc'): LOCAL_INCLUDES += [ '/widget/windows', '/xpcom/base', ] - # config/version.mk says $(srcdir)/$(RCINCLUDE), and this needs to - # be valid in both toolkit/library and toolkit/library/gtest. - # Eventually, the make backend would do its own path canonicalization - # and config/version.mk would lift the $(srcdir) - RCINCLUDE = '$(DEPTH)/toolkit/library/xulrunner.rc' + RCINCLUDE = '/toolkit/library/xulrunner.rc' Libxul_defines() if CONFIG['MOZ_NEEDS_LIBATOMIC']: OS_LIBS += ['atomic'] # This option should go away in bug 1290972, but we need to wait until # Rust 1.12 has been released. diff --git a/toolkit/xre/test/win/Makefile.in b/toolkit/xre/test/win/Makefile.in --- a/toolkit/xre/test/win/Makefile.in +++ b/toolkit/xre/test/win/Makefile.in @@ -1,14 +1,14 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. MOZ_WINCONSOLE = 1 include $(topsrcdir)/config/rules.mk -libs:: TestXREMakeCommandLineWin.ini +libs:: $(srcdir)/TestXREMakeCommandLineWin.ini $(INSTALL) $^ $(FINAL_TARGET)/ check:: @echo 'Running TestXREMakeCommandLineWin tests' @$(RUN_TEST_PROGRAM) $(FINAL_TARGET)/TestXREMakeCommandLineWin.exe