build: Use subdir-objects automake option
authorKristian Høgsberg <krh@bitplanet.net>
Sat, 1 Feb 2014 07:49:33 +0000 (23:49 -0800)
committerKristian Høgsberg <krh@bitplanet.net>
Sat, 1 Feb 2014 07:49:33 +0000 (23:49 -0800)
This makes automake place the object files in the same subdir as the
source file.  For a recursive build system as we have now, there's
no difference, but with a non-recursive build system it means that
the object files don't all end up in the toplevel directory.

configure.ac
tests/Makefile.am

index 7c2a2c5..dd2639f 100644 (file)
@@ -21,7 +21,7 @@ AC_CONFIG_HEADERS([config.h])
 AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
 
-AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests])
+AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests subdir-objects])
 
 AM_SILENT_RULES([yes])
 
index 8b85146..1286514 100644 (file)
@@ -52,7 +52,6 @@ AM_CPPFLAGS =                                 \
        -I$(top_srcdir)/src                     \
        -I$(top_srcdir)/shared                  \
        -I$(top_builddir)/src                   \
-       -DUNIT_TEST                             \
        $(COMPOSITOR_CFLAGS)
 
 surface_global_test_la_SOURCES = surface-global-test.c
@@ -133,16 +132,17 @@ if ENABLE_XWAYLAND_TEST
 xwayland_test = xwayland.weston
 endif
 
+matrix_test_CPPFLAGS = -DUNIT_TEST
 matrix_test_SOURCES =                          \
        matrix-test.c                           \
-       $(top_srcdir)/shared/matrix.c           \
-       $(top_srcdir)/shared/matrix.h
+       ../shared/matrix.c                      \
+       ../shared/matrix.h
 matrix_test_LDADD = -lm -lrt
 
 setbacklight_SOURCES =                         \
        setbacklight.c                          \
-       $(top_srcdir)/src/libbacklight.c        \
-       $(top_srcdir)/src/libbacklight.h
+       ../src/libbacklight.c                   \
+       ..//src/libbacklight.h
 
 setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS)
 setbacklight_LDADD = $(SETBACKLIGHT_LIBS)