gallium: build ddebug, noop, rbug, trace as part of auxiliary
authorMarek Olšák <marek.olsak@amd.com>
Mon, 4 Sep 2017 20:36:34 +0000 (22:36 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Feb 2018 21:08:34 +0000 (22:08 +0100)
Building gallium is faster by 7.5 seconds on a 4core/8thread 3GHz CPU.
(gallium build time is reduced by 15% when building only radeonsi)

Non-recursive makefiles are great!

14 files changed:
src/gallium/Makefile.am
src/gallium/auxiliary/Makefile.am
src/gallium/auxiliary/target-helpers/inline_debug_helper.h
src/gallium/drivers/ddebug/Makefile.sources
src/gallium/drivers/noop/Makefile.sources
src/gallium/drivers/rbug/Makefile.sources
src/gallium/drivers/trace/Makefile.sources
src/gallium/state_trackers/osmesa/Makefile.am
src/gallium/targets/d3dadapter9/Makefile.am
src/gallium/targets/dri/Makefile.am
src/gallium/targets/libgl-xlib/Makefile.am
src/gallium/targets/osmesa/Makefile.am
src/gallium/targets/pipe-loader/Makefile.am
src/gallium/tests/unit/Makefile.am

index af010c89f8d9c513d03225395dc0ae88161c2b26..81eabef106104e020e3838d6a4c8cb8eb505ee0a 100644 (file)
@@ -11,12 +11,6 @@ SUBDIRS += auxiliary/pipe-loader
 ## Gallium pipe drivers and their respective winsys'
 ##
 
-SUBDIRS += \
-       drivers/ddebug \
-       drivers/noop \
-       drivers/trace \
-       drivers/rbug
-
 ## freedreno/msm/kgsl
 if HAVE_GALLIUM_FREEDRENO
 SUBDIRS += drivers/freedreno winsys/freedreno/drm
@@ -188,6 +182,12 @@ endif
 
 EXTRA_DIST += \
        include \
+       drivers/noop/SConscript \
+       drivers/rbug/README \
+       drivers/rbug/SConscript \
+       drivers/trace/trace.xsl \
+       drivers/trace/README \
+       drivers/trace/SConscript \
        state_trackers/README \
        state_trackers/wgl targets/libgl-gdi \
        targets/graw-gdi targets/graw-null  targets/graw-xlib \
index 95a325f96b3dc653083a319f3a6b79df25b7bc97..7af3f3ce42aee9140e958eac495c304bdf17ac72 100644 (file)
@@ -1,4 +1,8 @@
 include Makefile.sources
+include $(top_srcdir)/src/gallium/drivers/ddebug/Makefile.sources
+include $(top_srcdir)/src/gallium/drivers/noop/Makefile.sources
+include $(top_srcdir)/src/gallium/drivers/rbug/Makefile.sources
+include $(top_srcdir)/src/gallium/drivers/trace/Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 noinst_LTLIBRARIES = libgallium.la
@@ -19,7 +23,11 @@ AM_CXXFLAGS = \
 libgallium_la_SOURCES = \
        $(C_SOURCES) \
        $(NIR_SOURCES) \
-       $(GENERATED_SOURCES)
+       $(GENERATED_SOURCES) \
+       $(DDEBUG_SOURCES) \
+       $(NOOP_SOURCES) \
+       $(RBUG_SOURCES) \
+       $(TRACE_SOURCES)
 
 if HAVE_LIBDRM
 
index 2443bf214682893711ce0808f7134b33eabf4833..85563769408358dcaaecae4c4035d97ab403bc11 100644 (file)
  * one or more debug driver: rbug, trace.
  */
 
-#ifdef GALLIUM_DDEBUG
 #include "ddebug/dd_public.h"
-#endif
-
-#ifdef GALLIUM_TRACE
 #include "trace/tr_public.h"
-#endif
-
-#ifdef GALLIUM_RBUG
 #include "rbug/rbug_public.h"
-#endif
-
-#ifdef GALLIUM_NOOP
 #include "noop/noop_public.h"
-#endif
 
-/*
- * TODO: Audit the following *screen_create() - all of
- * them should return the original screen on failuire.
- */
 static inline struct pipe_screen *
 debug_screen_wrap(struct pipe_screen *screen)
 {
-#if defined(GALLIUM_DDEBUG)
    screen = ddebug_screen_create(screen);
-#endif
-
-#if defined(GALLIUM_RBUG)
    screen = rbug_screen_create(screen);
-#endif
-
-#if defined(GALLIUM_TRACE)
    screen = trace_screen_create(screen);
-#endif
-
-#if defined(GALLIUM_NOOP)
    screen = noop_screen_create(screen);
-#endif
 
    if (debug_get_bool_option("GALLIUM_TESTS", FALSE))
       util_run_tests(screen);
index 1bd38274df80cf5b7635b42a42f5c6ffd8a9aa21..d43a75ba4022a234953362f1049782c279a49918 100644 (file)
@@ -1,7 +1,7 @@
-C_SOURCES := \
-       dd_context.c \
-       dd_draw.c \
-       dd_pipe.h \
-       dd_public.h \
-       dd_screen.c \
-       dd_util.h
+DDEBUG_SOURCES := \
+       $(top_srcdir)/src/gallium/drivers/ddebug/dd_context.c \
+       $(top_srcdir)/src/gallium/drivers/ddebug/dd_draw.c \
+       $(top_srcdir)/src/gallium/drivers/ddebug/dd_pipe.h \
+       $(top_srcdir)/src/gallium/drivers/ddebug/dd_public.h \
+       $(top_srcdir)/src/gallium/drivers/ddebug/dd_screen.c \
+       $(top_srcdir)/src/gallium/drivers/ddebug/dd_util.h
index 6d4228630bc07d8d8cb0944d98d5aae29ace23df..fea96e31e56be4d097753d33f2c96ef9c50788ec 100644 (file)
@@ -1,4 +1,4 @@
-C_SOURCES := \
-       noop_pipe.c \
-       noop_public.h \
-       noop_state.c
+NOOP_SOURCES := \
+       $(top_srcdir)/src/gallium/drivers/noop/noop_pipe.c \
+       $(top_srcdir)/src/gallium/drivers/noop/noop_public.h \
+       $(top_srcdir)/src/gallium/drivers/noop/noop_state.c
index f9f1d5c3a4996e3c71107537249a98ed4ccfa3ac..b21e51e3099d69d704824338c1a030705d24cf1d 100644 (file)
@@ -1,9 +1,9 @@
-C_SOURCES := \
-       rbug_context.c \
-       rbug_context.h \
-       rbug_core.c \
-       rbug_objects.c \
-       rbug_objects.h \
-       rbug_public.h \
-       rbug_screen.c \
-       rbug_screen.h
+RBUG_SOURCES := \
+       $(top_srcdir)/src/gallium/drivers/rbug/rbug_context.c \
+       $(top_srcdir)/src/gallium/drivers/rbug/rbug_context.h \
+       $(top_srcdir)/src/gallium/drivers/rbug/rbug_core.c \
+       $(top_srcdir)/src/gallium/drivers/rbug/rbug_objects.c \
+       $(top_srcdir)/src/gallium/drivers/rbug/rbug_objects.h \
+       $(top_srcdir)/src/gallium/drivers/rbug/rbug_public.h \
+       $(top_srcdir)/src/gallium/drivers/rbug/rbug_screen.c \
+       $(top_srcdir)/src/gallium/drivers/rbug/rbug_screen.h
index 4c019a3bc609d97c3c35188a49ea5dae742e829f..f3451d4c140d7135590ef282215425b5a8def421 100644 (file)
@@ -1,13 +1,13 @@
-C_SOURCES := \
-       tr_context.c \
-       tr_context.h \
-       tr_dump.c \
-       tr_dump_defines.h \
-       tr_dump.h \
-       tr_dump_state.c \
-       tr_dump_state.h \
-       tr_public.h \
-       tr_screen.c \
-       tr_screen.h \
-       tr_texture.c \
-       tr_texture.h
+TRACE_SOURCES := \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_context.c \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_context.h \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_dump.c \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_dump_defines.h \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_dump.h \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_dump_state.c \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_dump_state.h \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_public.h \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_screen.c \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_screen.h \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_texture.c \
+       $(top_srcdir)/src/gallium/drivers/trace/tr_texture.h
index e5f2a5e18a1796a65cfbdc61bd8147c525baa686..05e3ca0d739a37f1a90ed149f65a7cf390c151ee 100644 (file)
@@ -33,8 +33,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/gallium/winsys \
        -I$(top_srcdir)/src/gallium/state_trackers/glx/xlib \
        -I$(top_srcdir)/src/gallium/auxiliary \
-       -DGALLIUM_SOFTPIPE \
-       -DGALLIUM_TRACE
+       -DGALLIUM_SOFTPIPE
 
 noinst_LTLIBRARIES = libosmesa.la
 
index c2aae0c780864922e50dcd58527c810230226819..69cebbcd16fa123194b7e542344963d5f270ef93 100644 (file)
@@ -35,10 +35,7 @@ AM_CFLAGS = \
        $(VISIBILITY_CFLAGS)
 
 AM_CPPFLAGS = \
-       $(DEFINES) \
-       -DGALLIUM_DDEBUG \
-       -DGALLIUM_RBUG \
-       -DGALLIUM_TRACE
+       $(DEFINES)
 
 ninedir = $(D3D_DRIVER_INSTALL_DIR)
 nine_LTLIBRARIES = d3dadapter9.la
@@ -70,9 +67,6 @@ d3dadapter9_la_LIBADD = \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/gallium/state_trackers/nine/libninetracker.la \
        $(top_builddir)/src/util/libmesautil.la \
-       $(top_builddir)/src/gallium/drivers/ddebug/libddebug.la \
-       $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
-       $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
        $(EXPAT_LIBS) \
        $(GALLIUM_COMMON_LIB_DEPS)
 
index 1d05d91a6103b743ef4c35e6b4c8b08639d02e54..99688285184d9c8a8892c995461efd0181155112 100644 (file)
@@ -9,11 +9,7 @@ AM_CFLAGS = \
        $(GALLIUM_TARGET_CFLAGS)
 
 AM_CPPFLAGS = \
-       $(DEFINES) \
-        -DGALLIUM_DDEBUG \
-       -DGALLIUM_NOOP \
-       -DGALLIUM_RBUG \
-       -DGALLIUM_TRACE
+       $(DEFINES)
 
 dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = gallium_dri.la
@@ -47,10 +43,6 @@ gallium_dri_la_LIBADD = \
        $(top_builddir)/src/gallium/state_trackers/dri/libdri.la \
        $(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
-        $(top_builddir)/src/gallium/drivers/ddebug/libddebug.la \
-       $(top_builddir)/src/gallium/drivers/noop/libnoop.la \
-       $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
-       $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
        $(top_builddir)/src/mapi/shared-glapi/libglapi.la \
        $(SELINUX_LIBS) \
        $(EXPAT_LIBS) \
index 1c622946a90ee55adff4a34ae8f93b951b78349a..56d548e7c1585d0a26bc2b3d927e35de6057e3de 100644 (file)
@@ -35,9 +35,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/gallium/state_trackers/glx/xlib \
        -I$(top_srcdir)/src/gallium/auxiliary \
        -I$(top_srcdir)/src/gallium/winsys \
-       -DGALLIUM_SOFTPIPE \
-       -DGALLIUM_RBUG \
-       -DGALLIUM_TRACE
+       -DGALLIUM_SOFTPIPE
 
 AM_CFLAGS = $(X11_INCLUDES)
 
@@ -61,8 +59,6 @@ lib@GL_LIB@_la_LIBADD = \
        $(top_builddir)/src/gallium/state_trackers/glx/xlib/libxlib.la \
        $(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la \
        $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \
-       $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
-       $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
        $(top_builddir)/src/mapi/glapi/libglapi.la \
        $(top_builddir)/src/mesa/libmesagallium.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
index f8bee5ef6735878e5ad79bd825754c9b9313f1a9..dc4d49e10724ff0642f2c2cde121630e85daeea2 100644 (file)
@@ -33,8 +33,7 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/src/gallium/drivers \
        -I$(top_srcdir)/src/gallium/winsys \
        -I$(top_srcdir)/src/gallium/auxiliary \
-       -DGALLIUM_SOFTPIPE \
-       -DGALLIUM_TRACE
+       -DGALLIUM_SOFTPIPE
 
 lib_LTLIBRARIES = lib@OSMESA_LIB@.la
 
@@ -60,7 +59,6 @@ lib@OSMESA_LIB@_la_LIBADD = \
        $(top_builddir)/src/mesa/libmesagallium.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \
-       $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
        $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \
        $(top_builddir)/src/gallium/state_trackers/osmesa/libosmesa.la \
        $(top_builddir)/src/mapi/glapi/libglapi.la \
index 4b84886f30051ce8837c317be8806dae09bd3895..3c5010c669b92a567056a6c28d7952d5b7982129 100644 (file)
@@ -31,9 +31,7 @@ AM_CPPFLAGS = \
        -I$(top_builddir)/src/util \
        $(GALLIUM_PIPE_LOADER_DEFINES) \
        $(LIBDRM_CFLAGS) \
-       $(VISIBILITY_CFLAGS) \
-       -DGALLIUM_RBUG \
-       -DGALLIUM_TRACE
+       $(VISIBILITY_CFLAGS)
 
 pipedir = $(libdir)/gallium-pipe
 pipe_LTLIBRARIES =
@@ -57,8 +55,6 @@ PIPE_LIBS += \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/compiler/nir/libnir.la \
        $(top_builddir)/src/util/libmesautil.la \
-       $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
-       $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
        $(GALLIUM_COMMON_LIB_DEPS)
 
 AM_LDFLAGS = \
index c9bede75bed8d01f7d68e857725488f438d108bb..9f1d3b98cde9117948941d250ef1d2c9a9e1ef25 100644 (file)
@@ -14,7 +14,6 @@ AM_CPPFLAGS = \
 LDADD = \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(top_builddir)/src/util/libmesautil.la \
-       $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
        $(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \
        $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \
        $(GALLIUM_COMMON_LIB_DEPS)