gallium/drivers: compact compiler flags into Automake.inc
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 1 Nov 2013 18:58:27 +0000 (18:58 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sat, 16 Nov 2013 16:29:28 +0000 (16:29 +0000)
* minimise flags duplication
* distingush between VISIBILITY C and CXX flags
* set only required flags - C and/or CXX

v2: add LLVM_CFLAGS back to AM_CFLAGS (add missing backslash)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
17 files changed:
src/gallium/Automake.inc
src/gallium/drivers/freedreno/Makefile.am
src/gallium/drivers/galahad/Makefile.am
src/gallium/drivers/i915/Makefile.am
src/gallium/drivers/identity/Makefile.am
src/gallium/drivers/ilo/Makefile.am
src/gallium/drivers/llvmpipe/Makefile.am
src/gallium/drivers/noop/Makefile.am
src/gallium/drivers/nouveau/Makefile.am
src/gallium/drivers/r300/Makefile.am
src/gallium/drivers/r600/Makefile.am
src/gallium/drivers/radeon/Makefile.am
src/gallium/drivers/radeonsi/Makefile.am
src/gallium/drivers/rbug/Makefile.am
src/gallium/drivers/softpipe/Makefile.am
src/gallium/drivers/svga/Makefile.am
src/gallium/drivers/trace/Makefile.am

index fabc2af9a16ce4fe690ff5c0aeda0ec104663700..5cb0b26636b2c9fa19e897c8a1795a0fdddf1a12 100644 (file)
@@ -3,3 +3,25 @@ GALLIUM_CFLAGS = \
        -I$(top_srcdir)/src/gallium/include \
        -I$(top_srcdir)/src/gallium/auxiliary \
        $(DEFINES)
+
+# src/gallium/auxiliary must appear before src/gallium/drivers
+# because there are stupidly two rbug_context.h files in
+# different directories, and which one is included by the
+# preprocessor is determined by the ordering of the -I flags.
+GALLIUM_DRIVER_CFLAGS = \
+       -I$(srcdir)/include \
+       -I$(top_srcdir)/include \
+       -I$(top_srcdir)/src/gallium/include \
+       -I$(top_srcdir)/src/gallium/auxiliary \
+       -I$(top_srcdir)/src/gallium/drivers \
+       $(DEFINES) \
+       $(VISIBILITY_CFLAGS)
+
+GALLIUM_DRIVER_CXXFLAGS = \
+       -I$(srcdir)/include \
+       -I$(top_srcdir)/include \
+       -I$(top_srcdir)/src/gallium/include \
+       -I$(top_srcdir)/src/gallium/auxiliary \
+       -I$(top_srcdir)/src/gallium/drivers \
+       $(DEFINES) \
+       $(VISIBILITY_CXXFLAGS)
index a7b307a021b5158a81ccd6839d3361d19947183b..7947dd1a56e909307306237a6651290f6192ddc7 100644 (file)
@@ -3,16 +3,14 @@ AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libfreedreno.la
-
 AM_CFLAGS = \
        -Wno-packed-bitfield-compat \
-       -I$(top_srcdir)/src/gallium/drivers \
        -I$(top_srcdir)/src/gallium/drivers/freedreno/a3xx \
        -I$(top_srcdir)/src/gallium/drivers/freedreno/a2xx \
-       $(GALLIUM_CFLAGS) \
-       $(FREEDRENO_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
+       $(GALLIUM_DRIVER_CFLAGS) \
+       $(FREEDRENO_CFLAGS)
+
+noinst_LTLIBRARIES = libfreedreno.la
 
 libfreedreno_la_SOURCES = \
        $(C_SOURCES) \
index 5f64b93ceaf72d3aaf22d0e9eefb1401a07e66eb..17572c310366613cc279f25b3dcba8c04653827e 100644 (file)
@@ -7,9 +7,7 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers \
-       $(GALLIUM_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
+       $(GALLIUM_DRIVER_CFLAGS)
 
 noinst_LTLIBRARIES = libgalahad.la
 
index 4e6f46411dbf222072a4a99b8e4484af42ba32c2..a4a3e86625bac711bcb471cbf9cef35e9de23857 100644 (file)
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libi915.la
+AM_CFLAGS = \
+       $(GALLIUM_DRIVER_CFLAGS)
 
-AM_CPPFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers \
-       -I$(top_srcdir)/include \
-       $(GALLIUM_CFLAGS)
+noinst_LTLIBRARIES = libi915.la
 
 libi915_la_SOURCES = $(C_SOURCES)
index 1caf3286a4c7d7bdd9cdc6e9e25db89563326704..7fcbc7c061235ea622fdeefb74f6f04edc5f8606 100644 (file)
@@ -2,9 +2,7 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers \
-       $(GALLIUM_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
+       $(GALLIUM_DRIVER_CFLAGS)
 
 noinst_LTLIBRARIES = libidentity.la
 
index b5f640062af0e7f661d0bcf25b3c03722edfcb66..04d4da8e43a22f38f1def89b9aed5018843e7232 100644 (file)
@@ -26,14 +26,10 @@ AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libilo.la
-
 AM_CPPFLAGS = \
-       -I$(srcdir)/include \
        -I$(top_srcdir)/src/gallium/winsys/intel \
-       $(GALLIUM_CFLAGS)
+       $(GALLIUM_DRIVER_CFLAGS)
 
-AM_CFLAGS = \
-       $(VISIBILITY_CFLAGS)
+noinst_LTLIBRARIES = libilo.la
 
 libilo_la_SOURCES = $(C_SOURCES)
index 1a1a575b7e6ab4ab0ad399dd48d040cde7bc174d..4f881bbc88f35b01ba5db560e3145a132a3e7f9c 100644 (file)
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-AM_CPPFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers \
-       -I$(top_srcdir)/include \
-       $(GALLIUM_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
-AM_CFLAGS = $(LLVM_CFLAGS)
-AM_CXXFLAGS= $(LLVM_CXXFLAGS)
+AM_CFLAGS = \
+       $(GALLIUM_DRIVER_CFLAGS) \
+       $(LLVM_CFLAGS)
+AM_CXXFLAGS= \
+       $(GALLIUM_DRIVER_CXXFLAGS) \
+       $(LLVM_CXXFLAGS)
 
 noinst_LTLIBRARIES = libllvmpipe.la
 
index 1f4ba028f7fe152688aa8b45b2829adaa8161503..cda614ddaf3a2330c440311abb61413dda77c8c4 100644 (file)
@@ -7,9 +7,7 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers \
-       $(GALLIUM_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
+       $(GALLIUM_DRIVER_CFLAGS)
 
 noinst_LTLIBRARIES = libnoop.la
 
index 369dadabdd2c6766bf55455f9f5a05b54b0d18ba..7c052231bfac0f44438b6052110acab34c841cbd 100644 (file)
@@ -25,14 +25,12 @@ AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libnouveau.la
-
 AM_CPPFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers/nouveau/include \
-       $(GALLIUM_CFLAGS) \
+       $(GALLIUM_DRIVER_CFLAGS) \
        $(LIBDRM_CFLAGS) \
-       $(NOUVEAU_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
+       $(NOUVEAU_CFLAGS)
+
+noinst_LTLIBRARIES = libnouveau.la
 
 libnouveau_la_SOURCES = \
        $(C_SOURCES) \
index 9d6600380107de7bde33d5118c1d58889dcc7d9a..8aa6707c17506f5c375c19eb3c81732767bb5f1f 100644 (file)
@@ -3,21 +3,19 @@ AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libr300.la libr300-helper.la
-check_PROGRAMS = r300_compiler_tests
-TESTS = r300_compiler_tests
-
 AM_CFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers \
        -I$(top_srcdir)/src/mesa/program \
        -I$(top_srcdir)/src/mesa \
        -I$(top_srcdir)/src/glsl \
        -I$(top_srcdir)/src/mapi \
-       $(VISIBILITY_CFLAGS) \
-       $(GALLIUM_CFLAGS) \
+       $(GALLIUM_DRIVER_CFLAGS) \
        $(LLVM_CFLAGS) \
        $(RADEON_CFLAGS)
 
+noinst_LTLIBRARIES = libr300.la libr300-helper.la
+check_PROGRAMS = r300_compiler_tests
+TESTS = r300_compiler_tests
+
 r300_compiler_tests_LDADD = libr300.la libr300-helper.la \
        $(top_builddir)/src/gallium/auxiliary/libgallium.la \
        $(GALLIUM_DRI_LIB_DEPS)
index cede6fa1ff126fefe86e8e3748bac675e8bb141b..b2e37085f2339d460f1906ad482b5b0e0139ca22 100644 (file)
@@ -3,23 +3,15 @@ AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libr600.la
-
 AM_CFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers \
-       -I$(top_srcdir)/include \
-       $(GALLIUM_CFLAGS) \
-       $(RADEON_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
+       $(GALLIUM_DRIVER_CFLAGS) \
+       $(RADEON_CFLAGS)
 
 AM_CXXFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/src/gallium/include \
-       -I$(top_srcdir)/src/gallium/auxiliary \
-       $(RADEON_CFLAGS) \
-       $(DEFINES) \
-       $(VISIBILITY_CFLAGS)
+       $(GALLIUM_DRIVER_CXXFLAGS) \
+       $(RADEON_CFLAGS)
+
+noinst_LTLIBRARIES = libr600.la
 
 libr600_la_SOURCES = \
        $(C_SOURCES) \
@@ -29,15 +21,15 @@ libr600_la_LIBADD = ../radeon/libradeon.la
 
 if NEED_RADEON_LLVM
 
+AM_CFLAGS += \
+       $(LLVM_CFLAGS) \
+       -I$(top_srcdir)/src/gallium/drivers/radeon/
+
 libr600_la_SOURCES += \
        $(LLVM_C_SOURCES)
 
 libr600_la_LIBADD += ../radeon/libllvmradeon.la
 
-AM_CFLAGS += \
-       $(LLVM_CFLAGS) \
-       -I$(top_srcdir)/src/gallium/drivers/radeon/
-
 endif
 
 if USE_R600_LLVM_COMPILER
index a54a3aa97c7694b5d36ec31765d6c96d16965143..457fee92cc71856a3c9dd4a7eb38fa53c46ca027 100644 (file)
@@ -1,29 +1,26 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libradeon.la
 
-AM_CFLAGS = $(GALLIUM_CFLAGS) $(RADEON_CFLAGS) $(VISIBILITY_CFLAGS)
+AM_CFLAGS = \
+       $(GALLIUM_DRIVER_CFLAGS) \
+       $(RADEON_CFLAGS)
+
+noinst_LTLIBRARIES = libradeon.la
 
 libradeon_la_SOURCES = \
        $(C_SOURCES)
 
 if NEED_RADEON_LLVM
 
-libllvmradeon_la_LDFLAGS = \
-       $(LLVM_LDFLAGS)
-
 noinst_LTLIBRARIES += libllvmradeon.la
 
 libllvmradeon_la_CXXFLAGS = \
-       $(GALLIUM_CFLAGS) \
-       $(DEFINES) \
-       $(VISIBILITY_CFLAGS)
+       $(GALLIUM_DRIVER_CXXFLAGS)
 
 libllvmradeon_la_CFLAGS = \
-       $(GALLIUM_CFLAGS) \
-       $(LLVM_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
+       $(GALLIUM_DRIVER_CFLAGS) \
+       $(LLVM_CFLAGS)
 
 libllvmradeon_la_SOURCES = \
        $(LLVM_CPP_FILES) \
@@ -34,4 +31,7 @@ libllvmradeon_la_LIBADD = \
        $(LLVM_LIBS) \
        $(ELF_LIB)
 
+libllvmradeon_la_LDFLAGS = \
+       $(LLVM_LDFLAGS)
+
 endif
index 9aaab8f645fa66182a1e219b8e06eded2cf42bda..84c99f82f25f5b7e237114821c4e276f5666023b 100644 (file)
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libradeonsi.la
-
-AM_CPPFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers/radeon \
-       -I$(top_srcdir)/src/gallium/drivers \
-       -I$(top_srcdir)/include \
-       $(GALLIUM_CFLAGS) \
-       $(RADEON_CFLAGS)
 AM_CFLAGS = \
-       $(LLVM_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
+       -I$(top_srcdir)/src/gallium/drivers/radeon \
+       $(GALLIUM_DRIVER_CFLAGS) \
+       $(RADEON_CFLAGS) \
+       $(LLVM_CFLAGS)
+
+noinst_LTLIBRARIES = libradeonsi.la
 
 libradeonsi_la_SOURCES = $(C_SOURCES)
 libradeonsi_la_LIBADD = \
index 1aa65214100c7ea0353610e73a297d7e352ab407..5de7213335a85eb69c89486a9db3383719b750db 100644 (file)
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = librbug.la
-
-# GALLIUM_CFLAGS must appear before src/gallium/drivers
-# because there are stupidly two rbug_context.h files in
-# different directories, and which one is included by the
-# preprocessor is determined by the ordering of the -I flags.
 AM_CFLAGS = \
-       $(GALLIUM_CFLAGS) \
-       $(VISIBILITY_CFLAGS) \
-       -I$(top_srcdir)/src/gallium/drivers \
-       -I$(top_srcdir)/include
+       $(GALLIUM_DRIVER_CFLAGS)
+
+noinst_LTLIBRARIES = librbug.la
 
 librbug_la_SOURCES = $(C_SOURCES)
index 1048d850677e6d360d7244feb0a8af381370f487..f37c4a69d75046ed7d45e07f9c331d2536c0c1ad 100644 (file)
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-AM_CPPFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers \
-       -I$(top_srcdir)/include \
-       $(GALLIUM_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
+AM_CFLAGS = \
+       $(GALLIUM_DRIVER_CFLAGS)
 
 noinst_LTLIBRARIES = libsoftpipe.la
 
index b6fed005c2df5793dfd83253a253e1765216c9b6..54ae81437719aec7b4c797add36779f0f46b253e 100644 (file)
@@ -25,13 +25,8 @@ AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-AM_CPPFLAGS = \
-       -I$(top_srcdir)/src/gallium/drivers/svga/include \
-       -I$(top_srcdir)/src/gallium/drivers \
-       -I$(top_srcdir)/include \
-       $(GALLIUM_CFLAGS)
-
-AM_CFLAGS = $(VISIBILITY_CFLAGS)
+AM_CFLAGS = \
+       $(GALLIUM_DRIVER_CFLAGS)
 
 #On some systems -std= must be added to CFLAGS to be the last -std=
 CFLAGS += -std=gnu99
index db5904d23e6f491bf9cbb0d5733333eca95f08f6..e19f5be992b8e2290fc7bc959ae543a14c79ebf1 100644 (file)
@@ -2,8 +2,7 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-       $(GALLIUM_CFLAGS) \
-       $(VISIBILITY_CFLAGS)
+       $(GALLIUM_DRIVER_CFLAGS)
 
 noinst_LTLIBRARIES = libtrace.la