build-sys: copy rootfs to another directory
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Fri, 11 May 2012 03:04:59 +0000 (00:04 -0300)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 11 May 2012 05:23:34 +0000 (02:23 -0300)
We can't use the rootfs directory because it breaks out-of-tree build
and in future we want to make modifications to the fake filesystem such
as adding and removing files.

We need to call "chmod -R +w" in the resulting directory because when we
distribute the source with make dist all files will be readonly.

Fix 'make distcheck'

Makefile.am
testsuite/.gitignore

index c611604..ab3dd4c 100644 (file)
@@ -127,6 +127,9 @@ endif
 # TESTSUITE
 # ------------------------------------------------------------------------------
 
+testsuite/rootfs-dirty: $(top_srcdir)/testsuite/rootfs
+       $(AM_V_GEN) cp -r $< $@
+
 TESTSUITE_OVERRIDE_LIBS = testsuite/uname.la testsuite/path.la \
                          testsuite/init_module.la \
                          testsuite/delete_module.la
@@ -145,14 +148,14 @@ testsuite_init_module_la_SOURCES = testsuite/init_module.c \
 testsuite_init_module_la_LIBADD = libkmod/libkmod-private.la
 
 TESTSUITE_CPPFLAGS = $(AM_CPPFLAGS) \
-                    -DTESTSUITE_ROOTFS=\"$(abs_top_builddir)/testsuite/rootfs/\" \
+                    -DTESTSUITE_ROOTFS=\"$(abs_top_builddir)/testsuite/rootfs-dirty/\" \
                     -DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\"
 TESTSUITE_LDADD = testsuite/libtestsuite.la libkmod/libkmod-private.la
 
 check_LTLIBRARIES += testsuite/libtestsuite.la
 testsuite_libtestsuite_la_SOURCES = testsuite/testsuite.c \
                                    testsuite/testsuite.h
-testsuite_libtestsuite_la_DEPENDENCIES = testsuite/rootfs \
+testsuite_libtestsuite_la_DEPENDENCIES = testsuite/rootfs-dirty \
                                    $(TESTSUITE_OVERRIDE_LIBS)
 testsuite_libtestsuite_la_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 
@@ -177,6 +180,11 @@ testsuite_test_new_module_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 testsuite_test_modprobe_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_modprobe_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 
+testsuite-distclean:
+       -find testsuite/rootfs-dirty -type d -exec chmod +w {} \;
+       -$(RM) -rf testsuite/rootfs-dirty
+
+DISTCLEAN_LOCAL_HOOKS += testsuite-distclean
 EXTRA_DIST += testsuite/rootfs
 
 DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
index 431b9b7..ef7bb2b 100644 (file)
@@ -9,3 +9,4 @@
 /test-new-module
 /test-testsuite
 /test-modprobe
+/rootfs-dirty