[gtkmm/gtkmm-3-24] NMake Makefiles: Clean up building demo and test programs
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-3-24] NMake Makefiles: Clean up building demo and test programs
- Date: Wed, 17 Jun 2020 05:19:57 +0000 (UTC)
commit f722f982d87fb1d82d910d022e05337d7d6ab30e
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jun 17 13:17:42 2020 +0800
NMake Makefiles: Clean up building demo and test programs
We can group some items together and "generate" the build rules for the test
programs instead of hand-writing them one-by-one, since the compiler and linker
flags for them are largly the same.
MSVC_NMake/Makefile.vc | 4 ++--
MSVC_NMake/build-rules-msvc.mak | 43 +++-------------------------------------
MSVC_NMake/create-lists-msvc.mak | 21 +++++++++-----------
3 files changed, 14 insertions(+), 54 deletions(-)
---
diff --git a/MSVC_NMake/Makefile.vc b/MSVC_NMake/Makefile.vc
index 1d1d660b..d83850b6 100644
--- a/MSVC_NMake/Makefile.vc
+++ b/MSVC_NMake/Makefile.vc
@@ -33,12 +33,12 @@ VALID_MSC = TRUE
!include pkg-ver.mak
!endif
+all: $(TARGETS) all-build-info
+
# Include the Makefile portion to convert the source and header lists
# into the lists we need for compilation and introspection
!include create-lists-msvc.mak
-all: $(TARGETS) all-build-info
-
tests: $(gtkmm_tests) all-build-info
# Include the build rules for sources, DLLs and executables
diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak
index a36ccf7f..fc2aa319 100644
--- a/MSVC_NMake/build-rules-msvc.mak
+++ b/MSVC_NMake/build-rules-msvc.mak
@@ -116,44 +116,6 @@ $(gtkmm_demo_OBJS)
<<
@-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-builder.exe: $(GTKMM_LIB) ..\tests\builder\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-child_widget.exe: $(GTKMM_LIB) ..\tests\child_widget\main.cc
..\tests\child_widget\testwindow.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-child_widget2.exe: $(GTKMM_LIB) ..\tests\child_widget2\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-child_widget_managed.exe: $(GTKMM_LIB)
..\tests\child_widget_managed\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-delete_cpp_child.exe: $(GTKMM_LIB) ..\tests\delete_cpp_child\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-dialog.exe: $(GTKMM_LIB) ..\tests\dialog\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-dialog_deletethis.exe: $(GTKMM_LIB) ..\tests\dialog_deletethis\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-gdk_rgba.exe: $(GTKMM_LIB) ..\tests\gdk_rgba\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-main_with_options.exe: $(GTKMM_LIB) ..\tests\main_with_options\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-menu_destruction.exe: $(GTKMM_LIB) ..\tests\menu_destruction\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-object_move.exe: $(GTKMM_LIB) ..\tests\object_move\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-property_notification.exe: $(GTKMM_LIB)
..\tests\property_notification\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-refcount_dialog.exe: $(GTKMM_LIB) ..\tests\refcount_dialog\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-scrolledwindow.exe: $(GTKMM_LIB) ..\tests\scrolledwindow\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-tree_model_iterator.exe: $(GTKMM_LIB)
..\tests\tree_model_iterator\main.cc
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-wrap_existing.exe: $(GTKMM_LIB) ..\tests\wrap_existing\main.cc
-
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-builder.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-child_widget.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-child_widget2.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-child_widget_managed.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-delete_cpp_child.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-dialog.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-dialog_deletethis.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-gdk_rgba.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-main_with_options.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-menu_destruction.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-object_move.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-property_notification.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-refcount_dialog.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-scrolledwindow.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-tree_model_iterator.exe \
-vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-wrap_existing.exe:
- @if not exist vs$(VSVER)\$(CFG)\$(PLAT)\$(@B) md vs$(VSVER)\$(CFG)\$(PLAT)\$(@B)
- $(CXX) $(GTKMM_DEMO_CFLAGS) $(CFLAGS) /Fo$(@D)\$(@B)\ /Fd$(@D)\$(@B)\ $** \
- /link $(LDFLAGS) $(GDKMM_LIB) $(GTKMM_DEMO_DEP_LIBS) -out:$@
- @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1
-
clean:
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exe
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.dll
@@ -161,7 +123,8 @@ clean:
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.ilk
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exp
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.lib
- @-for /f %d in ('dir /ad /b ..\tests\') do @(for %x in (obj pdb) do @if exist
vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-%d\ del /f/q vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-%d\*.%x)
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm-tests\*.pdb
+ @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm-tests\*.obj
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-demo\demo_resources.c
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-demo\*.pdb
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-demo\*.obj
@@ -181,7 +144,7 @@ clean:
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gdkmm\*.h
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gendef\*.pdb
@-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\gendef\*.obj
- @-for /f %d in ('dir /ad /b ..\tests\') do @(for %x in (obj pdb) do @if exist
vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-%d\ rd vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-test-%d)
+ @-rd vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm-tests
@-rd vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm3-demo
@-rd vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm\private
@-rd vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm
diff --git a/MSVC_NMake/create-lists-msvc.mak b/MSVC_NMake/create-lists-msvc.mak
index 1ac3abe6..6429502e 100644
--- a/MSVC_NMake/create-lists-msvc.mak
+++ b/MSVC_NMake/create-lists-msvc.mak
@@ -111,34 +111,31 @@ gdkmm_generated_private_headers = $(files_hg:.hg=_p.h)
!if [call create-lists.bat header gtkmm.mak gtkmm_demo_resources]
!endif
-!if [for %s in (..\demos\gtk-demo\*.gif) do @call create-lists.bat file gtkmm.mak %s]
+!if [for %x in (gif jpg png webm ui glsl) do @for %s in (..\demos\gtk-demo\*.%x) do @call create-lists.bat
file gtkmm.mak %s]
!endif
-!if [for %s in (..\demos\gtk-demo\*.jpg) do @call create-lists.bat file gtkmm.mak %s]
-!endif
-
-!if [for %s in (..\demos\gtk-demo\*.png) do @call create-lists.bat file gtkmm.mak %s]
+!if [call create-lists.bat footer gtkmm.mak]
!endif
-!if [for %s in (..\demos\gtk-demo\*.webm) do @call create-lists.bat file gtkmm.mak %s]
+!if [call create-lists.bat header gtkmm.mak gtkmm_tests]
!endif
-!if [for %s in (..\demos\gtk-demo\*.ui) do @call create-lists.bat file gtkmm.mak %s]
+!if [for /f %d in ('dir /ad /b ..\tests\') do @call create-lists.bat file gtkmm.mak
^vs$(VSVER)\^$(CFG)\^$(PLAT)\gtkmm3-test-%d.exe]
!endif
-!if [for %s in (..\demos\gtk-demo\*.glsl) do @call create-lists.bat file gtkmm.mak %s]
+!if [call create-lists.bat footer gtkmm.mak]
!endif
-!if [call create-lists.bat footer gtkmm.mak]
+!if [call create-lists.bat header gtkmm.mak gtkmm_tests & @(for /f %t in ('dir /ad /b ..\tests') do @call
create-lists.bat file gtkmm.mak vs$(VSVER)\$(CFG)\$(PLAT)\%t.exe) & @call create-lists.bat footer gtkmm.mak]
!endif
-!if [call create-lists.bat header gtkmm.mak gtkmm_tests]
+!if [for /f %t in ('dir /ad /b ..\tests') do @for %s in (..\tests\%t\*.cc) do @echo
vs^$(VSVER)\^$(CFG)\^$(PLAT)\gtkmm-tests\%t-%~ns.obj: %s>>gtkmm.mak & @echo. if not exist ^$(@D)\ md
^$(@D)>>gtkmm.mak & @echo. ^$(CXX) ^$(GTKMM_DEMO_CFLAGS) ^$(CFLAGS) /Fo^$(@D)\%t-%~ns.obj /Fd^$(@D)\ ^$**
/c>>gtkmm.mak & @echo.>>gtkmm.mak]
!endif
-!if [for /f %d in ('dir /ad /b ..\tests\') do @call create-lists.bat file gtkmm.mak
^vs$(VSVER)\^$(CFG)\^$(PLAT)\gtkmm3-test-%d.exe]
+!if [for /f %t in ('dir /ad /b ..\tests') do @call create-lists.bat header gtkmm.mak %t_OBJS & @(for %s in
(..\tests\%t\*.cc) do @call create-lists.bat file gtkmm.mak
vs$(VSVER)\$(CFG)\$(PLAT)\gtkmm-tests\%t-%~ns.obj) & @call create-lists.bat footer gtkmm.mak]
!endif
-!if [call create-lists.bat footer gtkmm.mak]
+!if [for /f %t in ('dir /ad /b ..\tests') do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%t.exe: ^$(GTKMM_LIB)
^$(GDKMM_LIB) ^$(%t_OBJS)>>gtkmm.mak & @echo. link ^$(LDFLAGS) ^$** ^$(GTKMM_DEMO_DEP_LIBS)
^$(LIBSIGC_LIB) /out:^$@>>gtkmm.mak & @echo.>>gtkmm.mak]
!endif
!if [for %f in (gdkmm\applaunchcontext.h) do @if not exist ..\untracked\gdk\%f if not exist ..\gdk\%f if not
exist vs$(VSVER)\$(CFG)\$(PLAT)\%f (md vs$(VSVER)\$(CFG)\$(PLAT)\gdkmm\private) & ($(PERL) --
$(GMMPROC_DIR)/gmmproc -I ../tools/m4 -I $(GMMPROC_PANGO_DIR) -I $(GMMPROC_ATK_DIR) --defs ../gdk/src
applaunchcontext ../gdk/src vs$(VSVER)/$(CFG)/$(PLAT)/gdkmm)]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]