gallium/drivers: compact compiler flags into Automake.inc

* 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>
This commit is contained in:
Emil Velikov 2013-11-01 18:58:27 +00:00
parent ad501a535a
commit 7dac1b470a
17 changed files with 86 additions and 111 deletions

View File

@ -3,3 +3,25 @@ GALLIUM_CFLAGS = \
-I$(top_srcdir)/src/gallium/include \ -I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \ -I$(top_srcdir)/src/gallium/auxiliary \
$(DEFINES) $(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)

View File

@ -3,16 +3,14 @@ AUTOMAKE_OPTIONS = subdir-objects
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
noinst_LTLIBRARIES = libfreedreno.la
AM_CFLAGS = \ AM_CFLAGS = \
-Wno-packed-bitfield-compat \ -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/a3xx \
-I$(top_srcdir)/src/gallium/drivers/freedreno/a2xx \ -I$(top_srcdir)/src/gallium/drivers/freedreno/a2xx \
$(GALLIUM_CFLAGS) \ $(GALLIUM_DRIVER_CFLAGS) \
$(FREEDRENO_CFLAGS) \ $(FREEDRENO_CFLAGS)
$(VISIBILITY_CFLAGS)
noinst_LTLIBRARIES = libfreedreno.la
libfreedreno_la_SOURCES = \ libfreedreno_la_SOURCES = \
$(C_SOURCES) \ $(C_SOURCES) \

View File

@ -7,9 +7,7 @@ include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \ AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \ $(GALLIUM_DRIVER_CFLAGS)
$(GALLIUM_CFLAGS) \
$(VISIBILITY_CFLAGS)
noinst_LTLIBRARIES = libgalahad.la noinst_LTLIBRARIES = libgalahad.la

View File

@ -23,11 +23,9 @@
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \
$(GALLIUM_DRIVER_CFLAGS)
noinst_LTLIBRARIES = libi915.la noinst_LTLIBRARIES = libi915.la
AM_CPPFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/include \
$(GALLIUM_CFLAGS)
libi915_la_SOURCES = $(C_SOURCES) libi915_la_SOURCES = $(C_SOURCES)

View File

@ -2,9 +2,7 @@ include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \ AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \ $(GALLIUM_DRIVER_CFLAGS)
$(GALLIUM_CFLAGS) \
$(VISIBILITY_CFLAGS)
noinst_LTLIBRARIES = libidentity.la noinst_LTLIBRARIES = libidentity.la

View File

@ -26,14 +26,10 @@ AUTOMAKE_OPTIONS = subdir-objects
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
AM_CPPFLAGS = \
-I$(top_srcdir)/src/gallium/winsys/intel \
$(GALLIUM_DRIVER_CFLAGS)
noinst_LTLIBRARIES = libilo.la noinst_LTLIBRARIES = libilo.la
AM_CPPFLAGS = \
-I$(srcdir)/include \
-I$(top_srcdir)/src/gallium/winsys/intel \
$(GALLIUM_CFLAGS)
AM_CFLAGS = \
$(VISIBILITY_CFLAGS)
libilo_la_SOURCES = $(C_SOURCES) libilo_la_SOURCES = $(C_SOURCES)

View File

@ -23,13 +23,12 @@
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
AM_CPPFLAGS = \ AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \ $(GALLIUM_DRIVER_CFLAGS) \
-I$(top_srcdir)/include \ $(LLVM_CFLAGS)
$(GALLIUM_CFLAGS) \ AM_CXXFLAGS= \
$(VISIBILITY_CFLAGS) $(GALLIUM_DRIVER_CXXFLAGS) \
AM_CFLAGS = $(LLVM_CFLAGS) $(LLVM_CXXFLAGS)
AM_CXXFLAGS= $(LLVM_CXXFLAGS)
noinst_LTLIBRARIES = libllvmpipe.la noinst_LTLIBRARIES = libllvmpipe.la

View File

