ac/debug: Move sid_tables.h generation to common code.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
diff --git a/src/amd/Makefile.am b/src/amd/Makefile.am
index 1402ca5..0a8456d 100644
--- a/src/amd/Makefile.am
+++ b/src/amd/Makefile.am
@@ -23,6 +23,6 @@
 
 noinst_LTLIBRARIES =
 
-EXTRA_DIST = $(COMMON_HEADER_FILES)
+EXTRA_DIST = $(COMMON_HEADER_FILES) $(srcdir)/common/sid_tables.py
 include Makefile.addrlib.am
 include Makefile.common.am
diff --git a/src/amd/Makefile.common.am b/src/amd/Makefile.common.am
index 1a36e48..1425dec 100644
--- a/src/amd/Makefile.common.am
+++ b/src/amd/Makefile.common.am
@@ -52,7 +52,9 @@
 
 noinst_LTLIBRARIES += $(COMMON_LIBS)
 
-common_libamd_common_la_SOURCES = $(AMD_COMPILER_FILES)
+common_libamd_common_la_SOURCES = \
+	$(AMD_COMPILER_FILES) \
+	$(AMD_GENERATED_FILES)
 
 # nir_to_llvm requires LLVM 3.9, which is only required as a minimum when
 # radv is built.
@@ -60,4 +62,8 @@
 common_libamd_common_la_SOURCES += $(AMD_NIR_FILES)
 endif
 
+$(srcdir)/common/sid_tables.h: $(srcdir)/common/sid_tables.py $(srcdir)/common/sid.h
+	$(AM_V_GEN) $(PYTHON2) $(srcdir)/common/sid_tables.py $(srcdir)/common/sid.h > $@
+
+BUILT_SOURCES = $(AMD_GENERATED_FILES)
 endif
diff --git a/src/amd/Makefile.sources b/src/amd/Makefile.sources
index 122ef71..bde02d1 100644
--- a/src/amd/Makefile.sources
+++ b/src/amd/Makefile.sources
@@ -36,3 +36,6 @@
 AMD_NIR_FILES = \
 	common/ac_nir_to_llvm.c \
 	common/ac_nir_to_llvm.h
+
+AMD_GENERATED_FILES = \
+	common/sid_tables.h
diff --git a/src/gallium/drivers/radeonsi/sid_tables.py b/src/amd/common/sid_tables.py
similarity index 100%
rename from src/gallium/drivers/radeonsi/sid_tables.py
rename to src/amd/common/sid_tables.py
diff --git a/src/gallium/drivers/radeonsi/Makefile.am b/src/gallium/drivers/radeonsi/Makefile.am
index 0ed955d..00c8a32 100644
--- a/src/gallium/drivers/radeonsi/Makefile.am
+++ b/src/gallium/drivers/radeonsi/Makefile.am
@@ -31,13 +31,4 @@
 
 noinst_LTLIBRARIES = libradeonsi.la
 
-libradeonsi_la_SOURCES = $(C_SOURCES) $(GENERATED_SOURCES)
-
-sid_tables.h: $(srcdir)/sid_tables.py $(top_srcdir)/src/amd/common/sid.h
-	$(AM_V_GEN) $(PYTHON2) $(srcdir)/sid_tables.py $(top_srcdir)/src/amd/common/sid.h > $@
-
-EXTRA_DIST = \
-	sid_tables.py
-
-BUILT_SOURCES =\
-	sid_tables.h
+libradeonsi_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/radeonsi/Makefile.sources b/src/gallium/drivers/radeonsi/Makefile.sources
index 727a9cc..15ae977 100644
--- a/src/gallium/drivers/radeonsi/Makefile.sources
+++ b/src/gallium/drivers/radeonsi/Makefile.sources
@@ -23,6 +23,3 @@
 	si_state_shaders.c \
 	si_state.h \
 	si_uvd.c
-
-GENERATED_SOURCES := \
-	sid_tables.h