build/win32/generate-msvc.mak: Generate GResource sources for demos

...for the demos we build in the MSVC projects, so those that are not
built by the projects are not covered by this change.  This is so that
we can reduce the files that we are actually dist'ing in a release
tarball (see MR !1001).
This commit is contained in:
Chun-wei Fan 2019-07-31 18:41:24 +08:00
parent 6775e63d99
commit 8200b08d82
2 changed files with 34 additions and 1 deletions

View File

@ -74,6 +74,27 @@ NULL=
!if [for %f in (..\..\gtk\inspector\*.ui ..\..\gtk\inspector\logo.png ..\..\gtk\emoji\emoji.data) do @call create-lists.bat file resources_sources.mak %f]
!endif
!if [call create-lists.bat footer resources_sources.mak]
!endif
!if [call create-lists.bat header resources_sources.mak GTK_DEMO_RESOURCES]
!endif
!if [for /f %f in ('$(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir=..\..\demos\gtk-demo ..\..\demos\gtk-demo\demo.gresource.xml') do @call create-lists.bat file resources_sources.mak %f]
!endif
!if [call create-lists.bat footer resources_sources.mak]
!endif
!if [call create-lists.bat header resources_sources.mak ICON_BROWSER_RESOURCES]
!endif
!if [for /f %f in ('$(GLIB_COMPILE_RESOURCES) --sourcedir=..\..\demos\icon-browser --generate-dependencies ..\..\demos\icon-browser\iconbrowser.gresource.xml') do @call create-lists.bat file resources_sources.mak %f]
!endif
!if [call create-lists.bat footer resources_sources.mak]
!endif
!include resources_sources.mak
!if [del /f /q resources_sources.mak]

View File

@ -46,7 +46,9 @@ all: \
..\..\gtk\gtkmarshalers.c \
..\..\gtk\gtkresources.h \
..\..\gtk\gtkresources.c \
..\..\demos\gtk-demo\demos.h
..\..\demos\gtk-demo\demos.h \
..\..\demos\gtk-demo\demo_resources.c \
..\..\demos\icon-browser\resources.c
# Copy the pre-defined config.h.win32 and demos.h.win32
..\..\config.h: ..\..\config.h.win32
@ -183,8 +185,18 @@ all: \
@$(PYTHON) $(GLIB_GENMARSHAL) $(GTK_MARSHALERS_FLAGS) --body $** >> $@.tmp
@move $@.tmp $@
..\..\demos\gtk-demo\demo_resources.c: ..\..\demos\gtk-demo\demo.gresource.xml $(GTK_DEMO_RESOURCES)
@echo Generating $@...
@$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(@D) --generate-source $(@D)\demo.gresource.xml
..\..\demos\icon-browser\resources.c: ..\..\demos\icon-browser\iconbrowser.gresource.xml $(ICON_BROWSER_RESOURCES)
@echo Generating $@...
@$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(@D) --generate-source $(@D)\iconbrowser.gresource.xml
# Remove the generated files
clean:
@-del /f /q ..\..\demos\icon-browser\resources.c
@-del /f /q ..\..\demos\gtk-demo\demo_resources.c
@-del /f /q ..\..\demos\gtk-demo\demos.h
@-del /f /q ..\..\gtk\gtkresources.c
@-del /f /q ..\..\gtk\gtkresources.h