r300g: Use automake to generate Makefile v3
authorTom Stellard <tstellar@gmail.com>
Mon, 20 Feb 2012 00:38:58 +0000 (19:38 -0500)
committerTom Stellard <tstellar@gmail.com>
Sun, 26 Feb 2012 20:13:47 +0000 (15:13 -0500)
v2:
  - s/$(top_builddir)/$(top_srcdir)/
  - Always generate Makefile.in

v3:
  - Fixes from Matt Turner
  - Use Mesa CFLAGS

configure.ac
src/gallium/drivers/r300/.gitignore [new file with mode: 0644]
src/gallium/drivers/r300/Makefile [deleted file]
src/gallium/drivers/r300/Makefile.am [new file with mode: 0644]
src/gallium/drivers/r300/compiler/tests/.gitignore [deleted file]
src/gallium/drivers/r300/compiler/tests/Makefile [deleted file]

index 627f9c2289ccc9efa2cb37f7cd3cb514420135d5..0caa1b1bdf512b6694b4b3bb29fcf58f36e64be1 100644 (file)
@@ -1932,6 +1932,7 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
 
 dnl Substitute the config
 AC_CONFIG_FILES([configs/autoconf
+               src/gallium/drivers/r300/Makefile
                src/gbm/Makefile
                src/gbm/main/gbm.pc
                src/egl/wayland/Makefile
diff --git a/src/gallium/drivers/r300/.gitignore b/src/gallium/drivers/r300/.gitignore
new file mode 100644 (file)
index 0000000..e119a07
--- /dev/null
@@ -0,0 +1,5 @@
+Makefile
+Makefile.in
+r300_compiler_tests
+.libs/
+.deps/
diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile
deleted file mode 100644 (file)
index 6346ab1..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = r300
-
-# get C_SOURCES
-include Makefile.sources
-
-# needed to build non-libmesagallium.a targets
-C_SOURCES += \
-       $(TOP)/src/glsl/ralloc.c \
-       $(TOP)/src/mesa/program/register_allocate.c
-
-#This is for libdrm include path
-CFLAGS+=$(RADEON_CFLAGS)
-
-LIBRARY_INCLUDES = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/glsl
-
-include ../../Makefile.template
-
-test: default
-       @$(MAKE) -s -C compiler/tests/
diff --git a/src/gallium/drivers/r300/Makefile.am b/src/gallium/drivers/r300/Makefile.am
new file mode 100644 (file)
index 0000000..8ec47d7
--- /dev/null
@@ -0,0 +1,38 @@
+include Makefile.sources
+
+noinst_LIBRARIES = libr300.a
+check_PROGRAMS = r300_compiler_tests
+testdir = compiler/tests
+TESTS = r300_compiler_tests
+
+AM_CFLAGS = \
+       -I$(top_srcdir)/src/gallium/include \
+       -I$(top_srcdir)/src/gallium/auxiliary \
+       -I$(top_srcdir)/src/gallium/drivers \
+       -I$(top_srcdir)/include \
+       -I$(top_srcdir)/src/mesa \
+       -I$(top_srcdir)/src/glsl \
+       -I$(top_srcdir)/src/mapi \
+       $(LLVM_CFLAGS) \
+       $(RADEON_CFLAGS) \
+       $(DEFINES) \
+       $(ASM_FLAGS) \
+       $(PIC_FLAGS)
+
+libr300_a_SOURCES = \
+       $(C_SOURCES) \
+       $(top_srcdir)/src/glsl/ralloc.c \
+       $(top_srcdir)/src/mesa/program/register_allocate.c
+
+r300_compiler_tests_LDADD = libr300.a
+r300_compiler_tests_CPPFLAGS = \
+       -I$(top_srcdir)/src/gallium/drivers/r300/compiler
+r300_compiler_tests_SOURCES = \
+       $(testdir)/r300_compiler_tests.c \
+       $(testdir)/radeon_compiler_util_tests.c \
+       $(testdir)/rc_test_helpers.c \
+       $(testdir)/unit_test.c
+
+# FIXME: remove this when the rest of the gallium
+# build system is converted to automake.
+default: libr300.a
diff --git a/src/gallium/drivers/r300/compiler/tests/.gitignore b/src/gallium/drivers/r300/compiler/tests/.gitignore
deleted file mode 100644 (file)
index 85672fe..0000000
+++ /dev/null
@@ -1 +0,0 @@
-radeon_compiler_util_tests
diff --git a/src/gallium/drivers/r300/compiler/tests/Makefile b/src/gallium/drivers/r300/compiler/tests/Makefile
deleted file mode 100644 (file)
index fe83e5d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-TOP = ../../../../../..
-include $(TOP)/configs/current
-
-CFLAGS += -Wall -Werror
-
-### Basic defines ###
-TESTS =        r300_compiler_tests
-
-TEST_SOURCES := $(TESTS:=.c)
-
-SHARED_SOURCES =               \
-       radeon_compiler_util_tests.c    \
-       rc_test_helpers.c       \
-       unit_test.c
-
-C_SOURCES = $(SHARED_SOURCES) $(TEST_SOURCES)
-
-INCLUDES = \
-       -I. \
-       -I..
-
-COMPILER_LIB = ../../libr300.a
-
-##### TARGETS #####
-
-default: depend run_tests
-
-depend: $(C_SOURCES)
-       rm -f depend
-       touch depend
-       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $^ 2> /dev/null
-
-# Remove .o and backup files
-clean:
-       rm -f $(TESTS) depend depend.bak
-
-$(TESTS): $(TESTS:=.o) $(SHARED_SOURCES:.c=.o) $(COMPILER_LIB)
-       $(APP_CC) -o $@ $^
-
-run_tests: $(TESTS)
-       @echo "RUNNING TESTS:"
-       @echo ""
-       $(foreach test, $^, @./$(test))
-
-.PHONY: $(COMPILER_LIB)
-$(COMPILER_LIB):
-       $(MAKE) -C ../..
-
-##### RULES #####
-.c.o:
-       $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
-
-
-sinclude depend