forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1656141 - Create res and rc files based on the name of the binary…
… they are linked into. r=firefox-build-system-reviewers,rstewart This will allow creating separate res files for e.g. SIMPLE_PROGRAMS. Differential Revision: https://phabricator.services.mozilla.com/D86155
- Loading branch information
Showing
4 changed files
with
18 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,6 @@ ifndef INCLUDED_CONFIG_MK | |
include $(topsrcdir)/config/config.mk | ||
endif | ||
|
||
ifndef INCLUDED_VERSION_MK | ||
include $(MOZILLA_DIR)/config/version.mk | ||
endif | ||
|
||
USE_AUTOTARGETS_MK = 1 | ||
include $(MOZILLA_DIR)/config/makefiles/makeutils.mk | ||
|
||
|
@@ -403,6 +399,12 @@ everything:: | |
# Dependencies which, if modified, should cause everything to rebuild | ||
GLOBAL_DEPS += Makefile $(addprefix $(DEPTH)/config/,$(INCLUDED_AUTOCONF_MK)) $(MOZILLA_DIR)/config/config.mk | ||
|
||
ifeq ($(MOZ_WIDGET_TOOLKIT),windows) | ||
resfile = $(notdir $1).res | ||
else | ||
resfile = | ||
endif | ||
|
||
############################################## | ||
ifdef COMPILE_ENVIRONMENT | ||
compile:: host target | ||
|
@@ -452,11 +454,11 @@ endef | |
# PROGRAM = Foo | ||
# creates OBJS, links with LIBS to create Foo | ||
# | ||
$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(RESFILE) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET)) | ||
$(PROGRAM): $(PROGOBJS) $(STATIC_LIBS) $(EXTRA_DEPS) $(call resfile,$(PROGRAM)) $(GLOBAL_DEPS) $(call mkdir_deps,$(FINAL_TARGET)) | ||
$(REPORT_BUILD) | ||
@$(RM) $@.manifest | ||
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH)) | ||
$(LINKER) -OUT:$@ -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_OBJS) $(RESFILE) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS) | ||
$(LINKER) -OUT:$@ -PDB:$(LINK_PDBFILE) -IMPLIB:$(basename $(@F)).lib $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_PROGRAM_LDFLAGS) $($(notdir $@)_OBJS) $(filter %.res,$^) $(STATIC_LIBS) $(SHARED_LIBS) $(OS_LIBS) | ||
ifdef MSMANIFEST_TOOL | ||
@if test -f [email protected]; then \ | ||
echo "Manifest in objdir is not supported"; \ | ||
|
@@ -467,7 +469,7 @@ ifdef MSMANIFEST_TOOL | |
fi | ||
endif # MSVC with manifest tool | ||
else # !WINNT || GNU_CC | ||
$(call EXPAND_CC_OR_CXX,$@) -o $@ $(COMPUTED_CXX_LDFLAGS) $(PGO_CFLAGS) $($(notdir $@)_OBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(OS_LIBS) | ||
$(call EXPAND_CC_OR_CXX,$@) -o $@ $(COMPUTED_CXX_LDFLAGS) $(PGO_CFLAGS) $($(notdir $@)_OBJS) $(filter %.res,$^) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(STATIC_LIBS) $(MOZ_PROGRAM_LDFLAGS) $(SHARED_LIBS) $(OS_LIBS) | ||
$(call py_action,check_binary,--target $@) | ||
endif # WINNT && !GNU_CC | ||
|
||
|
@@ -598,12 +600,12 @@ endif | |
# symlinks back to the originals. The symlinks are a no-op for stabs debugging, | ||
# so no need to conditionalize on OS version or debugging format. | ||
|
||
$(SHARED_LIBRARY): $(OBJS) $(RESFILE) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS) | ||
$(SHARED_LIBRARY): $(OBJS) $(call resfile,$(SHARED_LIBRARY)) $(STATIC_LIBS) $(EXTRA_DEPS) $(GLOBAL_DEPS) | ||
$(REPORT_BUILD) | ||
ifndef INCREMENTAL_LINKER | ||
$(RM) $@ | ||
endif | ||
$(MKSHLIB) $($@_OBJS) $(RESFILE) $(LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS) | ||
$(MKSHLIB) $($@_OBJS) $(filter %.res,$^) $(LDFLAGS) $(STATIC_LIBS) $(SHARED_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS) | ||
$(call py_action,check_binary,--target $@) | ||
|
||
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH)) | ||
|
@@ -859,7 +861,7 @@ endif | |
|
||
endif | ||
|
||
$(RESFILE): %.res: $(RCFILE) | ||
%.res: $(or $(RCFILE),%.rc) | ||
$(REPORT_BUILD) | ||
@echo Creating Resource file: $@ | ||
ifdef GNU_CC | ||
|
@@ -868,6 +870,9 @@ else | |
$(call WINEWRAP,$(RC)) $(RCFLAGS) -r $(DEFINES) $(INCLUDES:-I%=-I$(call relativize,%)) $(OUTOPTION)$@ $(call relativize,$<) | ||
endif | ||
|
||
$(notdir $(addsuffix .rc,$(PROGRAM) $(SHARED_LIBRARY) module)): %.rc: $(RCINCLUDE) $(MOZILLA_DIR)/config/create_rc.py | ||
$(PYTHON3) $(MOZILLA_DIR)/config/create_rc.py '$(if $(filter module,$*),,$*)' '$(RCINCLUDE)' | ||
|
||
# Cancel GNU make built-in implicit rules | ||
MAKEFLAGS += -r | ||
|
||
|
This file was deleted.
Oops, something went wrong.