@ -7,9 +7,7 @@ include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \ AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \ $(GALLIUM_DRIVER_CFLAGS)
$(GALLIUM_CFLAGS) \
$(VISIBILITY_CFLAGS)
noinst_LTLIBRARIES = libnoop.la noinst_LTLIBRARIES = libnoop.la

View File

@ -25,14 +25,12 @@ AUTOMAKE_OPTIONS = subdir-objects
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
noinst_LTLIBRARIES = libnouveau.la
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-I$(top_srcdir)/src/gallium/drivers/nouveau/include \ $(GALLIUM_DRIVER_CFLAGS) \
$(GALLIUM_CFLAGS) \
$(LIBDRM_CFLAGS) \ $(LIBDRM_CFLAGS) \
$(NOUVEAU_CFLAGS) \ $(NOUVEAU_CFLAGS)
$(VISIBILITY_CFLAGS)
noinst_LTLIBRARIES = libnouveau.la
libnouveau_la_SOURCES = \ libnouveau_la_SOURCES = \
$(C_SOURCES) \ $(C_SOURCES) \

View File

@ -3,21 +3,19 @@ AUTOMAKE_OPTIONS = subdir-objects
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc 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 = \ AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/src/mesa/program \ -I$(top_srcdir)/src/mesa/program \
-I$(top_srcdir)/src/mesa \ -I$(top_srcdir)/src/mesa \
-I$(top_srcdir)/src/glsl \ -I$(top_srcdir)/src/glsl \
-I$(top_srcdir)/src/mapi \ -I$(top_srcdir)/src/mapi \
$(VISIBILITY_CFLAGS) \ $(GALLIUM_DRIVER_CFLAGS) \
$(GALLIUM_CFLAGS) \
$(LLVM_CFLAGS) \ $(LLVM_CFLAGS) \
$(RADEON_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 \ r300_compiler_tests_LDADD = libr300.la libr300-helper.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \ $(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(GALLIUM_DRI_LIB_DEPS) $(GALLIUM_DRI_LIB_DEPS)

View File

@ -3,23 +3,15 @@ AUTOMAKE_OPTIONS = subdir-objects
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
noinst_LTLIBRARIES = libr600.la
AM_CFLAGS = \ AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \ $(GALLIUM_DRIVER_CFLAGS) \
-I$(top_srcdir)/include \ $(RADEON_CFLAGS)
$(GALLIUM_CFLAGS) \
$(RADEON_CFLAGS) \
$(VISIBILITY_CFLAGS)
AM_CXXFLAGS = \ AM_CXXFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \ $(GALLIUM_DRIVER_CXXFLAGS) \
-I$(top_srcdir)/include \ $(RADEON_CFLAGS)
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \ noinst_LTLIBRARIES = libr600.la
$(RADEON_CFLAGS) \
$(DEFINES) \
$(VISIBILITY_CFLAGS)
libr600_la_SOURCES = \ libr600_la_SOURCES = \
$(C_SOURCES) \ $(C_SOURCES) \
@ -29,15 +21,15 @@ libr600_la_LIBADD = ../radeon/libradeon.la
if NEED_RADEON_LLVM if NEED_RADEON_LLVM
AM_CFLAGS += \
$(LLVM_CFLAGS) \
-I$(top_srcdir)/src/gallium/drivers/radeon/
libr600_la_SOURCES += \ libr600_la_SOURCES += \
$(LLVM_C_SOURCES) $(LLVM_C_SOURCES)
libr600_la_LIBADD += ../radeon/libllvmradeon.la libr600_la_LIBADD += ../radeon/libllvmradeon.la
AM_CFLAGS += \
$(LLVM_CFLAGS) \
-I$(top_srcdir)/src/gallium/drivers/radeon/
endif endif
if USE_R600_LLVM_COMPILER if USE_R600_LLVM_COMPILER

View File

@ -1,29 +1,26 @@
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc 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 = \ libradeon_la_SOURCES = \
$(C_SOURCES) $(C_SOURCES)
if NEED_RADEON_LLVM if NEED_RADEON_LLVM
libllvmradeon_la_LDFLAGS = \
$(LLVM_LDFLAGS)
noinst_LTLIBRARIES += libllvmradeon.la noinst_LTLIBRARIES += libllvmradeon.la
libllvmradeon_la_CXXFLAGS = \ libllvmradeon_la_CXXFLAGS = \
$(GALLIUM_CFLAGS) \ $(GALLIUM_DRIVER_CXXFLAGS)
$(DEFINES) \
$(VISIBILITY_CFLAGS)
libllvmradeon_la_CFLAGS = \ libllvmradeon_la_CFLAGS = \
$(GALLIUM_CFLAGS) \ $(GALLIUM_DRIVER_CFLAGS) \
$(LLVM_CFLAGS) \ $(LLVM_CFLAGS)
$(VISIBILITY_CFLAGS)
libllvmradeon_la_SOURCES = \ libllvmradeon_la_SOURCES = \
$(LLVM_CPP_FILES) \ $(LLVM_CPP_FILES) \
@ -34,4 +31,7 @@ libllvmradeon_la_LIBADD = \
$(LLVM_LIBS) \ $(LLVM_LIBS) \
$(ELF_LIB) $(ELF_LIB)
libllvmradeon_la_LDFLAGS = \
$(LLVM_LDFLAGS)
endif endif

View File

@ -23,17 +23,13 @@
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc 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 = \ AM_CFLAGS = \
$(LLVM_CFLAGS) \ -I$(top_srcdir)/src/gallium/drivers/radeon \
$(VISIBILITY_CFLAGS) $(GALLIUM_DRIVER_CFLAGS) \
$(RADEON_CFLAGS) \
$(LLVM_CFLAGS)
noinst_LTLIBRARIES = libradeonsi.la
libradeonsi_la_SOURCES = $(C_SOURCES) libradeonsi_la_SOURCES = $(C_SOURCES)
libradeonsi_la_LIBADD = \ libradeonsi_la_LIBADD = \

View File

@ -23,16 +23,9 @@
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \
$(GALLIUM_DRIVER_CFLAGS)
noinst_LTLIBRARIES = librbug.la 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
librbug_la_SOURCES = $(C_SOURCES) librbug_la_SOURCES = $(C_SOURCES)

View File

@ -23,11 +23,8 @@
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
AM_CPPFLAGS = \ AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \ $(GALLIUM_DRIVER_CFLAGS)
-I$(top_srcdir)/include \
$(GALLIUM_CFLAGS) \
$(VISIBILITY_CFLAGS)
noinst_LTLIBRARIES = libsoftpipe.la noinst_LTLIBRARIES = libsoftpipe.la

View File

@ -25,13 +25,8 @@ AUTOMAKE_OPTIONS = subdir-objects
include Makefile.sources include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
AM_CPPFLAGS = \ AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers/svga/include \ $(GALLIUM_DRIVER_CFLAGS)
-I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/include \
$(GALLIUM_CFLAGS)
AM_CFLAGS = $(VISIBILITY_CFLAGS)
#On some systems -std= must be added to CFLAGS to be the last -std= #On some systems -std= must be added to CFLAGS to be the last -std=
CFLAGS += -std=gnu99 CFLAGS += -std=gnu99

View File

@ -2,8 +2,7 @@ include Makefile.sources
include $(top_srcdir)/src/gallium/Automake.inc include $(top_srcdir)/src/gallium/Automake.inc
AM_CFLAGS = \ AM_CFLAGS = \
$(GALLIUM_CFLAGS) \ $(GALLIUM_DRIVER_CFLAGS)
$(VISIBILITY_CFLAGS)
noinst_LTLIBRARIES = libtrace.la noinst_LTLIBRARIES = libtrace.la