[gtk/split-out-gdk-gtk-source-list-3-24: 3/3] MSVC builds: Generate enumerations in gdk/ and gtk/



commit da4ab2439e3548aadac7d9e79f6be624779a7fa0
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Jul 30 14:44:55 2019 +0800

    MSVC builds: Generate enumerations in gdk/ and gtk/
    
    This will make the MSVC builds generate the enumeration sources in gdk/
    and gtk/, so that the MSVC projects will no longer need to depend on
    those being dist'ed.

 build/win32/create-lists-msvc.mak | 18 +++++++++++
 build/win32/generate-msvc.mak     | 68 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+)
---
diff --git a/build/win32/create-lists-msvc.mak b/build/win32/create-lists-msvc.mak
index 4b2df561b3..387526c918 100644
--- a/build/win32/create-lists-msvc.mak
+++ b/build/win32/create-lists-msvc.mak
@@ -74,7 +74,25 @@ 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
+
 !include resources_sources.mak
 
 !if [del /f /q resources_sources.mak]
+!endif
+
+# Get absolute path of glib-mkenums
+!if [call create-lists.bat header gtk_sources.mak GLIB_MKENUMS_ABS]
+!endif
+
+!if [for %f in ($(GLIB_MKENUMS)) do @call create-lists.bat file gtk_sources.mak %~ff]
+!endif
+
+!if [call create-lists.bat footer gtk_sources.mak]
+!endif
+
+!include gtk_sources.mak
+
+!if [del /f /q gtk_sources.mak]
 !endif
\ No newline at end of file
diff --git a/build/win32/generate-msvc.mak b/build/win32/generate-msvc.mak
index 755a39a1c4..461fb29aee 100644
--- a/build/win32/generate-msvc.mak
+++ b/build/win32/generate-msvc.mak
@@ -36,6 +36,8 @@ all:  \
        ..\..\gdk\gdkmarshalers.c       \
        ..\..\gdk\gdkresources.h        \
        ..\..\gdk\gdkresources.c        \
+       ..\..\gdk\gdkenumtypes.h        \
+       ..\..\gdk\gdkenumtypes.c        \
        ..\..\gtk\gtk-win32.rc  \
        ..\..\gtk\libgtk3.manifest      \
        ..\..\gtk\gtkdbusgenerated.h    \
@@ -44,6 +46,10 @@ all: \
        ..\..\gtk\gtk.gresource.xml     \
        ..\..\gtk\gtkmarshalers.h       \
        ..\..\gtk\gtkmarshalers.c       \
+       ..\..\gtk\gtktypebuiltins.h     \
+       ..\..\gtk\gtktypebuiltins.c     \
+       ..\..\gtk\gtkprivatetypebuiltins.h      \
+       ..\..\gtk\gtkprivatetypebuiltins.c      \
        ..\..\gtk\gtkresources.h        \
        ..\..\gtk\gtkresources.c        \
        ..\..\demos\gtk-demo\demos.h
@@ -105,6 +111,27 @@ all:       \
        @if not "$(GDK_PIXBUF_PIXDATA)" == "" set GDK_PIXBUF_PIXDATA=$(GDK_PIXBUF_PIXDATA)
        @$(GLIB_COMPILE_RESOURCES) $(GDK_RESOURCES_ARGS) --generate-source
 
+# Create temporary Makefile for glib-mkenums in ..\..\gdk
+..\..\gdk\mkenums-msvc.mak:
+       @echo !include Makefile.inc>$@
+       @echo gdkenumtypes.h: gdkenumtypes.h.template ^$(gdk_public_h_sources) 
^$(gdk_deprecated_h_sources)>>$@
+       @echo.  @echo Generating ^$@...>>$@
+       @echo.  @^$(PYTHON) ^$(GLIB_MKENUMS_ABS) --template=^$@.template ^$**^>^$@>> $@
+       @echo.>>$@
+       @echo gdkenumtypes.c: gdkenumtypes.c.template ^$(gdk_public_h_sources) 
^$(gdk_deprecated_h_sources)>>$@
+       @echo.  @echo Generating ^$@...>>$@
+       @echo.  @^$(PYTHON) ^$(GLIB_MKENUMS_ABS) --template=^$@.template ^$**^>^$@>> $@
+
+..\..\gdk\gdkenumtypes.h: ..\..\gdk\gdkenumtypes.h.template $(gdk_pub_headers)
+..\..\gdk\gdkenumtypes.c: ..\..\gdk\gdkenumtypes.c.template $(gdk_pub_headers)
+
+..\..\gdk\gdkenumtypes.h ..\..\gdk\gdkenumtypes.c:
+       @$(MAKE) /nologo /f generate-msvc.mak ..\..\gdk\mkenums-msvc.mak
+       @cd ..\..\gdk
+       @$(MAKE) /nologo /f mkenums-msvc.mak PYTHON=$(PYTHON) GLIB_MKENUMS_ABS=$(GLIB_MKENUMS_ABS) $(@F)
+       @del mkenums-msvc.mak
+       @cd $(MAKEDIR)
+
 ..\..\gtk\libgtk3.manifest: ..\..\gtk\libgtk3.manifest.in
        @echo Generating $@...
        @$(PYTHON) replace.py   \
