MAKEFILE: Auto-generate dependencies for scummvm.rc

This commit is contained in:
Orgad Shaneh 2021-04-06 22:17:08 +03:00 committed by Eugene Sandulenko
parent f2f64161a1
commit 59752c2835
2 changed files with 10 additions and 14 deletions

View File

@ -89,7 +89,7 @@ MODULE_DIRS += $(sort $(dir $(DETECT_OBJS)))
endif
# Depdir information
DEPDIRS = $(addsuffix $(DEPDIR),$(MODULE_DIRS))
DEPDIRS = $(addsuffix $(DEPDIR),$(MODULE_DIRS)) dists/$(DEPDIR)
DEPFILES =
# Make base/version.o depend on all other object files. This way if anything is
@ -203,9 +203,17 @@ endif
$(QUIET_AS)$(AS) $(ASFLAGS) $(<) -o $@
# Build rule for Windows resource files
# TODO: Support dependency tracking
# The regular expression is a portable form of ^(.*\s(FILE|ICON|RT_MANIFEST|DATA)|#include)\s+"([^"]*)".*$
# This finds lines in the form '... FILE "path/file.ext" ...' (and also ICON and #include)
# and replaces them with the $(srcdir)/path/file.ext \
# The second sed removes winresrc.h (system include) and config.h (not in srcdir, printed
# by the echo before sed), and strips the trailing backslash on the last line.
%.o: %.rc
$(QUIET)$(MKDIR) $(*D)
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
$(QUIET)echo "$@: $< config.h config.mk \\" > $(*D)/$(DEPDIR)/scummvm.d
$(QUIET)sed -n 's:^\(.*[[:space:]]\(FILE\|ICON\|RT_MANIFEST\|DATA\)\|#include\)[[:space:]][[:space:]]*"\([^"]*\)".*$$: $(srcdir)/\3 \\:p; ' $(<) | \
sed '/winresrc\.h\|config\.h/d; $$ s/ \\//' >> $(*D)/$(DEPDIR)/scummvm.d
$(QUIET_WINDRES)$(WINDRES) $(WINDRESFLAGS) $(CPPFLAGS) $(<) -o $@
ifdef USE_NASM

View File

@ -2,18 +2,6 @@
# Windows specific
#
dists/scummvm.o: \
config.h \
config.mk \
$(srcdir)/icons/scummvm.ico \
$(srcdir)/icons/count.ico \
$(srcdir)/base/internal_version.h \
$(srcdir)/base/internal_plugins.h \
$(DIST_FILES_THEMES) \
$(DIST_FILES_NETWORKING) \
$(DIST_FILES_ENGINEDATA) \
$(DIST_FILES_SHADERS)
# Special target to create a win32 snapshot binary (for Inno Setup)
win32dist: all
mkdir -p $(WIN32PATH)