@@ -183,9 +210,48 @@ all:       \
        @$(PYTHON) $(GLIB_GENMARSHAL) $(GTK_MARSHALERS_FLAGS) --body $** >> $@.tmp
        @move $@.tmp $@
 
+..\..\gtk\mkenums-msvc.mak:
+       @echo !include a11y\Makefile.inc>$@
+       @echo !include deprecated\Makefile.inc>>$@
+       @echo !include inspector\Makefile.inc>>$@
+       @echo !include Makefile.inc>>$@
+       @echo gtktypebuiltins.h: gtktypebuiltins.h.template ^$(gtk_public_h_sources) ^$(a11y_h_sources) 
^$(deprecated_h_sources)>>$@
+       @echo.  @echo Generating ^$@...>>$@
+       @echo.  @^$(PYTHON) ^$(GLIB_MKENUMS_ABS) --template=^$@.template ^$**^>^$@>> $@
+       @echo.>>$@
+       @echo gtktypebuiltins.c: gtktypebuiltins.h.template ^$(gtk_public_h_sources) ^$(a11y_h_sources) 
^$(deprecated_h_sources)>>$@
+       @echo.  @echo Generating ^$@...>>$@
+       @echo.  @^$(PYTHON) ^$(GLIB_MKENUMS_ABS) --template=^$@.template ^$**^>^$@>> $@
+       @echo.>>$@
+       @echo gtkprivatetypebuiltins.h: ^$(gtk_private_type_h_sources) gtkprivatetypebuiltins.h.template>>$@
+       @echo.  @echo Generating ^$@...>>$@
+       @echo.  @^$(PYTHON) ^$(GLIB_MKENUMS_ABS) --template=^$@.template ^$**^>^$@>> $@
+       @echo.>>$@
+       @echo gtkprivatetypebuiltins.c: ^$(gtk_private_type_h_sources) gtkprivatetypebuiltins.c.template>>$@
+       @echo.  @echo Generating ^$@...>>$@
+       @echo.  @^$(PYTHON) ^$(GLIB_MKENUMS_ABS) --template=^$@.template ^$**^>^$@>> $@
+       @echo.>>$@
+
+..\..\gtk\gtktypebuiltins.h: ..\..\gtk\gtktypebuiltins.h.template
+..\..\gtk\gtktypebuiltins.c: ..\..\gtk\gtktypebuiltins.c.template
+..\..\gtk\gtkprivatetypebuiltins.h: ..\..\gtk\gtkprivatetypebuiltins.h.template
+..\..\gtk\gtkprivatetypebuiltins.c: ..\..\gtk\gtkprivatetypebuiltins.c.template
+
+..\..\gtk\gtktypebuiltins.h ..\..\gtk\gtktypebuiltins.c        \
+..\..\gtk\gtkprivatetypebuiltins.h ..\..\gtk\gtkprivatetypebuiltins.c:
+       @$(MAKE) /nologo /f generate-msvc.mak ..\..\gtk\mkenums-msvc.mak
+       @cd ..\..\gtk
+       @$(MAKE) /nologo /f mkenums-msvc.mak PYTHON=$(PYTHON) GLIB_MKENUMS_ABS=$(GLIB_MKENUMS_ABS) $(@F)
+       @del mkenums-msvc.mak
+       @cd $(MAKEDIR)
+
 # Remove the generated files
 clean:
        @-del /f /q ..\..\demos\gtk-demo\demos.h
+       @-del /f /q ..\..\gtk\gtkprivatetypebuiltins.c
+       @-del /f /q ..\..\gtk\gtkprivatetypebuiltins.h
+       @-del /f /q ..\..\gtk\gtktypebuiltins.c
+       @-del /f /q ..\..\gtk\gtktypebuiltins.h
        @-del /f /q ..\..\gtk\gtkresources.c
        @-del /f /q ..\..\gtk\gtkresources.h
        @-del /f /q ..\..\gtk\gtkmarshalers.c
@@ -196,6 +262,8 @@ clean:
        @-del /f /q ..\..\gtk\gtkdbusgenerated.h
        @-del /f /q ..\..\gtk\libgtk3.manifest
        @-del /f /q ..\..\gtk\gtk-win32.rc
+       @-del /f /q ..\..\gdk\gdkenumtypes.c
+       @-del /f /q ..\..\gdk\gdkenumtypes.h
        @-del /f /q ..\..\gdk\gdkresources.c
        @-del /f /q ..\..\gdk\gdkresources.h
        @-del /f /q ..\..\gdk\gdk.gresource.xml


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]